/* ============================================================
   DEVISTO — feuille de style
   Devis et factures, pour tous les métiers. Direction : pro épuré.
   Bleu (confiance/pro) + vert (signé/encaissé — l'état de réussite
   déjà utilisé partout dans l'appli). Chiffres en monospace : un
   devis, ce sont des chiffres, on les traite comme tels.
   Variables en haut pour tout régler.
   ============================================================ */

:root {
  --bleu: #1d4ed8;
  --bleu-fonce: #1e3a8a;
  --bleu-vif: #2563eb;
  --bleu-clair: #dbeafe;
  --encre: #0b1220;
  --texte: #384152;
  --texte-doux: #5b6472;
  --fond: #f6f7fb;
  --carte: #ffffff;
  --bord: #e3e6ee;
  --vert: #16a34a;
  --vert-fonce: #15803d;
  --vert-fond: #dcfce7;
  --orange: #d97706;
  --orange-fond: #fef3c7;
  --rouge: #dc2626;
  --rouge-fond: #fee2e2;
  --gris-fond: #f1f2f7;
  --police-chiffres: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  --ombre: 0 1px 2px rgba(11, 18, 32, .04), 0 8px 24px -6px rgba(11, 18, 32, .10);
  --ombre-hover: 0 4px 10px rgba(11, 18, 32, .06), 0 20px 40px -12px rgba(11, 18, 32, .18);
  --rayon: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--encre); line-height: 1.15; letter-spacing: -.01em; }

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

:focus-visible { outline: 2px solid var(--bleu-vif); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.25rem; border-radius: 10px; border: none;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: transform .08s ease, box-shadow .18s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--bleu); color: #fff; box-shadow: 0 1px 2px rgba(29,78,216,.15), 0 8px 20px -6px rgba(29,78,216,.45); }
.btn-primary:hover { background: var(--bleu-vif); box-shadow: 0 1px 2px rgba(29,78,216,.2), 0 12px 28px -6px rgba(29,78,216,.55); }
.btn-secondary { background: var(--carte); color: var(--encre); border: 1px solid var(--bord); }
.btn-secondary:hover { border-color: var(--bleu); color: var(--bleu); }
.btn-ghost { background: transparent; color: var(--texte-doux); }
.btn-ghost:hover { color: var(--encre); background: var(--gris-fond); }
.btn-danger { background: var(--rouge-fond); color: var(--rouge); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: var(--vert); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.champ label { font-size: .85rem; font-weight: 600; color: var(--encre); }
.champ input, .champ select, .champ textarea {
  padding: .6rem .75rem; border: 1px solid var(--bord); border-radius: 8px;
  background: #fff; color: var(--encre); width: 100%;
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: 2px solid var(--bleu-clair); border-color: var(--bleu);
}
.champ .aide { font-size: .78rem; color: var(--texte-doux); }
.ligne-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.ligne-champs-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .ligne-champs, .ligne-champs-3 { grid-template-columns: 1fr; } }

.erreur-msg { background: var(--rouge-fond); color: var(--rouge); padding: .6rem .9rem; border-radius: 8px; font-size: .9rem; margin: .5rem 0; display: none; }
.erreur-msg.visible { display: block; }

/* ============================================================
   PAGE D'ACCUEIL (index.html)
   ============================================================ */
.landing-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 5%; background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
  position: sticky; top: 0; z-index: 50;
}
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; color: var(--encre); text-decoration: none; letter-spacing: -.01em; }
.logo img, .logo svg { width: 32px; height: 32px; }

.hero {
  position: relative; overflow: hidden;
  padding: 4.5rem 5% 4rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(29,78,216,.10), transparent 60%),
    radial-gradient(40rem 24rem at -5% 30%, rgba(22,163,74,.07), transparent 60%),
    #fff;
}
.hero-inner {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--bleu-clair); color: var(--bleu-fonce); font-weight: 700; font-size: .82rem;
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 800; margin-bottom: 1rem; }
.hero h1 .accent { color: var(--bleu); }
.hero p { font-size: 1.1rem; color: var(--texte-doux); max-width: 520px; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }

