/* ══════════════════════════════════════════════════════
   ALLOFACT — MAIN CSS
   Tokens shared with landing.html / pricing.html : nuit indigo,
   or cauris, terracotta, papier — voir app/landing.html pour la
   référence de la palette et la trame "woven-band".
══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #1B2A4A; /* indigo nuit */
  --blue:   #2F4C81; /* bleu moyen */
  --indigo: #2F4C81; /* bleu moyen */
  --violet: #4A6BA8; /* bleu clair — variété catégorielle (stats) uniquement */
  --or-cauris:  #E8A23D;
  --terracotta: #C4602F;
  --blanc-papier: #FBF7EF;
  --encre: #1A1A1A;
  --green:  #10b981;
  --amber:  #E8A23D;
  --red:    #C4602F;
  --bg:     #F3EFE6;
  --surface:#ffffff;
  --border: #E8E0D0;
  --text:   #1A1A1A;
  --muted:  #6b6457;
  --faint:  #F7F2E8;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(27,42,74,0.09);
  --shadow-md: 0 6px 24px rgba(27,42,74,0.15);
  --grad-primary: linear-gradient(135deg, var(--navy) 0%, var(--indigo) 100%);
  --grad-blue:    linear-gradient(135deg, var(--indigo) 0%, var(--navy) 100%);
  --grad-cauris:  linear-gradient(135deg, #F0B857 0%, var(--or-cauris) 100%);
  --display: 'Fraunces', serif;
  --body:    'Work Sans', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', 'Courier New', monospace;
}

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN ─────────────────────────────────────────── */
#loginScreen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0D1727;
  padding: 24px 20px 40px;
  position: relative;
}

/* Lueurs décoratives en arrière-plan (or cauris / terracotta) */
#loginScreen::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,150,26,0.18) 0%, transparent 70%);
  top: 0; right: 0;
  pointer-events: none; z-index: 0;
}
#loginScreen::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,96,47,0.16) 0%, transparent 70%);
  bottom: 0; left: 0;
  pointer-events: none; z-index: 0;
}

/* Badge logo : wrapper avec overflow pour recadrer le PNG sur l'artwork */
.logo-badge {
  width: 96px; height: 96px;
  border-radius: 22px;
  background: white;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  margin-bottom: 14px;
  position: relative; z-index: 1;
  flex-shrink: 0;
}
.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* Version petite pour le header */
.logo-badge--sm {
  width: 40px; height: 40px;
  border-radius: 10px;
  margin-bottom: 0;
  box-shadow: none;
}
#loginScreen h1 {
  font-family: var(--display); color: var(--blanc-papier);
  font-size: 2.3rem; font-weight: 650;
  letter-spacing: -0.5px; margin-bottom: 4px;
  position: relative; z-index: 1;
}
#loginScreen h1 span { color: var(--or-cauris); font-style: italic; font-weight: 500; }
#loginScreen p.sub {
  color: rgba(251,247,239,0.6); font-size: 0.85rem;
  margin-bottom: 14px; position: relative; z-index: 1;
}
#loginScreen .about-link {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: .5px;
  text-transform: uppercase; text-decoration: none;
  color: var(--or-cauris); border-bottom: 1px solid rgba(232,162,61,0.4);
  margin-bottom: 28px; position: relative; z-index: 1; transition: border-color .15s;
}
#loginScreen .about-link:hover { border-color: var(--or-cauris); }

.login-footer {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.4px;
  color: rgba(251,247,239,0.35); text-align: center; line-height: 1.9;
  margin-top: 28px; position: relative; z-index: 1;
}
.login-footer span {
  cursor: pointer; color: var(--or-cauris); opacity: 0.75;
  transition: opacity 0.15s;
}
.login-footer span:hover { opacity: 1; }

.login-box {
  background: white;
  border-radius: 20px;
  padding: 30px 26px;
  width: 100%; max-width: 390px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  position: relative; z-index: 1;
}
.login-box h2 {
  font-family: var(--display); font-size: 1.2rem; color: var(--navy);
  margin-bottom: 22px; font-weight: 650;
}
.login-box label {
  font-size: 0.75rem; color: var(--muted);
  display: block; margin-bottom: 5px; margin-top: 14px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
}
.login-box input {
  width: 100%; border: 1.5px solid #e4ddd0;
  border-radius: 10px; padding: 11px 14px;
  font-size: 0.92rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fbf9f4;
}
.login-box input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(47,76,129,0.12);
  background: white;
}
.login-box .btn-login {
  width: 100%; margin-top: 22px; padding: 13px;
  background: var(--grad-primary);
  color: white; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(47,76,129,0.35);
}
.login-box .btn-login:hover { opacity: 0.9; }
.login-box .btn-login:active { transform: scale(0.98); }
.login-box .toggle-link {
  text-align: center; margin-top: 16px; font-size: 0.83rem; color: #9b9486;
}
.login-box .toggle-link a {
  color: var(--indigo); cursor: pointer; font-weight: 600;
  text-decoration: none;
}
.login-box .toggle-link a:hover { text-decoration: underline; }
#loginError { color: var(--red); font-size: 0.82rem; margin-top: 8px; display: none; }

