/* 
  GOLDCAMP - Design System & UI/UX Styling
  Style: Gamifié, Premium, Tactile (Inspiré de Roblox & Clash Royale)
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Plus+Jakarta+Sans:wght@400;500;700;800&display=swap');

:root {
  /* Palette de couleurs GOLDCAMP (PRD v3.1) */
  --color-gold: #F4B400;
  --color-gold-light: #FFD700;
  --color-gold-dark: #C99300;
  --color-gold-gradient: linear-gradient(135deg, #FFDF00 0%, #F4B400 50%, #D48F00 100%);
  
  --color-green: #1E5631;
  --color-green-light: #2D8C4E;
  --color-green-dark: #12361E;
  --color-green-gradient: linear-gradient(135deg, #2D8C4E 0%, #1E5631 60%, #0F2D19 100%);

  --color-earth: #7A5230;
  --color-earth-light: #9B6C45;
  --color-earth-dark: #5C3A20;
  --color-earth-gradient: linear-gradient(135deg, #9B6C45 0%, #7A5230 60%, #51341B 100%);

  --color-sand: #E9D8A6;
  --color-sand-light: #F4EBC4;
  --color-sand-dark: #D3BE82;

  --color-alert: #D62828;
  --color-alert-light: #F05050;
  --color-alert-dark: #A71616;
  --color-alert-gradient: linear-gradient(135deg, #F05050 0%, #D62828 60%, #9F1616 100%);

  --color-bg-ambient: linear-gradient(180deg, #F6F3EB 0%, #EDE7D8 100%);
  --color-dark-text: #1E2522;
  --color-muted-text: #6A7570;
  
  /* Systèmes d'ombres & Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-dark: rgba(30, 37, 34, 0.08);
  --glass-border: 1px solid rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 8px 24px rgba(122, 82, 48, 0.06);
  --inset-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  --tactile-shadow-sm: 0 4px 0 rgba(0, 0, 0, 0.15);
  --tactile-shadow-md: 0 6px 0 rgba(0, 0, 0, 0.18);
  --tactile-shadow-lg: 0 8px 0 rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #252b28;
  color: var(--color-dark-text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* --- TÉLÉPHONE SHELL MOCKUP (Desktop uniquement) --- */
.phone-shell {
  width: 412px;
  height: 860px;
  background: #0f1311;
  border: 12px solid #2e3532;
  border-radius: 48px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 4px #1c211f;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Dynamic Island / Notch */
.phone-shell::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 1000;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

/* === MOBILE : retirer le mockup, plein écran natif === */
@media (max-width: 768px) {
  body {
    display: block;
    align-items: unset;
    justify-content: unset;
    overflow: auto;
    background: var(--color-bg-ambient);
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* dynamic viewport pour barre nav Android */
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--color-bg-ambient);
  }

  .phone-shell::before {
    display: none; /* pas de notch simulé sur vrai mobile */
  }

  .status-bar {
    display: none; /* le téléphone a déjà sa propre barre de statut */
  }
}

/* PWA installée en standalone : pareil, plein écran */
@media (display-mode: standalone) {
  body {
    display: block;
    overflow: auto;
    background: var(--color-bg-ambient);
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-shell::before,
  .status-bar {
    display: none;
  }
}

/* Mobile Screen Container */
.phone-screen {
  flex: 1;
  background: var(--color-bg-ambient);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Status Bar */
.status-bar {
  height: 48px;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-dark-text);
  z-index: 999;
}

.status-bar .right-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* --- HEADER OPÉRATEUR --- */
.app-header {
  background: linear-gradient(135deg, #1E5631 0%, #153e23 100%);
  padding: 55px 20px 20px 20px;
  position: relative;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  box-shadow: 0 6px 20px rgba(15, 45, 25, 0.25);
  color: #fff;
}

.header-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 12px;
  background: var(--color-bg-ambient);
  clip-path: ellipse(60% 100% at 50% 100%);
}

.operator-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
}

.avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--color-gold);
  background: #3e5046;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: var(--color-gold);
  border: 2px solid #1E5631;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.operator-info {
  flex: 1;
}

.operator-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-sand);
  font-weight: 700;
}

.operator-name {
  font-size: 18px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.sync-status {
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sync-status:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.25);
}

.sync-dot {
  width: 8px;
  height: 8px;
  background: #4ef03b;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ef03b;
}

.sync-dot.offline {
  background: var(--color-gold);
  box-shadow: 0 0 8px var(--color-gold);
}

/* --- CAMP INFO BANNER --- */
.camp-info-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 8px 14px;
  margin: 0 20px 10px 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-dark-text);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: relative;
}
.camp-info-icon { font-size: 16px; }
.camp-info-name { font-weight: 800; color: var(--color-dark-text); }
.camp-info-sep { color: var(--color-muted-text); font-weight: 400; }
.camp-info-tige { color: var(--color-gold-dark); }
.camp-info-loc { color: var(--color-muted-text); font-size: 11px; font-weight: 600; }
.camp-info-arrow { margin-left: auto; color: var(--color-muted-text); font-size: 14px; }

