/* ==========================================================================
   MA BOUTIQUE — CAISSE INTERNE  v4.0
   Design System — Vert Émeraude / Menthe
   Référence : Mockup fintech africaine Wave/Orange Money style
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* ═══ Palette Verte Émeraude ═══ */
  --green-900: #064E3B;
  --green-800: #065F46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10B981;
  --green-400: #34D399;
  --green-100: #D1FAE5;
  --green-50:  #ECFDF5;

  /* ═══ Surfaces & Fonds ═══ */
  --bg:       #F0FDF4;         /* Fond app — menthe très clair */
  --bg2:      #E8FAF0;         /* Fond légèrement plus vert */
  --surface:  #FFFFFF;
  --border:   #D1FAE5;         /* Bordures vertes très claires */
  --border2:  #A7F3D0;

  /* ═══ Texte ═══ */
  --text:      #064E3B;        /* Vert très foncé = quasi-noir */
  --text-2:    #065F46;
  --text-3:    #6B7280;        /* Gris neutre */
  --text-muted:#9CA3AF;

  /* ═══ Sémantique ═══ */
  --success:    #059669;
  --success-bg: #D1FAE5;
  --danger:     #DC2626;
  --danger-bg:  #FEF2F2;
  --warning:    #D97706;
  --warning-bg: #FEF3C7;
  --info:       #2563EB;
  --info-bg:    #DBEAFE;

  /* ═══ Ombres ═══ */
  --shadow-xs:  0 1px 2px rgba(6,95,70,0.04);
  --shadow-sm:  0 2px 8px rgba(6,95,70,0.06), 0 0 1px rgba(6,95,70,0.08);
  --shadow-md:  0 4px 16px rgba(6,95,70,0.08), 0 1px 4px rgba(6,95,70,0.04);
  --shadow-lg:  0 12px 32px rgba(6,95,70,0.12);
  --shadow-green: 0 8px 24px rgba(5,150,105,0.25);

  /* ═══ Arrondis ═══ */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 28px;
  --r-full: 9999px;

  /* ═══ Typographie ═══ */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Roboto Mono', Consolas, monospace;

  /* ═══ Transitions ═══ */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.15s var(--ease);
  --t-mid:  0.25s var(--ease);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
}

/* ═══════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════ */
#app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(6,95,70,0.08);
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════
   WALLET HEADER (Floating Green Card)
   ═══════════════════════════════════════════════ */
.wallet-header {
  margin: calc(14px + env(safe-area-inset-top, 0px)) 16px 0;
  background: linear-gradient(160deg, var(--green-900) 0%, var(--green-700) 50%, var(--green-600) 100%);
  border-radius: var(--r-xl);
  padding: 20px;
  color: #FFF;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-green);
}

.wallet-header::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -60px;
  right: -40px;
  pointer-events: none;
}

.wallet-header::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -30px;
  left: -20px;
  pointer-events: none;
}

.wh-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.wh-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wh-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFF;
  color: var(--green-800);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wh-name {
  font-size: 16px;
  font-weight: 700;
  color: #FFF;
  line-height: 1.2;
}

.wh-role {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
}

.wh-bell {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #FFF;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast);
}

.wh-bell:active { background: rgba(255,255,255,0.22); }

.wh-balance-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.wh-balance-amount {
  font-size: 38px;
  font-weight: 800;
  color: #FFF;
  font-family: var(--mono);
  letter-spacing: -0.02em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.wh-eye-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 5px 14px;
  border-radius: var(--r-full);
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--t-fast);
}

.wh-eye-btn:active { background: rgba(255,255,255,0.25); }

.wh-glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: #FFF;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.45);
  padding: 5px 11px;
  border-radius: var(--r-full);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--t-fast);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.wh-glass-btn:active {
  background: rgba(255, 255, 255, 0.42);
  transform: scale(0.96);
}

.wh-glass-btn-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.98));
  border: 1px solid rgba(254, 243, 199, 0.65);
  color: #FFF;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wh-glass-btn-gold:active {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.98), rgba(180, 83, 9, 1));
}

.wh-chips {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.wh-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #FFF;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 5px 14px;
  border-radius: var(--r-full);
}

.wh-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-400);
}