.metier-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.metier-chip {
  background: #fff; border: 1px solid var(--bord); border-radius: 999px;
  padding: .4rem .9rem; font-size: .84rem; font-weight: 600; color: var(--texte);
}

/* Mini-devis stylisé — l'objet réel que l'outil produit, pas une capture d'écran */
.hero-devis-zone { position: relative; display: flex; justify-content: center; }
.mini-devis {
  width: 100%; max-width: 330px; background: #fff; border-radius: 16px;
  box-shadow: var(--ombre-hover); transform: rotate(-3deg); overflow: hidden;
  border: 1px solid var(--bord);
}
.mini-devis .md-tete {
  background: var(--bleu); color: #fff; padding: 1rem 1.2rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.mini-devis .md-tete .md-badge { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.mini-devis .md-tete .md-numero { font-family: var(--police-chiffres); font-size: .78rem; opacity: .9; margin-top: .15rem; }
.mini-devis .md-corps { padding: 1.1rem 1.2rem; }
.mini-devis .md-ligne { display: flex; justify-content: space-between; gap: .75rem; font-size: .84rem; padding: .45rem 0; border-bottom: 1px dashed var(--bord); color: var(--texte); }
.mini-devis .md-ligne span:last-child { font-family: var(--police-chiffres); font-weight: 600; color: var(--encre); white-space: nowrap; }
.mini-devis .md-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: .85rem; margin-top: .3rem; }
.mini-devis .md-total .md-total-label { font-size: .78rem; font-weight: 700; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .04em; }
.mini-devis .md-total .md-total-valeur { font-family: var(--police-chiffres); font-size: 1.3rem; font-weight: 800; color: var(--encre); }
.mini-devis-stamp {
  position: absolute; top: -14px; right: 6%; transform: rotate(9deg);
  display: flex; align-items: center; gap: .3rem;
  background: var(--vert-fond); color: var(--vert-fonce); font-weight: 800; font-size: .82rem;
  padding: .4rem .75rem; border-radius: 999px; border: 2px solid var(--vert);
  box-shadow: 0 6px 16px -4px rgba(22,163,74,.35);
}

.features { padding: 4.5rem 5%; max-width: 1100px; margin: 0 auto; }
.features-tete { text-align: center; max-width: 560px; margin: 0 auto 2.5rem; }
.features-tete h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.features-tete p { color: var(--texte-doux); font-size: 1rem; }
.features-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.feature {
  background: var(--carte); border-radius: var(--rayon); padding: 1.5rem; box-shadow: var(--ombre);
  transition: box-shadow .2s ease, transform .2s ease; border: 1px solid transparent;
}
.feature:hover { box-shadow: var(--ombre-hover); transform: translateY(-2px); }
.feature .icone-badge {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: .9rem; background: var(--bleu-clair);
}
.feature.verte .icone-badge { background: var(--vert-fond); }
.feature h3 { margin-bottom: .4rem; font-size: 1.05rem; }
.feature p { font-size: .92rem; color: var(--texte-doux); }