/* ── HEADER ────────────────────────────────────────── */
#appScreen { display: none; }
header {
  background: var(--navy);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  position: sticky; top: 0; z-index: 100;
}
header img { display: block; } /* géré par .logo-badge--sm */
header h1 {
  font-family: var(--display); font-size: 1.4rem; font-weight: 650;
  color: white; flex: 1; letter-spacing: -0.3px;
}
header h1 span.blue { color: var(--or-cauris); font-style: italic; font-weight: 500; }

/* ── ACCOUNT MENU ──────────────────────────────────── */
.account-menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; background: none; border: none;
  font-size: 0.86rem; color: var(--text); cursor: pointer;
  text-align: left; transition: background 0.15s;
}
.account-menu-item:hover { background: var(--faint); }

/* ── MODAL ABONNEMENT ──────────────────────────────── */
#subscribeModal {
  position: fixed; inset: 0; z-index: 9200;
  background: rgba(0,0,0,0.6);
  display: none; align-items: center;
  justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
#subscribeModal.open { display: flex; }
.subscribe-box {
  background: white; border-radius: 22px;
  padding: 36px 28px; max-width: 380px; width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.subscribe-box .lock-icon { font-size: 3.2rem; margin-bottom: 14px; }
.subscribe-box h2 {
  font-family: var(--display); font-size: 1.35rem; font-weight: 650;
  color: var(--navy); margin-bottom: 10px;
}
.subscribe-box p {
  font-size: 0.86rem; color: var(--muted);
  line-height: 1.75; margin-bottom: 22px;
}
.subscribe-box .btn-subscribe {
  width: 100%; padding: 14px;
  background: var(--grad-primary);
  color: white; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 16px rgba(47,76,129,0.35);
  transition: opacity 0.2s;
}
.subscribe-box .btn-subscribe:hover { opacity: 0.9; }
.subscribe-box .btn-close-sub {
  width: 100%; margin-top: 10px; padding: 11px;
  background: none; border: 1.5px solid var(--border);
  border-radius: 12px; font-size: 0.88rem;
  color: var(--muted); cursor: pointer;
  transition: background 0.15s;
}
.subscribe-box .btn-close-sub:hover { background: var(--faint); }

/* ── TABS ──────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--navy);
  max-width: 600px; margin: 0 auto;
  padding: 0 16px;
  gap: 4px;
}
.tab-btn {
  flex: 1; padding: 12px 8px; border: none; background: none;
  font-size: 0.82rem; font-weight: 600;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-btn.active {
  color: var(--or-cauris);
  border-bottom-color: var(--or-cauris);
}
.tab-btn:hover:not(.active) { color: rgba(255,255,255,0.7); }

/* Centré comme .tabs/.container — sans ça il reste collé à gauche dès que
   les règles @media lui donnent un max-width (écrans larges). */
#caBanner { margin: 0 auto; }

/* ── CONTAINER ─────────────────────────────────────── */
.container { max-width: 600px; margin: 0 auto; padding: 20px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card h2 {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  color: #9b9486; letter-spacing: 1.6px;
  margin-bottom: 14px; font-weight: 600;
}

.field-row { display: flex; gap: 10px; margin-bottom: 10px; }
.field-group { flex: 1; }
.field-group label {
  font-size: 0.75rem; color: var(--muted);
  display: block; margin-bottom: 5px; font-weight: 600;
}
.field-group input {
  width: 100%; border: 1.5px solid #e4ddd0;
  border-radius: 9px; padding: 10px 12px;
  font-size: 0.9rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fbf9f4;
}
.field-group input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(47,76,129,0.1);
  background: white;
}

/* ── VOICE ─────────────────────────────────────────── */
.voice-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}
.voice-section p.hint {
  font-size: 0.83rem; color: var(--muted);
  margin-bottom: 22px; line-height: 1.7;
}
.voice-section p.hint strong { color: var(--indigo); }

/* Le micro est le geste fondateur de AlloFact — traité comme le CTA
   héros des pages marketing : or cauris, pas l'indigo générique. */
#micBtn {
  width: 82px; height: 82px; border-radius: 50%; border: none;
  background: var(--grad-cauris);
  color: var(--navy); font-size: 2rem; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 24px rgba(212,150,26,0.5);
}
#micBtn:hover { transform: scale(1.06); box-shadow: 0 8px 28px rgba(212,150,26,0.6); }
#micBtn.listening {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  animation: pulse 1.1s infinite;
  box-shadow: 0 6px 24px rgba(239,68,68,0.5);
}
#micBtn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.09); } }

#transcript {
  margin-top: 16px; padding: 12px 16px;
  background: #f5efe0;
  border-radius: 10px; font-size: 0.85rem; color: var(--navy);
  min-height: 46px; border: 1px solid #e0cfa3;
  font-family: var(--mono); font-style: normal; line-height: 1.6;
}

/* Décompte visuel avant validation auto. de la dictée (2,5s de silence) —
   évite que le vendeur croie que l'app a figé pendant ce délai. */
#silenceBarWrap {
  height: 3px; margin-top: 6px; border-radius: 3px;
  background: transparent; overflow: hidden;
}
#silenceBar {
  height: 100%; width: 0%; border-radius: 3px;
  background: var(--or-cauris); opacity: 0;
}
#silenceBar.counting {
  opacity: 1;
  animation: silenceCountdown 2.5s linear forwards;
}
@keyframes silenceCountdown { from { width: 100%; } to { width: 0%; } }
@media (prefers-reduced-motion: reduce) {
  #silenceBar.counting { animation: none; opacity: 0; }
}