.camp-location-panel {
  margin: 0 20px 10px 20px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 12px;
}
.camp-location-panel.hidden { display: none; }
.camp-loc-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.camp-loc-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 12px;
  font-family: 'Outfit', sans-serif;
  background: #f9f7f2;
  outline: none;
}
.camp-loc-btn-gps, .camp-loc-btn-save {
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.camp-loc-btn-gps { background: #e8f0fe; color: #1a73e8; }
.camp-loc-btn-save { background: var(--color-green); color: white; }
.camp-loc-coords {
  font-size: 11px;
  color: var(--color-muted-text);
  margin: 6px 0 0 0;
}

/* --- STATS D'ACCUEIL --- */
.quick-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 20px 8px 20px;
}

.stat-box {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.stat-box.gold-box::before {
  background: var(--color-gold-gradient);
}

.stat-box.cash-box::before {
  background: var(--color-green-gradient);
}

.stat-icon-container {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--inset-shadow);
}

.gold-box .stat-icon-container {
  background: rgba(244, 180, 0, 0.15);
  color: var(--color-gold-dark);
}

.cash-box .stat-icon-container {
  background: rgba(30, 86, 49, 0.12);
  color: var(--color-green);
}

.stat-details {
  display: flex;
  flex-direction: column;
}

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

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-dark-text);
}

.stat-sub {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-muted-text);
}

/* --- MAIN ACTIONS GRID --- */
.actions-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 80px 20px;
}

.grid-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-muted-text);
  margin: 12px 0 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-title .caisse-badge {
  background: var(--color-green-light);
  color: white;
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

.grid-title .caisse-badge.closed {
  background: var(--color-alert);
}

.main-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Tactile 3D Action Cards */
.action-card {
  border-radius: 24px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  overflow: hidden;
  box-shadow: var(--tactile-shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-card:active {
  transform: translateY(4px);
  box-shadow: var(--tactile-shadow-sm);
}

.action-card.btn-vendre {
  background: var(--color-green-gradient);
}
.action-card.btn-achat-or {
  background: var(--color-gold-gradient);
}
.action-card.btn-caisse {
  background: var(--color-earth-gradient);
}

.action-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-card-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.action-card-text {
  display: flex;
  flex-direction: column;
}

.action-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.action-card-desc {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
}

.action-card-arrow {
  font-size: 20px;
  opacity: 0.8;
}

/* Secondary Actions (2 columns) */
.secondary-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.secondary-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--tactile-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid rgba(0, 0, 0, 0.12);
}

.secondary-card:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

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

.secondary-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--inset-shadow);
}

.secondary-card.btn-dettes .secondary-card-icon {
  background: rgba(214, 40, 40, 0.1);
  color: var(--color-alert);
}

.secondary-card.btn-stock .secondary-card-icon {
  background: rgba(122, 82, 48, 0.1);
  color: var(--color-earth);
}

.secondary-card-name {
  font-size: 14px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--color-dark-text);
}

.secondary-card-stat {
  font-size: 11px;
  color: var(--color-muted-text);
  font-weight: 700;
}

.secondary-card-badge {
  background: var(--color-alert);
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 800;
}

/* --- APP TAB SCREENS --- */
.tab-content {
  display: none;
  flex-direction: column;
  height: calc(100% - 48px); /* Less status bar */
}

.tab-content.active {
  display: flex;
}