/* ═══════════════════════════════════════════════
   PAGE CONTENT AREA
   ═══════════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 14px 16px calc(115px + env(safe-area-inset-bottom, 24px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.page-content::after {
  content: '';
  display: block;
  height: calc(16px + env(safe-area-inset-bottom, 12px));
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   QR CARD (below wallet header)
   ═══════════════════════════════════════════════ */
.qr-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: center;
}

.qr-card-left {
  flex: 1;
}

.qr-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--green-50);
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 8px;
}

.qr-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.qr-card-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.4;
  margin-bottom: 12px;
}

.qr-card-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qr-btn-fill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  background: var(--green-600);
  color: #FFF;
  transition: background var(--t-fast);
}

.qr-btn-fill:active { background: var(--green-700); }

.qr-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  background: var(--surface);
  color: var(--green-700);
  border: 1.5px solid var(--border2);
  transition: background var(--t-fast);
}

.qr-btn-outline:active { background: var(--green-50); }

.qr-card-img {
  width: 80px;
  height: 80px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  padding: 4px;
  background: var(--surface);
  flex-shrink: 0;
}

.qr-card-img img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════
   ACTION GRID (8 actions — 4×2)
   ═══════════════════════════════════════════════ */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 4px 10px;
  border: none;
  background: var(--surface);
  border-radius: var(--r-lg);
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast), transform var(--t-fast);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}

.action-item:active {
  transform: scale(0.95);
  background: var(--green-50);
}

.action-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--green-500);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--green-700);
  position: relative;
}

.action-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  line-height: 1.15;
}

.action-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #FFF;
  font-size: 9px;
  font-weight: 800;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
  font-family: var(--font);
}

/* ═══════════════════════════════════════════════
   FINTECH HERO ACTIONS & THEMATIC MENU CARDS
   ═══════════════════════════════════════════════ */
.home-menu-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-actions-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px 10px 14px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04);
}

.hero-actions-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
  padding-left: 4px;
}

.hero-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 4px;
}

.hero-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.hero-action-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 4px 2px;
  transition: transform var(--t-fast);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.hero-action-btn:active {
  transform: scale(0.92);
}

.hero-action-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: all var(--t-fast);
}

.hero-action-icon svg,
.hero-action-icon .caisse-action-icon,
.hero-action-icon img {
  width: 26px;
  height: 26px;
}

.caisse-action-icon {
  display: inline-block;
  width: 26px;
  height: 26px;
  background-color: currentColor;
  -webkit-mask: url('../logo.png') no-repeat center / contain;
  mask: url('../logo.png') no-repeat center / contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.hero-action-icon.bg-emerald {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  color: #059669;
  border: 1px solid #A7F3D0;
}

.hero-action-icon.bg-teal {
  background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 100%);
  color: #0D9488;
  border: 1px solid #99F6E4;
}

.hero-action-icon.bg-purple {
  background: linear-gradient(135deg, #FAF5FF 0%, #EDE9FE 100%);
  color: #7C3AED;
  border: 1px solid #DDD6FE;
}

.hero-action-icon.bg-blue {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.hero-action-icon.bg-amber {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  color: #D97706;
  border: 1px solid #FDE68A;
}

.hero-action-icon.bg-rose {
  background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);
  color: #E11D48;
  border: 1px solid #FECDD3;
}

.hero-action-icon.bg-sky {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  color: #0284C7;
  border: 1px solid #BAE6FD;
}

.hero-action-icon.bg-slate {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  color: #475569;
  border: 1px solid #CBD5E1;
}

.hero-action-icon.bg-indigo {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  color: #4F46E5;
  border: 1px solid #C7D2FE;
}

.hero-action-icon.bg-cyan {
  background: linear-gradient(135deg, #ECFEFF 0%, #CFFAFE 100%);
  color: #0891B2;
  border: 1px solid #A5F3FC;
}

.hero-action-icon.bg-mint {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

.hero-action-icon.bg-violet {
  background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
  color: #8B5CF6;
  border: 1px solid #DDD6FE;
}

.hero-action-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.2px;
  max-width: 74px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-action-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #FFF;
  font-size: 10px;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
  border: 2px solid #FFF;
}

.menu-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.menu-group-header {
  padding: 8px 4px 6px;
}

.menu-group-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.menu-group-list {
  display: flex;
  flex-direction: column;
}

.menu-row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}

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

.menu-row-item:active {
  background: var(--bg);
}

.menu-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-row-icon svg {
  width: 20px;
  height: 20px;
}

.menu-row-icon.bg-purple-soft {
  background: #F5F3FF;
  color: #7C3AED;
}

.menu-row-icon.bg-blue-soft {
  background: #EFF6FF;
  color: #2563EB;
}

.menu-row-icon.bg-amber-soft {
  background: #FFFBEB;
  color: #D97706;
}

.menu-row-icon.bg-emerald-soft {
  background: #ECFDF5;
  color: #059669;
}

.menu-row-icon.bg-slate-soft {
  background: #F1F5F9;
  color: #475569;
}

.menu-row-icon.bg-indigo-soft {
  background: #EEF2FF;
  color: #4F46E5;
}

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

.menu-row-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.menu-row-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.menu-row-badge {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-200);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.menu-row-chevron {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════ */
.section-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-hd-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.section-hd-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-600);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

/* ═══════════════════════════════════════════════
   FEED LIST (recent transactions)
   ═══════════════════════════════════════════════ */
.feed-list {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: default;
}

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

.feed-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  font-weight: 700;
}