/* Flash bref sur un champ rempli automatiquement par la dictée vocale */
.vb-autofill-flash {
  background-color: #FBF0DC !important;
  transition: background-color 1.2s ease;
}

/* ── ITEMS ─────────────────────────────────────────── */
.items-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.items-section h2 {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  color: #9b9486; letter-spacing: 1.6px;
  margin-bottom: 14px; font-weight: 600;
}

#itemsList { margin-bottom: 12px; }
.item-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 4px; border-bottom: 1px solid #F3EFE6;
  font-size: 0.87rem;
}
.item-row:last-child { border-bottom: none; }
.item-name  { flex: 2; font-weight: 500; }
.item-qty   { flex: 0.7; text-align: center; color: var(--muted); }
.item-price { flex: 1; text-align: right; color: var(--muted); }
.item-total { flex: 1.2; text-align: right; font-weight: 700; color: var(--navy); font-family: var(--mono); }
.item-del {
  background: none; border: none; color: #c9c2b3;
  cursor: pointer; font-size: 0.95rem; padding: 0 4px;
  transition: color 0.15s;
}
.item-del:hover { color: var(--red); }
.item-header {
  font-size: 0.7rem; color: #c9c2b3;
  font-weight: 700; text-transform: uppercase;
}

.item-edit-btn {
  background: none; border: none; cursor: pointer;
  color: #c9c2b3; font-size: 0.9rem; padding: 0 3px;
  transition: color 0.15s;
}
.item-edit-btn:hover { color: var(--indigo); }

.item-row.editing {
  background: #f0e9d8; border-radius: 9px;
  padding: 6px 4px; flex-wrap: wrap; gap: 6px;
}
.item-row.editing .edit-inputs {
  display: flex; gap: 6px; flex: 1;
  align-items: center; flex-wrap: wrap;
}
.edit-inp {
  border: 1.5px solid var(--indigo); border-radius: 7px;
  padding: 5px 8px; font-size: 0.85rem; outline: none;
  background: white; color: var(--navy);
}
.edit-inp-product { flex: 2; min-width: 100px; }
.edit-inp-qty     { flex: 0.6; min-width: 45px; }
.edit-inp-price   { flex: 1; min-width: 70px; }
.edit-confirm-btn {
  background: var(--green); color: white; border: none;
  border-radius: 7px; padding: 5px 10px;
  font-size: 0.85rem; cursor: pointer; font-weight: 700;
}
.edit-cancel-btn {
  background: #F3EFE6; color: var(--muted);
  border: 1px solid #e4ddd0; border-radius: 7px;
  padding: 5px 10px; font-size: 0.85rem; cursor: pointer;
}

.manual-add { display: flex; gap: 8px; flex-wrap: wrap; }
.manual-add input {
  border: 1.5px solid #e4ddd0; border-radius: 9px;
  padding: 9px 10px; font-size: 0.85rem; outline: none;
  transition: border-color 0.2s; background: #fbf9f4;
}
.manual-add input:focus { border-color: var(--indigo); background: white; }
.manual-add input.inp-product { flex: 2; min-width: 120px; }
.manual-add input.inp-qty     { flex: 0.8; min-width: 55px; }
.manual-add input.inp-price   { flex: 1; min-width: 80px; }
#addItemBtn {
  background: var(--indigo); color: white; border: none;
  border-radius: 9px; padding: 9px 14px;
  cursor: pointer; font-size: 0.85rem; font-weight: 700;
  transition: opacity 0.2s;
}
#addItemBtn:hover { opacity: 0.88; }

/* ── ACTIONS ───────────────────────────────────────── */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.btn {
  flex: 1; padding: 13px 10px; border: none; border-radius: 11px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s, transform 0.1s; min-width: 110px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--navy); color: white;
  box-shadow: 0 3px 10px rgba(27,42,74,0.25);
}
.btn-primary:hover { opacity: 0.87; }
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669); color: white;
  box-shadow: 0 3px 10px rgba(16,185,129,0.3);
}
.btn-success:hover { opacity: 0.88; }
.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128C7E); color: white;
  box-shadow: 0 3px 10px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover { opacity: 0.88; }
.btn-danger {
  background: #FBEDE6; color: var(--red);
  border: 1.5px solid #E8C4AE;
}
.btn-danger:hover { background: #F6DECE; }

/* Modal WhatsApp */
.wa-modal-box { max-width: 420px; }
.wa-phone-inp {
  width: 100%; border: 1.5px solid #25d366; border-radius: 9px;
  padding: 11px 13px; font-size: 1rem; outline: none;
  margin: 12px 0; color: var(--navy);
}
.wa-preview {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 11px;
  padding: 14px; font-size: 0.8rem; color: #166534;
  white-space: pre-wrap; font-family: var(--mono);
  line-height: 1.6; max-height: 220px; overflow-y: auto; margin-bottom: 14px;
}
.wa-send-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #25d366, #128C7E);
  color: white; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(37,211,102,0.35);
  transition: opacity 0.2s;
}
.wa-send-btn:hover { opacity: 0.9; }
.wa-note {
  font-size: 0.75rem; color: #9b9486;
  text-align: center; margin-top: 10px; line-height: 1.5;
}