.landing-footer { padding: 2.5rem 5% 2rem; border-top: 1px solid var(--bord); }
.landing-footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.landing-footer p { color: var(--texte-doux); font-size: .85rem; }
.footer-liens { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-liens a { color: var(--texte-doux); font-size: .85rem; text-decoration: none; }
.footer-liens a:hover { color: var(--bleu); text-decoration: underline; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .metier-chips { justify-content: center; }
  .hero-devis-zone { margin-top: 1rem; }
  .mini-devis { transform: rotate(0deg); }
  .landing-footer-inner { flex-direction: column; text-align: center; }
}

/* ---------- Case de consentement (CGU/CGV) ---------- */
.champ-consentement { margin-bottom: 1rem; text-align: left; }
.champ-consentement label {
  display: flex; align-items: flex-start; gap: .5rem; font-size: .82rem;
  color: var(--texte-doux); cursor: pointer; line-height: 1.4;
}
.champ-consentement input[type="checkbox"] { width: auto; margin-top: .15rem; flex-shrink: 0; }
.champ-consentement a { color: var(--bleu); }

/* ---------- Page abonnement ---------- */
.abonnement-zone { display: flex; justify-content: center; padding: 3rem 1.25rem; }
.abonnement-carte {
  background: var(--carte); border-radius: 16px; box-shadow: var(--ombre);
  padding: 2.25rem; max-width: 420px; width: 100%; text-align: center;
}
.abonnement-carte h1 { font-size: 1.4rem; margin-bottom: .5rem; }
.abo-intro { color: var(--texte-doux); font-size: .9rem; margin-bottom: 1.5rem; }
.abo-prix { margin: 1rem 0 1.25rem; }
.abo-montant { font-size: 2.6rem; font-weight: 800; color: var(--bleu); }
.abo-periode { font-size: 1rem; color: var(--texte-doux); }
.abo-avantages { list-style: none; text-align: left; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: .5rem; font-size: .92rem; }
.abo-securise { font-size: .78rem; color: var(--texte-doux); margin-top: 1rem; }

/* ---------- Pages légales ---------- */
.legal-body { background: var(--fond); }
.legal-main { max-width: 760px; margin: 0 auto; padding: 2.5rem 5% 4rem; }
.legal-main h1 { font-size: 1.9rem; margin-bottom: .4rem; }
.legal-updated { color: var(--texte-doux); font-size: .85rem; margin-bottom: 1.5rem; }
.legal-main h2 { font-size: 1.15rem; margin: 1.75rem 0 .6rem; }
.legal-main p, .legal-main li { color: var(--texte); font-size: .95rem; line-height: 1.65; }
.legal-main ul { padding-left: 1.3rem; margin: .5rem 0; }
.legal-main li { margin-bottom: .35rem; }
.legal-main a { color: var(--bleu); }
.legal-main code { background: var(--gris-fond); padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }
.legal-note {
  background: var(--bleu-clair); color: var(--bleu-fonce); border-radius: 10px;
  padding: .9rem 1.1rem; font-size: .85rem; margin-bottom: 1.5rem; line-height: 1.5;
}

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 1rem;
}
.modal-overlay.ouverte { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 1.75rem; width: 100%;
  max-width: 440px; max-height: 92vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(15,23,42,.3);
}
.modal.large { max-width: 640px; }
.modal h2 { margin-bottom: 1.1rem; font-size: 1.3rem; }
.modal-fermer { float: right; background: none; border: none; font-size: 1.4rem; color: var(--texte-doux); line-height: 1; }
.modal-fermer:hover { color: var(--encre); }