/* Inner Page Header */
.page-header-row {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.page-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.back-btn:active {
  transform: scale(0.9);
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 240px 20px; /* 240px = action-footer (~92px) + nav (~72px) + extra marge */
}

/* --- STEP FLOW DESIGN --- */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  z-index: 1;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8e5;
  border: 3px solid var(--color-bg-ambient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  z-index: 2;
  color: var(--color-muted-text);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--color-green);
  color: white;
  box-shadow: 0 0 10px rgba(30, 86, 49, 0.3);
}

.step-dot.completed {
  background: var(--color-green-light);
  color: white;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

/* --- VENTE FLOW - STEP 1 (CLIENTS) --- */
.client-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.search-bar {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  padding: 12px 16px;
  width: 100%;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-bar:focus {
  background: white;
  border-color: var(--color-green-light);
  box-shadow: 0 4px 12px rgba(30, 86, 49, 0.05);
}

.client-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  transition: all 0.2s ease;
}

.client-card:active, .client-card.selected {
  border-color: var(--color-green);
  background: rgba(30, 86, 49, 0.03);
}

.client-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-sand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-earth-dark);
}

.client-name {
  font-size: 14px;
  font-weight: 700;
}

.client-phone {
  font-size: 11px;
  color: var(--color-muted-text);
}

.client-debt-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(214, 40, 40, 0.08);
  color: var(--color-alert);
}

.client-debt-tag.none {
  background: rgba(30, 86, 49, 0.06);
  color: var(--color-green);
}

/* --- VENTE FLOW - STEP 2 (PRODUITS) --- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 24px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  box-shadow: var(--tactile-shadow-sm);
  border-bottom: 3px solid rgba(0, 0, 0, 0.08);
  transition: all 0.1s ease;
}

.product-card:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.product-card.selected {
  border-color: var(--color-green);
  background: rgba(30, 86, 49, 0.03);
}

.product-img-container {
  width: 64px;
  height: 64px;
  background: #f7f5f0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: var(--inset-shadow);
}

.product-info-name {
  font-size: 14px;
  font-weight: 800;
}

.product-info-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-green);
}

.product-stock-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e2e8e5;
  color: var(--color-muted-text);
}

.product-stock-pill.low {
  background: rgba(214, 40, 40, 0.1);
  color: var(--color-alert);
  animation: pulse-red 2s infinite;
}

.product-qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-green-light);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* --- VENTE FLOW - STEP 3 (PAIEMENT MIXTE) --- */
.mixed-payment-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.payment-method-row {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.payment-method-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
}

.payment-method-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.badge-cash { background: rgba(30, 86, 49, 0.1); color: var(--color-green); }
.badge-digidor { background: rgba(244, 180, 0, 0.15); color: var(--color-gold-dark); }
.badge-bon { background: rgba(214, 40, 40, 0.1); color: var(--color-alert); }

.payment-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tactile-spinner {
  display: flex;
  align-items: center;
  background: #f4f2eb;
  border-radius: 16px;
  padding: 2px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.spinner-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: white;
  border: none;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--tactile-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.spinner-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.spinner-val {
  min-width: 60px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 16px;
}

.payment-input-fcfa {
  background: #f4f2eb;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  padding: 10px 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 16px;
  width: 120px;
  text-align: right;
  outline: none;
}

.payment-input-fcfa:focus {
  background: white;
  border-color: var(--color-green-light);
}

.tige-weight-calc {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted-text);
  text-align: right;
}

/* Total Panel */
.total-summary-panel {
  background: linear-gradient(135deg, #1E2522 0%, #111513 100%);
  color: white;
  border-radius: 24px;
  padding: 16px 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  margin-top: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.summary-row.main-total {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  opacity: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  margin-bottom: 0;
}

.summary-row.due {
  color: var(--color-gold);
}

.summary-row.remaining {
  color: var(--color-alert-light);
  font-weight: 700;
}

.summary-row.remaining.complete {
  color: #4ef03b;
}

/* --- TACTILE BOTTOM NAVIGATION BAR --- */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 12px; /* Notch space on actual phones */
  z-index: 1001;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-muted-text);
  cursor: pointer;
  width: 60px;
  height: 50px;
  transition: all 0.2s ease;
}

.nav-item.active {
  color: var(--color-green);
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 3px;
  transition: transform 0.2s ease;
}