/* ── PREVIEW ───────────────────────────────────────── */
#previewSection { display: none; margin-bottom: 24px; }
.invoice-preview {
  background: white; border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-md); font-family: var(--mono);
  border: 1px solid var(--border); overflow: hidden;
}
.inv-header {
  text-align: center; margin-bottom: 20px;
  border-bottom: 2px solid var(--inv-accent, var(--navy)); padding-bottom: 16px;
}
.inv-header .shop-name {
  font-size: 1.2rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--inv-shop-col, var(--navy));
}
.inv-header .shop-info {
  font-size: 0.75rem; color: #6b6457;
  margin-top: 4px; line-height: 1.6;
}
.inv-title {
  font-size: 0.95rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 3px; margin-top: 8px;
  color: var(--inv-title-col, var(--navy));
}
.inv-meta {
  display: flex; justify-content: space-between;
  margin-bottom: 16px; font-size: 0.78rem; color: #6b6457;
}
.inv-meta div { line-height: 1.9; }
.inv-meta strong { color: var(--navy); }
.inv-table {
  width: 100%; border-collapse: collapse;
  margin-bottom: 16px; font-size: 0.78rem; table-layout: fixed;
}
.inv-table col.col-name  { width: 34%; }
.inv-table col.col-qty   { width: 8%; }
.inv-table col.col-price { width: 29%; }
.inv-table col.col-total { width: 29%; }
.inv-table th {
  background: var(--inv-accent, var(--navy)); color: white;
  padding: 7px 6px; text-align: left;
  font-size: 0.7rem; white-space: nowrap; overflow: hidden;
}
.inv-table th:last-child, .inv-table td:last-child { text-align: right; }
.inv-table th:nth-child(2), .inv-table td:nth-child(2) { text-align: center; }
.inv-table th:nth-child(3), .inv-table td:nth-child(3) { text-align: right; }
.inv-table td {
  padding: 7px 6px; border-bottom: 1px solid #F3EFE6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inv-table td:first-child { white-space: normal; word-break: break-word; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-totals { border-top: 2px solid var(--inv-accent, var(--navy)); padding-top: 10px; }
.inv-total-row {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; padding: 3px 0;
}
.inv-total-row.grand {
  font-weight: 700; font-size: 1rem;
  border-top: 1px solid var(--inv-accent, var(--navy)); margin-top: 6px; padding-top: 6px;
}
.inv-footer {
  margin-top: 20px; text-align: center; font-size: 0.72rem;
  color: #9b9486; border-top: 1px dashed #e4ddd0;
  padding-top: 12px; line-height: 1.7;
}

/* ── STYLES DE REÇU ─────────────────────────────────── */
/* La couleur personnalisée est disponible via --inv-accent sur .inv-wrapper */

/* Coloré : header plein fond accent */
.inv-style-modern .inv-header {
  background: var(--inv-accent, var(--navy));
  margin: -28px -28px 20px;
  padding: 28px;
  border-bottom: none;
}
.inv-style-modern .inv-header .shop-name { color: var(--inv-shop-col, #FBF7EF); }
.inv-style-modern .inv-header .shop-info { color: rgba(251,247,239,0.55); }
.inv-style-modern .inv-header .inv-title  { color: var(--inv-title-col, rgba(251,247,239,0.8)); }
.inv-style-modern .inv-header .inv-logo img { background: rgba(255,255,255,0.12); border-radius: 4px; padding: 3px; }

/* Épuré : typographie allégée, pas de fond sur le header tableau */
.inv-style-minimal .inv-header {
  border-bottom-width: 1px;
}
.inv-style-minimal .inv-header .shop-name {
  font-size: 1rem; letter-spacing: 0; text-transform: none; font-weight: 600;
}
.inv-style-minimal .inv-header .inv-title {
  font-size: 0.75rem; letter-spacing: 1px; font-weight: 500;
  color: #9b9486; text-transform: none;
}
.inv-style-minimal .inv-table th {
  background: transparent; color: var(--navy);
  border-bottom: 1.5px solid var(--navy);
}
.inv-style-minimal .inv-totals { border-top-width: 1px; }

/* Tampon : tout en tirets */
.inv-style-stamp .inv-header {
  border-bottom: 1.5px dashed var(--navy);
}
.inv-style-stamp .inv-table th {
  background: transparent; color: var(--navy);
  border-bottom: 2px solid var(--navy);
}
.inv-style-stamp .inv-totals { border-top: 1.5px dashed var(--navy); }
.inv-style-stamp .inv-footer { border-top: 1.5px dashed #e4ddd0; }
.invoice-preview:has(.inv-style-stamp) {
  border: 1.5px dashed var(--navy);
}

/* ── HISTORIQUE ────────────────────────────────────── */
#historySearch:focus { border-color: var(--indigo); }
#historySearch::placeholder { color: #c9c2b3; }
.history-highlight { background: #fef9c3; border-radius: 2px; }
.history-empty {
  text-align: center; padding: 60px 20px; color: #c9c2b3;
}
.history-empty .icon { font-size: 3rem; margin-bottom: 14px; }
.history-empty p { font-size: 0.9rem; line-height: 1.6; }

.history-load-more {
  display: block; width: 100%; margin-top: 6px; padding: 13px;
  background: var(--faint); border: 1.5px dashed var(--border);
  border-radius: 11px; font-size: 0.85rem; font-weight: 700;
  color: var(--indigo); cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.history-load-more:hover { background: #F3EFE6; border-color: var(--indigo); }
@media (min-width: 880px) { .history-load-more { grid-column: 1 / -1; } }

.history-item {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--indigo);
  cursor: pointer; transition: box-shadow 0.2s, transform 0.15s;
}
.history-item.status-paid    { border-left-color: var(--green); }
.history-item.status-pending { border-left-color: var(--amber); }
.history-item.status-credit  { border-left-color: var(--red); }
.history-item:hover {
  box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.history-item-top {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.history-item-num {
  font-size: 0.72rem; color: var(--indigo);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.history-item-total { font-family: var(--mono); font-size: 1rem; font-weight: 700; color: var(--navy); }
.history-item-client {
  font-size: 0.9rem; font-weight: 600; color: var(--navy); margin-top: 4px;
}
.history-item-date { font-size: 0.77rem; color: #9b9486; margin-top: 2px; }
.history-item-articles {
  font-size: 0.77rem; color: #6b6457; margin-top: 8px;
  border-top: 1px solid #F3EFE6; padding-top: 7px;
}

/* Badges statut paiement */
.status-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; letter-spacing: 0.4px;
}
.status-badge.paid    { background: #d1fae5; color: #065f46; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.credit  { background: #fee2e2; color: #991b1b; }

/* Sélecteur statut formulaire */
.payment-status-selector { display: flex; gap: 8px; margin-top: 6px; }
.status-btn {
  flex: 1; padding: 9px 4px; border-radius: 9px;
  border: 2px solid #e4ddd0; font-size: 0.8rem;
  font-weight: 700; cursor: pointer; background: white;
  transition: all 0.15s;
}
.status-btn.active-paid    { border-color: var(--green); background: #d1fae5; color: #065f46; }
.status-btn.active-pending { border-color: var(--amber); background: #fef3c7; color: #92400e; }
.status-btn.active-credit  { border-color: var(--red);   background: #fee2e2; color: #991b1b; }

/* Boutons changement statut modal */
.status-change-btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.status-change-btn {
  padding: 5px 14px; border-radius: 20px;
  border: 2px solid transparent; font-size: 0.78rem;
  font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.status-change-btn.paid    { background: #d1fae5; color: #065f46; border-color: #10b981; opacity: 0.45; }
.status-change-btn.pending { background: #fef3c7; color: #92400e; border-color: #f59e0b; opacity: 0.45; }
.status-change-btn.credit  { background: #fee2e2; color: #991b1b; border-color: #ef4444; opacity: 0.45; }
.status-change-btn.active  { opacity: 1; cursor: default; box-shadow: 0 0 0 2px currentColor; }

/* Modal historique */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }

/* Doit toujours s'afficher au-dessus d'une autre modale déjà ouverte
   (ex: confirmation de suppression depuis la modale détail d'un reçu). */
#vbConfirmOverlay { z-index: 9300; }

/* ── RGPD ─────────────────────────────────────────── */
#rgpdOverlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.75); display: none;
  align-items: flex-end; justify-content: center;
}
#rgpdOverlay.open { display: flex; }
.rgpd-box {
  background: white; border-radius: 22px 22px 0 0;
  padding: 28px 24px 36px; width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
}
.rgpd-box h2 {
  font-family: var(--display); font-size: 1.25rem; font-weight: 650; color: var(--navy); margin-bottom: 10px;
}
.rgpd-box p  { font-size: 0.85rem; color: #5c5648; line-height: 1.75; margin-bottom: 10px; }
.rgpd-box ul { font-size: 0.85rem; color: #5c5648; line-height: 1.85; padding-left: 18px; margin-bottom: 12px; }
.rgpd-accept {
  width: 100%; padding: 14px;
  background: var(--grad-primary); color: white;
  border: none; border-radius: 11px;
  font-size: 1rem; font-weight: 700;
  cursor: pointer; margin-top: 8px;
  box-shadow: 0 4px 14px rgba(47,76,129,0.3);
}
.rgpd-accept:hover { opacity: 0.9; }
.rgpd-decline {
  width: 100%; padding: 12px; margin-top: 8px;
  background: none; border: 1.5px solid var(--border);
  border-radius: 11px; font-size: 0.85rem; color: var(--muted);
  cursor: pointer; transition: background 0.15s;
}
.rgpd-decline:hover { background: var(--faint); }
.rgpd-policy-link {
  font-size: 0.78rem; color: var(--indigo);
  cursor: pointer; text-decoration: underline;
}

/* Modal politique */
#policyModal {
  position: fixed; inset: 0; z-index: 9100;
  background: rgba(0,0,0,0.6); display: none;
  align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
#policyModal.open { display: flex; }
.policy-box {
  background: white; border-radius: 18px; padding: 26px;
  max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
}
.policy-box h2 { font-family: var(--display); font-size: 1.15rem; font-weight: 650; margin-bottom: 16px; color: var(--navy); }
.policy-box h3 { font-size: 0.85rem; font-weight: 700; margin: 14px 0 6px; color: var(--navy); }
.policy-box p, .policy-box li { font-size: 0.82rem; color: #5c5648; line-height: 1.75; }
.policy-box ul { padding-left: 16px; margin-bottom: 8px; }

.modal-box {
  background: white; border-radius: 18px; padding: 26px;
  max-width: 520px; width: 90%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.modal-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 18px;
}
.modal-header h3 { font-family: var(--display); font-size: 1.1rem; font-weight: 650; color: var(--navy); }
.modal-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: #9b9486; line-height: 1;
  padding: 4px; transition: color 0.15s;
}
.modal-close:hover { color: var(--navy); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; padding: 11px; font-size: 0.85rem; }

/* ── STATUS MESSAGE ────────────────────────────────── */
.status-msg {
  text-align: center; padding: 10px 14px; border-radius: 9px;
  font-size: 0.85rem; margin-bottom: 12px; display: none;
  font-weight: 600;
}
.status-msg.success { background: #d1fae5; color: #065f46; }
.status-msg.error   { background: #fee2e2; color: #991b1b; }

/* Champ mot de passe avec œil */
.pwd-wrap {
  display: flex; align-items: stretch;
  border: 1.5px solid #e4ddd0; border-radius: 10px;
  overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s;
  background: #fbf9f4;
}
.pwd-wrap:focus-within {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(47,76,129,0.1);
  background: white;
}
.pwd-wrap input {
  flex: 1; border: none !important; outline: none !important;
  padding: 11px 14px; font-size: 0.92rem; background: transparent;
  width: auto;
}
.pwd-eye {
  flex-shrink: 0; background: none; border: none;
  border-left: 1px solid #F3EFE6; padding: 0 13px;
  cursor: pointer; font-size: 1rem; color: #9b9486;
  transition: background 0.15s, color 0.15s;
}
.pwd-eye:hover { background: #f7f2e8; color: var(--navy); }

/* ═══════════════════════════════════════════════════════
   STATS – Dashboard Premium
═══════════════════════════════════════════════════════ */
#statsLockOverlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(247,242,232,0.92);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: var(--radius); text-align: center;
  padding: 36px 24px; min-height: 400px;
}
#statsLockOverlay .lock-big { font-size: 3.5rem; margin-bottom: 18px; }
#statsLockOverlay h2 { font-family: var(--display); font-size: 1.3rem; font-weight: 650; color: var(--navy); margin-bottom: 8px; }
#statsLockOverlay p  {
  font-size: 0.85rem; color: #6b6457; line-height: 1.75;
  margin-bottom: 24px; max-width: 300px;
}
.btn-unlock {
  padding: 13px 28px;
  background: var(--grad-primary);
  color: white; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 20px rgba(47,76,129,0.35);
  transition: opacity 0.2s;
}
.btn-unlock:hover { opacity: 0.9; }

/* Hero — le CA total mis en scène comme le total d'un reçu papier :
   c'est littéralement ce que l'app produit, donc le signal le plus fort
   de l'onglet doit ressembler à ça plutôt qu'à un widget de dashboard. */
.stats-hero {
  background: var(--grad-primary); border-radius: var(--radius);
  padding: 30px 24px 22px; text-align: center;
  box-shadow: var(--shadow-md); margin-bottom: 14px;
}
.stats-hero-eyebrow {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 1.8px; color: rgba(255,255,255,0.6); font-weight: 600;
}
.stats-hero-val {
  font-family: var(--display); font-weight: 650; font-size: 2.5rem;
  color: #fff; letter-spacing: -0.5px; line-height: 1.15; margin-top: 8px;
}
.stats-hero-divider {
  height: 1px; max-width: 220px; margin: 18px auto 14px;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.35) 0 6px, transparent 6px 12px);
}
.stats-hero-credit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 700; color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.08); border-radius: 999px; padding: 7px 16px;
  transition: background 0.2s, color 0.2s;
}
.stats-hero-credit.has-credit { color: #fecaca; background: rgba(239,68,68,0.22); }

/* Bandeau secondaire — 3 chiffres clés, à plat */
.stats-cell-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 14px;
}
.stats-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 4px; text-align: center; box-shadow: var(--shadow);
}
.stats-cell-val { font-family: var(--mono); font-weight: 700; font-size: 0.92rem; color: var(--navy); line-height: 1.2; white-space: nowrap; }
.stats-cell-lbl { font-size: 0.66rem; color: #9b9486; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.stats-cell-sub { font-size: 0.68rem; color: #9b9486; margin-top: 2px; }

/* Répartition statuts */
.stats-section {
  background: var(--surface); border-radius: 13px;
  padding: 20px; margin-bottom: 12px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.stats-section-title {
  font-size: 0.72rem; text-transform: uppercase;
  color: #9b9486; letter-spacing: 1.2px; font-weight: 700; margin-bottom: 18px;
  display: flex; align-items: center; gap: 7px;
}
.stats-status-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.stats-status-label { width: 104px; font-size: 0.85rem; font-weight: 700; flex-shrink: 0; }
.stats-status-label.paid    { color: #065f46; }
.stats-status-label.pending { color: #92400e; }
.stats-status-label.credit  { color: #991b1b; }
.stats-status-bar-wrap {
  flex: 1; height: 12px; background: #F3EFE6; border-radius: 8px; overflow: hidden;
}
.stats-status-bar { height: 100%; border-radius: 8px; transition: width 0.6s ease; min-width: 3px; }
.stats-status-bar.paid    { background: linear-gradient(90deg, #10b981, #059669); }
.stats-status-bar.pending { background: linear-gradient(90deg, #f59e0b, #d97706); }
.stats-status-bar.credit  { background: linear-gradient(90deg, #ef4444, #dc2626); }
.stats-status-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.74rem; min-width: 92px; }
.stats-status-pct   { font-weight: 700; color: var(--navy); font-size: 0.86rem; }
.stats-status-count { color: #9b9486; }
.stats-status-total { color: #6b6457; font-size: 0.71rem; font-family: var(--mono); }

/* Top produits */
.stats-product-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stats-product-rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: #f0e9d8; color: var(--indigo);
  font-size: 0.74rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stats-product-info { flex: 1; min-width: 0; }
.stats-product-name {
  font-size: 0.85rem; font-weight: 600; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.stats-product-bar-wrap { height: 6px; background: #F3EFE6; border-radius: 4px; overflow: hidden; }
.stats-product-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--violet));
  border-radius: 4px; transition: width 0.6s ease;
}
.stats-product-meta { text-align: right; flex-shrink: 0; }
.stats-product-ca  { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.stats-product-qty { font-size: 0.71rem; color: #9b9486; margin-top: 2px; }

/* Graphe mensuel */
.stats-chart-wrap {
  display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 8px;
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
  width: 70%;
  background: linear-gradient(180deg, var(--indigo), rgba(47,76,129,0.3));
  border-radius: 5px 5px 0 0; min-height: 3px;
  transition: height 0.5s ease; cursor: pointer;
}
.chart-bar:hover { opacity: 0.75; }
.chart-bar.current {
  background: linear-gradient(180deg, var(--or-cauris), #f3cf8a);
}
.chart-label {
  font-size: 0.61rem; color: #9b9486; margin-top: 4px;
  text-align: center; white-space: nowrap;
}
.chart-col.current .chart-label { color: var(--navy); font-weight: 700; }
.stats-chart-tooltip {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 0.78rem; color: var(--muted); text-align: center;
  font-family: var(--mono);
}

/* Top clients */
.stats-client-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #F3EFE6;
}
.stats-client-row:last-child { border-bottom: none; }
.stats-client-rank  { font-size: 0.74rem; font-weight: 800; color: #9b9486; width: 16px; }
.stats-client-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad-primary);
  color: white; font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stats-client-info  { flex: 1; }
.stats-client-name  { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.stats-client-sub   { font-size: 0.71rem; color: #9b9486; }
.stats-client-ca    { font-family: var(--mono); font-size: 0.85rem; font-weight: 700; color: #059669; }

/* Top produits / clients — empilés en mobile, côte à côte dès que la place le permet */
.stats-twocol { display: grid; gap: 12px; }
@media (min-width: 880px) {
  .stats-twocol { grid-template-columns: 1fr 1fr; }
  .stats-twocol .stats-section { margin-bottom: 0; }
}

/* Période selector */
.stats-period-selector { display: flex; gap: 6px; margin-bottom: 16px; }
.period-btn {
  padding: 5px 14px; border-radius: 20px;
  border: 1.5px solid #e4ddd0; font-size: 0.78rem;
  font-weight: 600; cursor: pointer; background: white;
  color: #6b6457; transition: all 0.15s;
}
.period-btn.active {
  background: var(--grad-primary);
  border-color: transparent; color: white;
  box-shadow: 0 2px 8px rgba(47,76,129,0.3);
}

/* ══════════════════════════════════════════════════════
   FENÊTRE LARGE (bureau) — la page s'élargit et réutilise
   l'espace gagné en colonnes, plutôt que d'étirer la mise
   en page mobile dans un cadre plus grand.
══════════════════════════════════════════════════════ */
@media (min-width: 880px) {
  header { padding: 12px 32px; }
  .tabs, #caBanner, .container { max-width: 880px; }
  .container { padding: 32px; }

  .card, .voice-section, .items-section { padding: 26px 28px; }

  /* Historique : grille à deux colonnes plutôt qu'une longue liste */
  #historyList {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px; align-items: start;
  }
  .history-empty { grid-column: 1 / -1; }

  /* Statistiques : le total reçoit un peu plus d'air sur grand écran */
  .stats-hero-val { font-size: 3rem; }
}

@media (min-width: 1180px) {
  .tabs, #caBanner, .container { max-width: 1040px; }
}

/* ── Champs optionnels (toggle desktop + mobile) ──────────────────────────── */
.optional-fields-group {
  margin-top: 4px;
  border: none;
}
.optional-fields-group[open] .optional-chevron { display: inline-block; transform: rotate(90deg); transition: transform .2s; }
.optional-chevron { display: inline-block; transition: transform .2s; margin-left: 4px; font-size: 0.75rem; color: #9b9486; }
.optional-fields-toggle {
  list-style: none;
  cursor: pointer;
  font-size: 0.74rem; font-weight: 600;
  color: #9b9486; letter-spacing: 0.3px;
  padding: 6px 0 8px;
  user-select: none;
  display: flex; align-items: center; gap: 2px;
}
.optional-fields-toggle::-webkit-details-marker { display: none; }
.optional-fields-toggle:hover { color: var(--indigo); }
.optional-fields-body { padding-top: 4px; }

/* ══════════════════════════════════════════════════════
   MOBILE — écrans ≤ 520 px (téléphones)
   Priorité : micro en premier, tap targets confortables,
   champs empilés, formulaire allégé.
══════════════════════════════════════════════════════ */
@media (max-width: 520px) {

  /* ── Réorganisation : micro EN PREMIER ── */
  /* Sur mobile l'action principale est la dictée, pas le formulaire.
     On réordonne via flex-order sans toucher au HTML. */
  #tab-nouvelle {
    display: flex;
    flex-direction: column;
  }
  #tab-nouvelle > .voice-section { order: 1; }
  #tab-nouvelle > .card          { order: 2; }
  #tab-nouvelle > .items-section { order: 3; }
  #tab-nouvelle > #statusMsg     { order: 4; }
  #tab-nouvelle > .actions       { order: 5; }
  #tab-nouvelle > #previewSection{ order: 6; }

  /* ── Voice section : hero sombre, centré, immersif ── */
  .voice-section {
    background: linear-gradient(160deg, #1B2A4A 0%, #2F4C81 100%);
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(27,42,74,0.3);
    padding: 28px 18px 22px;
    margin-bottom: 12px;
  }
  .voice-section p.hint {
    color: rgba(251,247,239,0.6);
  }
  .voice-section p.hint strong { color: var(--or-cauris); }
  #micBtn {
    width: 96px; height: 96px; font-size: 2.4rem;
    box-shadow: 0 6px 28px rgba(232,162,61,0.55);
  }
  #transcript {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: #FBF7EF;
    font-size: 0.83rem; padding: 10px 12px; min-height: 50px;
  }
  #silenceBarWrap { background: rgba(255,255,255,0.08); }

  /* ── Champs optionnels : fermés par défaut sur mobile ── */
  /* Géré par JS (voir DOMContentLoaded dans allofact_main.html) */

  /* ── Header ── */
  header { padding: 8px 12px; gap: 8px; }
  header h1 { font-size: 1.15rem; }
  .logo-badge--sm { width: 32px; height: 32px; border-radius: 8px; }

  /* ── Onglets ── */
  .tabs { padding: 0 8px; gap: 2px; }
  .tab-btn { font-size: 0.78rem; padding: 11px 4px; gap: 4px; }

  /* ── Container ── */
  .container { padding: 12px; }

  /* ── Cards ── */
  .card { padding: 16px 14px; margin-bottom: 12px; }
  .items-section { padding: 14px; margin-bottom: 12px; }

  /* ── Champs : empilés sur une colonne ── */
  .field-row { flex-direction: column; gap: 8px; margin-bottom: 8px; }

  /* Date + heure : rester côte à côte */
  .field-row > .field-group > div[style*="display:flex"] { gap: 8px; }
  .field-row > .field-group > div[style*="display:flex"] input[type="time"] { width: 90px; }

  /* Inputs plus hauts = plus faciles à taper */
  .field-group input { padding: 12px; font-size: 0.95rem; }

  /* ── Statut de paiement ── */
  .payment-status-selector { flex-wrap: wrap; gap: 6px; }
  .status-btn { flex: 1 1 45%; padding: 10px 8px; font-size: 0.82rem; }

  /* ── Articles ── */
  .item-row { font-size: 0.82rem; gap: 5px; padding: 8px 2px; }
  .item-qty  { flex: 0.55; }
  .item-price { flex: 0.9; }
  .item-total { flex: 1; }

  /* Ajout manuel : produit pleine largeur, puis qty + prix + btn */
  .manual-add { flex-wrap: wrap; gap: 7px; }
  .manual-add input.inp-product { flex: 1 1 100%; min-width: unset; }
  .manual-add input.inp-qty     { flex: 1; min-width: 60px; }
  .manual-add input.inp-price   { flex: 2; min-width: 90px; }
  #addItemBtn { flex: 0 0 auto; padding: 10px 16px; }

  /* ── Boutons d'action : grille 2 colonnes ── */
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .actions .btn-primary {
    grid-column: 1 / -1;
    padding: 15px; font-size: 0.95rem;
  }
  .actions .btn-success  { padding: 12px 6px; font-size: 0.84rem; }
  .actions .btn-whatsapp { padding: 12px 6px; font-size: 0.84rem; }
  .actions .btn-danger   {
    grid-column: 1 / -1;
    background: none; border: 1px solid #e4ddd0; color: #9b9486;
    font-size: 0.82rem; padding: 10px;
  }
  .actions .btn-danger:hover { background: #fee2e2; color: var(--red); border-color: var(--red); }

  /* ── Bandeau CA ── */
  #caBanner { flex-direction: column; gap: 4px; padding: 8px 14px; font-size: 0.74rem; }
  #mobileBanner { font-size: 0.74rem; padding: 7px 12px; }

  /* ── Modals : slide depuis le bas ── */
  .wa-modal-box,
  .subscribe-box { max-width: 100%; border-radius: 18px; padding: 24px 18px; }
  .modal-box {
    max-width: 100%; border-radius: 18px 18px 0 0;
    position: fixed; bottom: 0; left: 0; right: 0;
    margin: 0; max-height: 88vh;
  }
  @keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  /* ── Historique ── */
  .history-card { padding: 13px 14px; }

  /* ── Menu compte : drawer bas ── */
  #accountMenu {
    position: fixed !important;
    right: 0 !important; left: 0 !important; top: auto !important;
    bottom: 0; width: 100% !important;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(27,42,74,0.18);
  }
}