.fi-in  { background: var(--success-bg); color: var(--success); }
.fi-out { background: #FEE2E2; color: var(--danger); }

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

.feed-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px;
}

.feed-sub {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.feed-right {
  text-align: right;
  flex-shrink: 0;
}

.feed-amount {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.feed-amount.positive { color: var(--success); }
.feed-amount.negative { color: var(--danger); }

.feed-balance {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.feed-chevron {
  color: var(--text-muted);
  font-size: 14px;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-neutral { background: #F3F4F6;          color: var(--text-3); }
.badge-brand   { background: var(--green-50);   color: var(--green-700); }

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   SUB-PAGE HEADER (← Back navigation - iOS / Mobile Optimized)
   ═══════════════════════════════════════════════ */
.subpage-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  position: sticky;
  top: 0;
  z-index: 90;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--green-800);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.back-btn:hover {
  background: var(--green-50);
  border-color: var(--green-200);
  color: var(--green-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.12);
}

.back-btn:active {
  transform: scale(0.92);
  background: var(--green-100);
  box-shadow: none;
}

.back-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

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

.subpage-bar-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.subpage-bar-sub {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 1px;
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */
.login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(32px + env(safe-area-inset-top, 0px)) 24px calc(32px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--green-900), var(--green-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-green);
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 28px;
  text-align: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--r-2xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

/* ═══════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
}

input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus, select:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
  background: var(--surface);
}

input::placeholder { color: var(--text-muted); font-weight: 400; }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  width: 100%;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-primary {
  background: var(--green-600);
  color: #FFF;
  box-shadow: var(--shadow-green);
}

.btn-primary:hover:not(:disabled) { background: var(--green-700); }

.btn-secondary {
  background: var(--green-50);
  color: var(--green-700);
  border: 1.5px solid var(--border2);
}

.btn-ghost {
  background: var(--bg);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1.5px solid #FECACA;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  width: auto;
}

.btn-green { background: var(--green-600); color: #FFF; border-radius: var(--r-full); padding: 14px 20px; font-weight: 700; font-size: 14px; width: 100%; border: none; cursor: pointer; font-family: var(--font); }
.btn-green:active { background: var(--green-700); }
.btn-red-outline { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); border-radius: var(--r-full); font-weight: 700; cursor: pointer; padding: 14px 20px; font-size: 14px; width: 100%; font-family: var(--font); }

.link-btn { background: none; border: none; color: var(--green-600); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.link-btn.link-danger { color: var(--danger); }

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

/* ═══════════════════════════════════════════════
   TX CARD (history)
   ═══════════════════════════════════════════════ */
.tx-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.tx-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.tx-type-label { font-size: 13px; font-weight: 700; color: var(--text); }
.tx-amount { font-family: var(--mono); font-size: 16px; font-weight: 800; }
.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--danger); }
.tx-amount.neutral  { color: var(--green-600); }
.tx-meta { font-size: 11px; color: var(--text-3); line-height: 1.6; }

/* ═══════════════════════════════════════════════
   PENDING RECEIPT ALERT
   ═══════════════════════════════════════════════ */
.pending-alert {
  background: var(--warning-bg);
  border: 1.5px solid #FDE68A;
  border-radius: var(--r-lg);
  padding: 14px 16px;
}

.pending-alert-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400E;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════
   TABS / PILLS
   ═══════════════════════════════════════════════ */
.tab-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.tab-pills::-webkit-scrollbar { display: none; }

.tab-pill, .tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast);
  font-family: var(--font);
}

.tab-pill.active, .tab.active {
  background: var(--green-600);
  color: #FFF;
  border-color: var(--green-600);
}

/* ═══════════════════════════════════════════════
   MODAL (iOS / Mobile Safe-Area Optimized)
   ═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 78, 59, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: env(safe-area-inset-top, 0px);
}

.modal-box, .modal-content {
  background: var(--surface) !important;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 16px));
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 16px)) !important;
  width: 100%;
  max-width: 440px;
  max-height: calc(88vh - env(safe-area-inset-top, 0px));
  max-height: calc(88dvh - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.25s var(--ease);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  box-sizing: border-box;
}

@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
  .modal-box, .modal-content {
    border-radius: var(--r-2xl) !important;
    max-height: calc(85vh - env(safe-area-inset-top, 0px));
    padding-bottom: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(6, 78, 59, 0.25), 0 0 0 1px rgba(16, 185, 129, 0.1);
  }
}

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

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-title { font-size: 16px; font-weight: 800; color: var(--text); }
.modal-close { font-size: 20px; color: var(--text-3); cursor: pointer; background: none; border: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg); }
.modal-img-full { width: 100%; border-radius: var(--r-md); display: block; }

/* ═══════════════════════════════════════════════
   TOAST (Floats above bottom navbar)
   ═══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(92px + env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green-900);
  color: #FFF;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  z-index: 9999;
  max-width: 90%;
  text-align: center;
}

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

/* ═══════════════════════════════════════════════
   DEBT CARDS (High-Contrast Delimitation & Contours)
   ═══════════════════════════════════════════════ */
.debt-card {
  background: var(--surface);
  border-radius: 16px;
  /* Trait de contour foncé et net pour délimiter chaque dette sans ambiguïté */
  border: 2px solid #64748B;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.09);
  position: relative;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.debt-card:hover {
  box-shadow: 0 6px 20px -2px rgba(15, 23, 42, 0.13);
}

/* Délimitation spécifique par couleur selon le type de dette */
.debt-card.debt-owed {
  border-color: #64748B;
  border-left: 6px solid #DC2626 !important; /* Rouge foncé : Je dois */
}

.debt-card.debt-receivable {
  border-color: #64748B;
  border-left: 6px solid #059669 !important; /* Vert foncé : On me doit */
}

.debt-card.debt-pending {
  border-color: #64748B;
  border-left: 6px solid #D97706 !important; /* Orange ambre : En attente */
}

.debt-card.debt-repaid {
  border-color: #94A3B8 !important;
  border-left: 6px solid #64748B !important; /* Gris foncé : Soldé */
  background: #F8FAFC;
}

.debt-chip { display: inline-flex; flex-direction: column; align-items: center; background: var(--green-50); border: 1.5px solid #94A3B8; border-radius: var(--r-md); padding: 6px 14px; }
.debt-chip-title { font-size: 10px; font-weight: 700; color: var(--green-700); text-transform: uppercase; }
.debt-chip-amount { font-size: 15px; font-weight: 800; color: var(--green-700); font-family: var(--mono); }
.debt-summary-card { display: flex; gap: 8px; margin-top: 10px; }

/* ═══════════════════════════════════════════════
   CHAT
   ═══════════════════════════════════════════════ */
.chat-bubble { max-width: 78%; border-radius: var(--r-lg); padding: 10px 14px; font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
.chat-bubble.outgoing { background: var(--green-600); color: #FFF; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble.incoming { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-time { font-size: 10px; opacity: 0.65; margin-top: 2px; text-align: right; }
.chat-input-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-end; }

/* ═══════════════════════════════════════════════
   INVENTORY / BILAN
   ═══════════════════════════════════════════════ */
.bilan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bilan-cell { background: var(--green-50); border-radius: var(--r-md); padding: 12px; text-align: center; border: 1px solid var(--border); }
.bilan-cell-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 4px; }
.bilan-cell-value { font-size: 16px; font-weight: 800; font-family: var(--mono); color: var(--text); }

/* ═══════════════════════════════════════════════
   PERMISSIONS / SETTINGS
   ═══════════════════════════════════════════════ */
.permissions-matrix { background: var(--green-50); border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; border: 1px solid var(--border); }
.checkbox-label { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; margin-bottom: 10px; background: #ffffff; border: 1.5px solid var(--border2); padding: 12px 14px; border-radius: var(--r-md); transition: all 0.2s var(--ease); user-select: none; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.checkbox-label:hover { background: #f8fafc; border-color: var(--green-300); }
.checkbox-label:has(input:checked) { background: #ECFDF5; border-color: #34D399; }
.checkbox-label:last-child { margin-bottom: 0; }
.checkbox-label input[type="checkbox"] { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--green-600); cursor: pointer; pointer-events: auto; }
.checkbox-label span { line-height: 1.4; display: block; flex: 1; font-weight: 500; }
.advanced-toggle { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--green-50); border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.advanced-section { background: var(--green-50); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; }

/* ═══════════════════════════════════════════════
   QR MODAL EXTRAS
   ═══════════════════════════════════════════════ */
.qr-chip-btn { background: var(--green-50); color: var(--green-700); border: 1.5px solid var(--border2); border-radius: var(--r-full); font-size: 12px; font-weight: 700; padding: 6px 14px; cursor: pointer; font-family: var(--font); }

/* ═══════════════════════════════════════════════
   MISC UTILITIES
   ═══════════════════════════════════════════════ */
.mono { font-family: var(--mono); font-weight: 700; }
.error-text { color: var(--danger); font-size: 12px; font-weight: 600; min-height: 16px; margin-bottom: 8px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-3); font-size: 13px; line-height: 1.6; }
.empty-state-icon { font-size: 36px; margin-bottom: 12px; }
.inactive-tag { display: inline-flex; padding: 1px 7px; font-size: 10px; font-weight: 700; background: var(--bg); color: var(--text-3); border: 1px solid var(--border); border-radius: var(--r-full); margin-left: 6px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin: 20px 0 10px; }
.section-note { font-size: 12px; color: var(--text-3); margin-bottom: 12px; line-height: 1.5; }

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

/* ═══════════════════════════════════════════════
   BOTTOM NAV (Option 1: Floating Frosted Glass Capsule)
   ═══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom, 12px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(28px) saturate(210%);
  -webkit-backdrop-filter: blur(28px) saturate(210%);
  border: 1.2px solid rgba(255, 255, 255, 0.75);
  border-radius: 34px;
  padding: 6px 8px;
  z-index: 100;
  box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 0 4px;
  color: #64748B;
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: color var(--t-fast), transform 0.15s, background var(--t-fast);
  font-family: var(--font-sans);
  position: relative;
  border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--green-700);
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
}

.nav-item.active svg {
  stroke: var(--green-700);
  stroke-width: 2.2;
}

.nav-badge-pill {
  position: absolute;
  top: 1px;
  right: calc(50% - 15px);
  background: var(--danger);
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.nav-badge-dot {
  position: absolute;
  top: 3px;
  right: calc(50% - 13px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #FFFFFF;
}

/* Center Action Floating Send Button */
.nav-center-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-center-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 0;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s;
}

.nav-center-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.55);
}