.nav-item.active .nav-icon {
  transform: translateY(-4px) scale(1.15);
}

.nav-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

/* --- PRIMARY ACTION BUTTONS (FLOATING FOOTER) --- */
.action-footer {
  padding: 16px 20px 24px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 40%);
  position: absolute;
  bottom: 60px; /* Just above standard navigation */
  left: 0;
  width: 100%;
  z-index: 100;
}

.primary-btn {
  width: 100%;
  height: 52px;
  border-radius: 20px;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  box-shadow: var(--tactile-shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.primary-btn:active {
  transform: translateY(4px);
  box-shadow: var(--tactile-shadow-sm);
}

.primary-btn.btn-confirm-green {
  background: var(--color-green-gradient);
  border-bottom: 4px solid var(--color-green-dark);
}

.primary-btn.btn-confirm-gold {
  background: var(--color-gold-gradient);
  border-bottom: 4px solid var(--color-gold-dark);
  color: #4b3400;
}

.primary-btn:disabled {
  background: #cbd3d0 !important;
  border-color: #9ea8a5 !important;
  color: #7d8784 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}

/* --- ACHAT OR SCREEN --- */
.or-valuation-dashboard {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--glass-shadow);
  margin-bottom: 16px;
}

.or-dashboard-header {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--color-gold-dark);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gold-refresh-btn {
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.gold-refresh-btn:hover { background: rgba(201,162,39,0.3); }

/* Live multi-currency gold price table */
.or-live-prices {
  background: rgba(0,0,0,0.04);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.or-live-header {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-muted-text);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  margin-bottom: 6px;
}
.or-live-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.or-live-row:last-of-type { border-bottom: none; }
.or-live-row-gold .or-live-curr,
.or-live-row-gold .or-live-val,
.or-live-row-gold .or-live-val2 { color: var(--color-gold-dark); font-weight: 800; }
.or-live-curr {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
}
.or-live-val {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
}
.or-live-val2 {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted-text);
}
.or-live-footer {
  margin-top: 6px;
  font-size: 10px;
  color: var(--color-muted-text);
  text-align: right;
}

.or-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.or-kpi-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.or-kpi-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-muted-text);
}

.or-kpi-val {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.or-kpi-val.green {
  color: var(--color-green-light);
  animation: heart-pulse 2.5s infinite;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-dark-text);
  display: flex;
  justify-content: space-between;
}

.form-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--color-gold);
}

.form-input-suffix {
  position: absolute;
  right: 16px;
  font-weight: 700;
  color: var(--color-muted-text);
}

.range-slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  accent-color: var(--color-gold);
  margin: 10px 0;
}