.onglets { display: flex; gap: .25rem; background: var(--gris-fond); padding: .25rem; border-radius: 10px; margin-bottom: 1.25rem; }
.onglet { flex: 1; text-align: center; padding: .5rem; border-radius: 8px; border: none; background: transparent; font-weight: 600; color: var(--texte-doux); }
.onglet.actif { background: #fff; color: var(--encre); box-shadow: var(--ombre); }

/* ============================================================
   APPLICATION (app.html)
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex-shrink: 0; background: var(--encre); color: #cbd5e1;
  display: flex; flex-direction: column; padding: 1.25rem .9rem;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { color: #fff; margin-bottom: 1.75rem; padding: 0 .5rem; }
.nav-lien {
  display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem;
  border-radius: 9px; color: #cbd5e1; text-decoration: none; font-weight: 500;
  font-size: .95rem; border: none; background: none; width: 100%; text-align: left;
  margin-bottom: .15rem;
}
.nav-lien:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-lien.actif { background: var(--bleu); color: #fff; }
.sidebar-bas { margin-top: auto; }
.badge-demo {
  background: var(--orange-fond); color: var(--orange); font-size: .75rem;
  font-weight: 700; padding: .3rem .6rem; border-radius: 7px; text-align: center;
  margin-bottom: .75rem; display: block;
}

.contenu { flex: 1; padding: 1.75rem 2rem; max-width: 1200px; min-width: 0; }
.vue { display: none; }
.vue.active { display: block; }

.vue-entete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.vue-entete h1 { font-size: 1.5rem; }
.vue-entete .sous-titre { color: var(--texte-doux); font-size: .92rem; margin-top: .15rem; }

/* ---------- Cartes stats du tableau de bord ---------- */
.stats-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-carte { background: var(--carte); border-radius: var(--rayon); padding: 1.15rem 1.3rem; box-shadow: var(--ombre); border-top: 3px solid var(--bleu); }
.stat-carte.verte { border-top-color: var(--vert); }
.stat-carte.orange { border-top-color: var(--orange); }
.stat-carte.violette { border-top-color: #7c3aed; }
.stat-libelle { font-size: .82rem; font-weight: 600; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .03em; }
.stat-valeur { font-size: 1.65rem; font-weight: 800; color: var(--encre); margin-top: .2rem; }
.stat-detail { font-size: .82rem; color: var(--texte-doux); margin-top: .15rem; }

/* ---------- Graphique CA mensuel (barres CSS) ---------- */
.carte { background: var(--carte); border-radius: var(--rayon); padding: 1.4rem; box-shadow: var(--ombre); margin-bottom: 1.5rem; }
.carte h2 { font-size: 1.05rem; margin-bottom: 1rem; }
.graph-barres { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.graph-mois { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.graph-barre { width: 100%; max-width: 42px; background: var(--bleu); border-radius: 6px 6px 0 0; min-height: 3px; transition: height .3s ease; }
.graph-barre.vide { background: var(--bord); }
.graph-label { font-size: .7rem; color: var(--texte-doux); font-weight: 600; }
.graph-montant { font-size: .68rem; color: var(--texte-doux); }

/* ---------- Tableaux ---------- */
.table-scroll { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; background: var(--carte); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
table.liste th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--texte-doux); padding: .8rem 1rem; border-bottom: 1px solid var(--bord); background: #f8fafc;
}
table.liste td { padding: .8rem 1rem; border-bottom: 1px solid var(--bord); font-size: .92rem; vertical-align: middle; }
table.liste tr:last-child td { border-bottom: none; }
table.liste tbody tr { cursor: pointer; }
table.liste tbody tr:hover { background: #f8fafc; }
.td-actions { white-space: nowrap; text-align: right; }
.td-montant { font-weight: 700; color: var(--encre); white-space: nowrap; }

.vide-etat { text-align: center; padding: 3rem 1rem; color: var(--texte-doux); background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); }
.vide-etat .icone { font-size: 2.5rem; margin-bottom: .5rem; }

/* ---------- Badges de statut ---------- */
.badge { display: inline-block; padding: .22rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge.brouillon { background: var(--gris-fond); color: var(--texte-doux); }
.badge.envoye { background: var(--bleu-clair); color: var(--bleu); }
.badge.signe { background: var(--vert-fond); color: var(--vert); }
.badge.refuse { background: var(--rouge-fond); color: var(--rouge); }
.badge.expire { background: var(--orange-fond); color: var(--orange); }
.badge.envoyee { background: var(--orange-fond); color: var(--orange); }
.badge.payee { background: var(--vert-fond); color: var(--vert); }
.badge.retard { background: var(--rouge-fond); color: var(--rouge); }

/* ---------- Filtres par statut ---------- */
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtre {
  padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--bord);
  background: var(--carte); font-size: .85rem; font-weight: 600; color: var(--texte-doux);
}
.filtre.actif { background: var(--encre); color: #fff; border-color: var(--encre); }

/* ---------- Éditeur de document ---------- */
.editeur-grille { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .editeur-grille { grid-template-columns: 1fr; } }

table.lignes { width: 100%; border-collapse: collapse; }
table.lignes th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--texte-doux); padding: .4rem .5rem; }
table.lignes td { padding: .3rem .35rem; vertical-align: top; }
table.lignes input, table.lignes select {
  width: 100%; padding: .45rem .5rem; border: 1px solid var(--bord); border-radius: 7px; font-size: .88rem;
}
table.lignes input:focus, table.lignes select:focus { outline: 2px solid var(--bleu-clair); border-color: var(--bleu); }
.col-designation { width: 34%; }
.col-qte { width: 12%; min-width: 76px; }
.col-unite { width: 12%; }
.col-prix { width: 14%; }
.col-tva { width: 11%; }
.col-total { width: 12%; text-align: right; font-weight: 600; white-space: nowrap; font-size: .9rem; padding-top: .75rem !important; }

table.lignes .col-qte input {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  min-width: 60px;
}
.btn-suppr-ligne { background: none; border: none; color: var(--texte-doux); font-size: 1.1rem; padding: .4rem .2rem; }
.btn-suppr-ligne:hover { color: var(--rouge); }

.totaux { border-top: 2px solid var(--bord); margin-top: 1rem; padding-top: 1rem; }
.totaux .ligne-total { display: flex; justify-content: space-between; padding: .25rem 0; font-size: .95rem; }
.totaux .ligne-total.ttc { font-size: 1.2rem; font-weight: 800; color: var(--encre); border-top: 1px solid var(--bord); margin-top: .5rem; padding-top: .6rem; }

/* ---------- Catalogue ---------- */
.catalogue-recherche { margin-bottom: 1rem; }
.catalogue-recherche input { width: 100%; padding: .7rem 1rem; border: 1px solid var(--bord); border-radius: 10px; }
.presta-item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem .9rem; border: 1px solid var(--bord); border-radius: 10px; margin-bottom: .5rem;
  background: #fff; cursor: pointer; transition: border-color .12s ease;
}
.presta-item:hover { border-color: var(--bleu); background: #f8faff; }
.presta-nom { font-weight: 600; color: var(--encre); font-size: .93rem; }
.presta-detail { font-size: .8rem; color: var(--texte-doux); }
.presta-prix { font-weight: 700; color: var(--bleu); white-space: nowrap; }

/* ---------- Onboarding : choix du métier ---------- */
.metiers-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin: 1.25rem 0; }
.metier-carte {
  background: #fff; border: 2px solid var(--bord); border-radius: 12px; padding: 1rem .75rem;
  text-align: center; cursor: pointer; transition: border-color .12s ease, transform .12s ease;
}
.metier-carte:hover { border-color: var(--bleu); transform: translateY(-2px); }
.metier-carte.choisi { border-color: var(--bleu); background: #f0f6ff; }
.metier-carte .emoji { font-size: 1.9rem; }
.metier-carte .nom { font-weight: 700; font-size: .88rem; color: var(--encre); margin-top: .35rem; }
.metier-carte .desc { font-size: .72rem; color: var(--texte-doux); margin-top: .15rem; }

/* ---------- Aperçu PDF avant enregistrement ---------- */
.apercu-modal { max-width: 780px; }
.apercu-cadre {
  background: #eef1f6; border-radius: 10px; padding: 1.5rem;
  max-height: 60vh; overflow-y: auto; margin-bottom: 1rem;
}
.apercu-cadre .doc-print {
  background: #fff; padding: 14mm; border-radius: 4px; box-shadow: 0 2px 10px rgba(15,23,42,.12);
  max-width: 190mm; margin: 0 auto;
}
.apercu-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .apercu-cadre .doc-print { padding: 6mm; }
  .apercu-actions { justify-content: stretch; }
  .apercu-actions .btn { flex: 1; }
}

/* ---------- Logo entreprise ---------- */
.logo-zone { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logo-apercu {
  width: 96px; height: 96px; border: 1px dashed var(--bord); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--gris-fond); flex-shrink: 0;
}
.logo-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-apercu #logo-apercu-vide { font-size: .75rem; color: var(--texte-doux); text-align: center; padding: 0 .3rem; }
.logo-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }

/* ---------- Personnalisation du PDF ---------- */
.couleur-swatches { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.couleur-swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent;
  transition: transform .1s ease; padding: 0;
}
.couleur-swatch:hover { transform: scale(1.12); }
.couleur-swatch.actif { border-color: var(--encre); box-shadow: 0 0 0 2px #fff inset; }
.couleur-perso { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--texte-doux); }
.couleur-perso input[type="color"] { width: 40px; height: 34px; border: 1px solid var(--bord); border-radius: 8px; padding: 2px; cursor: pointer; background: #fff; }

/* ---------- Modalités de paiement ---------- */
.paiement-cases { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.case-paiement { display: flex; align-items: center; gap: .5rem; font-weight: 500; font-size: .92rem; cursor: pointer; }
.case-paiement input { width: auto; }

/* ---------- Réglages ---------- */
.reglages-section { margin-bottom: 2rem; }
.reglages-section h2 { font-size: 1.05rem; margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--bord); }

/* ---------- Responsive appli ---------- */
@media (max-width: 820px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; overflow-x: auto; padding: .6rem .75rem; gap: .1rem;
  }
  .sidebar .logo { margin-bottom: 0; margin-right: .5rem; }
  .sidebar .logo span { display: none; }
  .nav-lien { white-space: nowrap; padding: .5rem .7rem; margin-bottom: 0; }
  .sidebar-bas { margin-top: 0; margin-left: auto; display: flex; align-items: center; gap: .4rem; }
  .badge-demo { margin-bottom: 0; }
  .contenu { padding: 1.25rem 1rem; }
}