.nav-center-btn:active {
  transform: scale(0.92);
}

.nav-center-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 2.2;
  margin-left: 2px;
}

.nav-center-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--green-700);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════
   VOICE PLAYER & AUDIO PROGRESSION
   ═══════════════════════════════════════════════ */
.chat-voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.05);
  padding: 8px 12px;
  border-radius: 20px;
  margin-top: 6px;
  min-width: 190px;
}

.voice-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-600);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.1s, background 0.15s;
}

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

.voice-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.voice-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green-600);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.voice-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  font-family: var(--mono);
  min-width: 32px;
  text-align: right;
}

/* ═══════════════════════════════════════════════
   VOICE RECORDER & AUDIO
   ═══════════════════════════════════════════════ */
.voice-recording-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  border-radius: 23px;
  padding: 8px 14px;
  min-height: 46px;
}

.pulsing-record-dot {
  width: 12px;
  height: 12px;
  background-color: var(--danger);
  border-radius: 50%;
  animation: recordPulse 1s infinite alternate;
}

@keyframes recordPulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

.chat-voice-player audio {
  filter: hue-rotate(90deg);
}

.debt-remaining-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--border2);
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   ATTACHMENT UPLOADER COMPONENT
   ═══════════════════════════════════════════════ */
.attachment-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
  border: 2px dashed #A7F3D0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  margin-top: 8px;
}