/* --- HISTORIQUE & LOGS IMMUABLES (APPEND-ONLY) --- */
.logs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.log-item {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.log-item.voided {
  opacity: 0.55;
  background: #f9ecec;
  border-color: rgba(214, 40, 40, 0.15);
}

.log-item.voided::after {
  content: 'ANNULÉ';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-alert);
  color: white;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.log-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.log-icon.sale { background: rgba(30, 86, 49, 0.08); color: var(--color-green); }
.log-icon.gold { background: rgba(244, 180, 0, 0.12); color: var(--color-gold-dark); }
.log-icon.expense { background: rgba(122, 82, 48, 0.08); color: var(--color-earth); }

.log-body {
  flex: 1;
}

.log-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.log-title {
  font-size: 13px;
  font-weight: 800;
}

.log-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.log-amount.in { color: var(--color-green-light); }
.log-amount.out { color: var(--color-alert); }

.log-meta {
  font-size: 10px;
  color: var(--color-muted-text);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.log-uuid {
  font-family: monospace;
  font-size: 8px;
  opacity: 0.6;
}

.void-action-btn {
  background: none;
  border: none;
  color: var(--color-alert);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(214, 40, 40, 0.06);
  margin-top: 6px;
}

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

/* --- CLÔTURE DE CAISSE DESIGN --- */
.caisse-session-card {
  background: white;
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--glass-shadow);
  border: var(--glass-border);
  margin-bottom: 16px;
}

.caisse-session-header {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--color-earth);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.caisse-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.caisse-stat-tile {
  background: #f7f5f0;
  border-radius: 14px;
  padding: 10px 12px;
}

.caisse-tile-lbl {
  font-size: 9px;
  font-weight: 700;
  color: var(--color-muted-text);
  text-transform: uppercase;
}

.caisse-tile-val {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.variance-alert-box {
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 14px;
  background: #e2e8e5;
  color: var(--color-muted-text);
}

.variance-alert-box.green {
  background: rgba(30, 86, 49, 0.08);
  color: var(--color-green-light);
  border: 1px solid rgba(30, 86, 49, 0.15);
}

.variance-alert-box.red {
  background: rgba(214, 40, 40, 0.08);
  color: var(--color-alert);
  border: 1px solid rgba(214, 40, 40, 0.15);
  animation: shake 0.5s ease;
}

/* --- ANIMATIONS DICTIONARY --- */
@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(214, 40, 40, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(214, 40, 40, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(214, 40, 40, 0); }
}

@keyframes heart-pulse {
  0% { transform: scale(1); }
  14% { transform: scale(1.05); }
  28% { transform: scale(1); }
  42% { transform: scale(1.05); }
  70% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* --- DECORATIONS & EFFECTS --- */
.coin-rain-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.rain-coin {
  position: absolute;
  font-size: 24px;
  animation: fall 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fall {
  0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(850px) rotate(360deg); opacity: 0; }
}

/* Toast Message */
.toast-msg {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 37, 34, 0.9);
  color: white;
  border-radius: 30px;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 99999;
}

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

/* --- OVERLAY CAISSE CLÔTURÉE --- */
.caisse-closed-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(21, 26, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s ease;
}

.caisse-closed-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.caisse-closed-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 32px;
  padding: 30px 24px;
  width: 100%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  text-align: center;
  border-bottom: 5px solid rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  animation: slide-up-rebound 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.caisse-lock-emoji {
  font-size: 56px;
  margin-bottom: 12px;
  display: inline-block;
  animation: heart-pulse 2s infinite;
}

.caisse-closed-card h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--color-dark-text);
  margin-bottom: 8px;
}

.caisse-closed-card p {
  font-size: 12px;
  color: var(--color-muted-text);
  line-height: 1.5;
  font-weight: 500;
}

@keyframes slide-up-rebound {
  0% { transform: translateY(100px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* --- CLIENT SELECTION ACTION HEADER --- */
.client-selection-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.client-selection-actions .search-bar {
  flex: 1;
}

.add-client-toggle-btn {
  background: var(--color-green-gradient);
  border: none;
  border-bottom: 3px solid var(--color-green-dark);
  color: white;
  border-radius: 16px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--tactile-shadow-sm);
  transition: transform 0.1s ease;
}

.add-client-toggle-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.add-client-toggle-btn.active {
  background: var(--color-alert-gradient);
  border-bottom-color: var(--color-alert-dark);
}

.add-client-form-container {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin-bottom 0.3s ease;
  max-height: 250px;
  opacity: 1;
  margin-bottom: 12px;
}

.add-client-form-container.hidden {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-bottom: 0 !important;
  pointer-events: none;
}

.add-client-form-card {
  background: #fdfaf3;
  border: 2px dashed var(--color-sand-dark);
  border-radius: 20px;
  padding: 14px;
  box-shadow: inset 0 2px 4px rgba(122, 82, 48, 0.03);
}

.add-client-form-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-earth-light);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

/* --- PERFORMANCE DASHBOARD CARD --- */
.dashboard-stats-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--glass-shadow);
  margin-top: 16px;
  border-bottom: 3px solid rgba(0, 0, 0, 0.08);
}

.stats-live-badge {
  background: var(--color-green-light);
  color: white;
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.stats-kpi-tile {
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-kpi-tile.stat-tile-ca {
  background: rgba(45, 140, 78, 0.04);
  border-left: 3px solid var(--color-green-light);
}

.stats-kpi-tile.stat-tile-marge {
  background: rgba(244, 180, 0, 0.04);
  border-left: 3px solid var(--color-gold);
}

.stats-kpi-tile.stat-tile-opex {
  background: rgba(214, 40, 40, 0.04);
  border-left: 3px solid var(--color-alert);
}

.stats-kpi-tile.stat-tile-net {
  background: rgba(30, 86, 49, 0.07);
  border-left: 3px solid var(--color-green);
}

.stats-kpi-lbl {
  font-size: 8px;
  font-weight: 800;
  color: var(--color-muted-text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stats-kpi-val {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-dark-text);
}

.stats-arbitrage-box {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.02);
}

.stats-arbitrage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--color-dark-text);
  margin-bottom: 6px;
}