/* ============================================================
   IMPRESSION (devis / factures → PDF via Imprimer)
   ============================================================ */
#print-area { display: none; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  #print-area { display: block !important; }
}

.doc-print { font-size: 11pt; color: #111; max-width: 190mm; margin: 0 auto; font-family: var(--doc-font, -apple-system, "Segoe UI", Arial, sans-serif); }
.doc-print header { display: flex; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.doc-print .entreprise-bloc { font-size: 9.5pt; line-height: 1.45; }
.doc-print .entreprise-bloc .logo-entreprise { display: block; max-height: 20mm; max-width: 55mm; margin-bottom: .4rem; }
.doc-print .entreprise-bloc .nom-entreprise { font-size: 13pt; font-weight: 800; color: var(--doc-accent, #1d4ed8); margin-bottom: .1rem; }
.doc-print .entreprise-bloc .slogan-entreprise { font-size: 9pt; color: #555; font-style: italic; margin-bottom: .3rem; }
.doc-print .doc-titre { text-align: right; }
.doc-print .doc-titre h1 { font-size: 19pt; letter-spacing: .02em; color: var(--doc-accent, #1d4ed8); }
.doc-print .doc-titre .numero { font-size: 11pt; font-weight: 700; margin-top: .1rem; }
.doc-print .doc-titre .dates { font-size: 9pt; color: #444; margin-top: .3rem; line-height: 1.5; }
.doc-print .client-bloc {
  margin: 0 0 1.25rem auto; width: 65mm; border: 1px solid #ddd; border-radius: 6px;
  padding: .6rem .8rem; font-size: 9.5pt; line-height: 1.5;
}
.doc-print .client-bloc .titre-bloc { font-size: 8pt; text-transform: uppercase; color: #777; letter-spacing: .05em; }
.doc-print .client-bloc .nom-client { font-weight: 700; font-size: 10.5pt; }
.doc-print table.doc-lignes { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.doc-print table.doc-lignes th {
  background: var(--doc-accent, #1d4ed8); color: #fff; text-align: left; padding: .45rem .6rem;
  font-size: 8.5pt; text-transform: uppercase; letter-spacing: .03em;
}
.doc-print table.doc-lignes th.num, .doc-print table.doc-lignes td.num { text-align: right; }
.doc-print table.doc-lignes td { padding: .45rem .6rem; border-bottom: 1px solid #e5e5e5; font-size: 9.5pt; }
.doc-print .totaux-bloc { margin-left: auto; width: 70mm; font-size: 10pt; }
.doc-print .totaux-bloc .lt { display: flex; justify-content: space-between; padding: .2rem 0; }
.doc-print .totaux-bloc .lt.ttc { font-weight: 800; font-size: 12pt; border-top: 2px solid var(--doc-accent, #1d4ed8); margin-top: .3rem; padding-top: .4rem; color: var(--doc-accent, #1d4ed8); }
.doc-print .mentions { font-size: 8pt; color: #555; margin-top: 1.5rem; line-height: 1.5; }
.doc-print .signature-bloc {
  margin-top: 1.5rem; border: 1px solid #ddd; border-radius: 6px; padding: .7rem .9rem;
  width: 80mm; font-size: 9pt; color: #444;
}
.doc-print .signature-bloc .espace-signature { height: 22mm; }
.doc-print footer { margin-top: 2rem; padding-top: .6rem; border-top: 1px solid #ddd; font-size: 7.5pt; color: #777; text-align: center; line-height: 1.5; }