.attachment-upload-zone:hover {
  background: #ECFDF5;
  border-color: #34D399;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.12);
}

.attachment-upload-zone:active {
  transform: translateY(0);
  background: #D1FAE5;
}

.attachment-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10B981, #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(4, 120, 87, 0.2);
  flex-shrink: 0;
}

.attachment-info {
  flex: 1;
  text-align: left;
}

.attachment-title {
  font-size: 13px;
  font-weight: 800;
  color: #064E3B;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-subtitle {
  font-size: 11px;
  color: #6B7280;
  margin-top: 2px;
  font-weight: 500;
}

.attachment-browse-btn {
  font-size: 11px;
  font-weight: 800;
  color: #047857;
  background: #D1FAE5;
  border: 1px solid #A7F3D0;
  padding: 6px 12px;
  border-radius: 9999px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.attachment-upload-zone:hover .attachment-browse-btn {
  background: #059669;
  color: #FFFFFF;
  border-color: #059669;
}

.attachment-preview-box {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 16px;
  padding: 12px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.attachment-preview-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.attachment-preview-img:hover {
  transform: scale(1.02);
}

.attachment-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #047857;
  background: #ECFDF5;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #A7F3D0;
  margin-top: 8px;
}

.attachment-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.attachment-remove-btn:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
}