.stats-arbitrage-percent {
  font-family: 'Outfit', sans-serif;
  color: var(--color-gold-dark);
}

.stats-arbitrage-progress-bg {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 3px;
  overflow: hidden;
}

.stats-arbitrage-progress-bar {
  height: 100%;
  background: var(--color-gold-gradient);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-arbitrage-desc {
  font-size: 8px;
  color: var(--color-muted-text);
  margin-top: 4px;
  font-weight: 600;
}

/* --- ADD CUSTOM LOG ICONS --- */
.log-icon.stock_purchase {
  background: rgba(122, 82, 48, 0.12);
  color: var(--color-earth-light);
}

.log-icon.debt_repayment {
  background: rgba(214, 40, 40, 0.08);
  color: var(--color-alert);
}

/* ============================================================
   AUTH OVERLAY — Écran de connexion
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #1a0c02 0%, #2e1a05 50%, #0d0601 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

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

.auth-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 28px;
  padding: 32px 24px 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 40px rgba(201,162,39,0.08);
}

.auth-logo {
  font-size: 56px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 16px rgba(244, 180, 0, 0.5));
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #F4B400;
  letter-spacing: 3px;
  margin: 0 0 4px 0;
}

.auth-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(201, 162, 39, 0.6);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 28px 0;
}

/* ============================================================
   APP MAIN WRAPPER
   ============================================================ */
#app-main-wrapper.hidden {
  display: none;
}

/* ============================================================
   SYNC DOT — état syncing
   ============================================================ */
.sync-dot.syncing {
  background: var(--color-gold);
  animation: heart-pulse 0.5s infinite;
}

/* ============================================================
   ONGLET CLIENTS
   ============================================================ */

/* Bouton ➕ nouveau client */
.new-client-fab {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  background: var(--color-green);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(30,86,49,0.35);
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.new-client-fab:active { transform: scale(0.93); }

/* Panneau formulaire nouveau client */
.new-client-panel {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-top: 4px solid var(--color-green);
}
.new-client-panel.hidden { display: none; }
.new-client-panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--color-green);
  margin: 0 0 12px 0;
}

/* KPIs globaux */
.clients-kpi-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.clients-kpi-card {
  flex: 1;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  border-left: 4px solid var(--color-green);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.clients-kpi-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-muted-text);
  display: block;
  margin-bottom: 3px;
}
.clients-kpi-val {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--color-dark-text);
}

/* Carte client dans la liste */
.client-tab-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.client-tab-card:active {
  transform: scale(0.98);
}
.client-tab-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.client-tab-main {
  flex: 1;
  min-width: 0;
}
.client-tab-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--color-dark-text);
}
.client-tab-phone {
  font-size: 11px;
  color: var(--color-muted-text);
  margin-bottom: 5px;
}
.client-tab-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.client-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
}
.chip-ca    { background: #e8f5ed; color: var(--color-green); }
.chip-achats { background: #f0eeff; color: #5b3fd6; }
.chip-dette { background: #fdeaea; color: var(--color-alert); }
.chip-ok    { background: #e8f5ed; color: var(--color-green); }

.client-tab-arrow {
  font-size: 22px;
  color: var(--color-muted-text);
  font-weight: 300;
  flex-shrink: 0;
}

/* ============================================================
   FICHE CLIENT — Overlay détail
   ============================================================ */
.client-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: flex-end;
}
.client-detail-overlay.hidden {
  display: none;
}
.client-detail-panel {
  background: var(--color-bg-ambient);
  width: 100%;
  max-height: 88%;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  padding: 20px 16px 40px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
}
.client-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.client-detail-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.client-detail-info {
  flex: 1;
}
.client-detail-name {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-dark-text);
}
.client-detail-phone {
  font-size: 12px;
  color: var(--color-muted-text);
}
.client-detail-close {
  background: #eee;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* KPI grid dans la fiche */
.cd-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.cd-kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-top: 3px solid transparent;
}
.cd-kpi-ca    { border-top-color: var(--color-green); }
.cd-kpi-achats { border-top-color: #7c5cbf; }
.cd-kpi-dette  { border-top-color: var(--color-alert); }
.cd-kpi-remb   { border-top-color: var(--color-gold-dark); }
.cd-kpi-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-muted-text);
  display: block;
  margin-bottom: 4px;
}
.cd-kpi-val {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--color-dark-text);
}