/* ═══════════════════════════════════════════════
   1. LIVE AMOUNT WORDS HELPER (Anti-error)
   ═══════════════════════════════════════════════ */
.amount-words-helper {
  margin-top: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  animation: fadeIn 0.2s ease-out;
}

.words-badge {
  background: #ECFDF5;
  color: #047857;
  border: 1.5px solid #A7F3D0;
  padding: 5px 11px;
  border-radius: var(--r-full);
  font-weight: 700;
  letter-spacing: 0.15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.08);
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════
   2. NATIVE PULL-TO-REFRESH
   ═══════════════════════════════════════════════ */
.ptr-indicator {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(-70px);
  z-index: 1000;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
  opacity: 0;
}

.ptr-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-600);
}

.ptr-circle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.1s;
}

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

.ptr-indicator.ptr-ready .ptr-circle {
  background: var(--green-600);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
  transform: scale(1.08);
}

.ptr-indicator.ptr-refreshing {
  opacity: 1;
  transform: translateX(-50%) translateY(14px);
}

.ptr-indicator.ptr-refreshing .ptr-circle svg {
  animation: ptrSpin 0.75s linear infinite;
}

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

/* ═══════════════════════════════════════════════
   3. PWA INSTALL BANNER (iOS & Android)
   ═══════════════════════════════════════════════ */
.pwa-install-banner {
  position: fixed;
  bottom: calc(85px + env(safe-area-inset-bottom, 16px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 410px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid var(--border2);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 150;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.pwa-banner-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text);
}

.pwa-banner-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--green-600);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.pwa-banner-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pwa-banner-body {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 12px;
}

.pwa-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--text);
}

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

/* ═══════════════════════════════════════════════
   4. NETWORK STATUS PILL (Online / Offline)
   ═══════════════════════════════════════════════ */
.network-status-pill {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  z-index: 9999;
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  max-width: 90%;
  white-space: nowrap;
}

.network-status-pill.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.network-status-pill.offline {
  background: #FEF2F2;
  color: #DC2626;
  border: 1.5px solid #FCA5A5;
}

.network-status-pill.online {
  background: #ECFDF5;
  color: #047857;
  border: 1.5px solid #A7F3D0;
}

.network-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

/* ═══════════════════════════════════════════════
   5. TOGGLE SWITCH & AVOIRS / FACTURE UI
   ═══════════════════════════════════════════════ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border2, #CBD5E1);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 9999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary, #059669);
}

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

.badge-invoice {
  background: #FEF3C7;
  color: #92400E;
  font-weight: 800;
  font-size: 11px;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-avoir {
  background: #DCFCE7;
  color: #166534;
  font-weight: 800;
  font-size: 11px;
  border: 1px solid #86EFAC;
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