/* Historique dans la fiche */
.cd-history-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-muted-text);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.cd-op-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.cd-op-item.voided {
  opacity: 0.45;
}
.cd-op-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.cd-op-body {
  flex: 1;
  min-width: 0;
}
.cd-op-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-dark-text);
}
.cd-op-meta {
  font-size: 10px;
  color: var(--color-muted-text);
  margin-top: 2px;
}
.cd-op-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.cd-op-amount.in  { color: var(--color-green); }
.cd-op-amount.out { color: var(--color-alert); }

/* ── PRÊTS & AVANCES ── */
.pret-detail-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #f8f6f0;
  border-radius: 12px;
  padding: 10px 12px;
}
.pret-detail-kpi { text-align: center; }
.pret-kpi-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-muted-text);
  display: block;
  margin-bottom: 2px;
}
.pret-kpi-val {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-dark-text);
  display: block;
}

/* ── TOGGLE FCFA / TIGES ── */
.prix-toggle {
  display: flex;
  background: #f0ede6;
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
  cursor: pointer;
}
.prix-toggle-opt {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 16px;
  color: var(--color-muted-text);
  transition: all 0.18s;
  white-space: nowrap;
}
.prix-toggle-opt.active {
  background: var(--color-dark-bg);
  color: var(--color-gold-light);
}

/* ── RÉCAP COMMANDE (Step 3) ── */
.recap-client-row { margin-bottom: 16px; }
.recap-client {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f4f2eb;
  border-radius: 14px;
  padding: 12px 16px;
}
.recap-client-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
}
.recap-client-name { font-size: 15px; font-weight: 800; color: var(--color-dark-text); }
.recap-client-phone { font-size: 11px; color: var(--color-muted-text); }

.recap-items-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.recap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ede9df;
}
.recap-item-emoji { font-size: 24px; flex-shrink: 0; }
.recap-item-info { flex: 1; }
.recap-item-name { font-size: 14px; font-weight: 700; color: var(--color-dark-text); display: block; }
.recap-item-qty { font-size: 11px; color: var(--color-muted-text); display: block; margin-top: 2px; }
.recap-item-right { text-align: right; }
.recap-item-total {
  font-family: 'Outfit', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--color-dark-text);
  display: block;
}
.recap-tige-hint { font-size: 10px; font-weight: 800; color: var(--color-gold-dark); display: block; }

.recap-total-row {
  background: var(--color-dark-bg);
  border-radius: 16px;
  padding: 16px 20px;
}
.recap-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 700;
}
.recap-total-val {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--color-gold-light);
}
.recap-total-tiges { color: var(--color-gold-light); }
.recap-item-tiges  { color: var(--color-gold-dark); }
.recap-total-sub {
  text-align: right;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: -6px;
  padding-right: 20px;
  padding-bottom: 4px;
}

/* ── TIGE SUGGESTIONS PANEL (Step 4) ── */
#tige-suggestions-panel {
  background: linear-gradient(135deg, #2e1a05 0%, #1a0c02 100%);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(201,147,0,0.25);
}
.tige-sugg-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-gold-dark);
  margin-bottom: 10px;
}
.tige-sugg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tige-sugg-row:last-of-type { border-bottom: none; }
.tige-sugg-label {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
}
.tige-sugg-vals {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tige-sugg-fcfa {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}
.tige-sugg-sep {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}
.tige-sugg-or {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-gold-light);
  font-family: 'Outfit', sans-serif;
}
.tige-apply-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(244, 180, 0, 0.18);
  border: 1.5px solid rgba(201, 147, 0, 0.5);
  border-radius: 12px;
  color: var(--color-gold-light);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.15s;
  text-align: center;
}
.tige-apply-btn:active { background: rgba(244, 180, 0, 0.35); }


