/* =============================================================================
   FactureSimple — Feuille de style
   Design : SaaS suisse moderne, minimaliste, premium.
   Palette : blanc / gris très clair / gris foncé + accent rouge suisse discret.
   Typo : Inter (repli système).
   Sommaire :
     1. Tokens & reset
     2. Utilitaires & boutons
     3. Header / navigation
     4. Accueil (hero, étapes, FAQ, footer)
     5. Générateur (toolbar, studio, cartes, champs)
     6. Lignes de prestations
     7. Aperçu facture A4 (+ 3 styles)
     8. Responsive
     9. Impression / PDF
   ========================================================================== */

/* --------------------------------------------------------------- 1. TOKENS */
:root {
  /* Couleur de marque de la facture (personnalisable en direct) */
  --brand: #0F172A;
  --brand-ink: #FFFFFF;

  /* Palette applicative */
  --swiss-red: #DA291C;      /* accent rouge suisse — usage discret */
  --ink: #0F172A;            /* gris foncé / noir */
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E7EAEF;
  --line-2: #D3D9E2;
  --bg: #F5F6F8;             /* gris très clair */
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --blue: #1E3A5F;           /* bleu foncé secondaire */

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 6px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --t: .2s ease;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; border-radius: var(--r-sm); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.wrap--narrow { max-width: 780px; }

/* ---------------------------------------------------- 2. BOUTONS & COMMUNS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; min-height: 42px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn--lg { min-height: 52px; padding: 14px 28px; font-size: 16px; border-radius: var(--r-md); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 42px; }

.btn--primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: #1e293b; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--ghost { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--soft { background: color-mix(in srgb, var(--ink) 6%, white); color: var(--ink); border-color: var(--line); }
.btn--soft:hover { background: color-mix(in srgb, var(--ink) 10%, white); }
.btn--danger-ghost { background: #fff; border-color: var(--line-2); color: var(--swiss-red); }
.btn--danger-ghost:hover { border-color: var(--swiss-red); background: #FEF2F2; }

.view[hidden] { display: none; }

/* -------------------------------------------------------- 3. HEADER / NAV */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px; }
.brand__mark { display: grid; place-items: center; }
.brand__name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.site-nav { display: flex; gap: 6px; margin-left: auto; }
.site-nav a {
  padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  border-radius: var(--r-sm); transition: background var(--t), color var(--t);
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-header .btn--primary { margin-left: 4px; }

/* --------------------------------------------------------- 4. ACCUEIL */
/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 80px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--blue) 8%, transparent), transparent 70%),
    linear-gradient(180deg, #fff, var(--bg));
}
.hero__inner { text-align: center; max-width: 780px; margin: 0 auto; }
.hero__badge {
  display: inline-block; padding: 7px 14px; margin-bottom: 22px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-xs);
}
.hero__title { font-size: clamp(34px, 6vw, 58px); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; }
.hero__sub { margin: 20px auto 0; max-width: 560px; font-size: clamp(16px, 2vw, 19px); color: var(--muted); }
.hero__tagline { margin-top: 14px; font-weight: 600; color: var(--ink); }
.hero__tagline::after { content: ""; display: block; width: 40px; height: 3px; margin: 16px auto 0; background: var(--swiss-red); border-radius: 3px; }
.hero__cta { margin-top: 30px; }
.hero__checks {
  list-style: none; padding: 0; margin: 30px 0 0;
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: center;
  font-size: 14px; color: var(--ink-2);
}
.hero__checks li { display: inline-flex; align-items: center; gap: 8px; }
.hero__checks .icon { width: 18px; height: 18px; color: #0f9d58; stroke-width: 2.4; }

/* Sections génériques */
.section-title { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -.02em; text-align: center; }
.section-lead { text-align: center; color: var(--muted); margin-top: 10px; }

/* Comment ça marche */
.how { padding: clamp(50px, 8vw, 90px) 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 42px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 26px; box-shadow: var(--shadow-xs);
  transition: transform var(--t), box-shadow var(--t);
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.step__num {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  font-weight: 800; font-size: 16px; color: var(--blue);
  background: color-mix(in srgb, var(--blue) 9%, white); border-radius: 12px; margin-bottom: 16px;
}
.step h3 { font-size: 18px; font-weight: 700; }
.step p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.how__cta { text-align: center; margin-top: 44px; }

/* FAQ */
.faq { padding: clamp(40px, 7vw, 80px) 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.accordions { margin-top: 34px; display: flex; flex-direction: column; gap: 12px; }
.accordion {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  overflow: hidden; transition: box-shadow var(--t);
}
.accordion[open] { box-shadow: var(--shadow-sm); }
.accordion summary {
  list-style: none; cursor: pointer; padding: 16px 20px;
  font-weight: 600; font-size: 15.5px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: ""; width: 11px; height: 11px; flex: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform var(--t);
}
.accordion[open] summary::after { transform: rotate(-135deg); }
.accordion p { padding: 0 20px 18px; color: var(--muted); font-size: 15px; }

/* Footer */
.site-footer { background: var(--ink); color: #cbd5e1; padding: 54px 0 30px; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
.site-footer__brand strong { color: #fff; font-size: 17px; }
.site-footer__brand p { margin-top: 8px; max-width: 340px; font-size: 14px; color: #94a3b8; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer__links a { font-size: 14px; color: #cbd5e1; transition: color var(--t); }
.site-footer__links a:hover { color: #fff; }
.site-footer__legal { margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: #94a3b8; }
.site-footer__legal .disclaimer { margin-top: 6px; font-style: italic; }

/* --------------------------------------------------------- 5. GÉNÉRATEUR */
.toolbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 0; }
.toolbar__title { display: flex; align-items: center; gap: 12px; }
.toolbar__title h2 { font-size: 17px; font-weight: 700; }
.toolbar__sub { font-size: 12.5px; color: var(--muted); }
.toolbar__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.alert {
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r-sm);
  background: #FEF3F2; border: 1px solid #FDA29B; color: #B42318; font-size: 14px; font-weight: 500;
}

.studio {
  display: grid; grid-template-columns: 45% 55%;
  gap: clamp(18px, 2.4vw, 32px); align-items: start;
  padding: clamp(18px, 2.4vw, 30px) clamp(16px, 4vw, 40px) 60px;
  max-width: 1240px; margin: 0 auto;
}
/* Autorise les deux colonnes à se compresser (sinon l'aperçu A4 élargit la grille) */
.studio > * { min-width: 0; }

/* Panneau formulaire */
.form-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs); overflow: hidden;
  transition: box-shadow var(--t);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card__head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px 18px; background: none; border: 0; cursor: pointer; text-align: left; color: inherit;
}
.card__head--static { cursor: default; }
.card__title { font-weight: 600; font-size: 15px; flex: 1; }
.card__chevron { color: var(--muted); transition: transform var(--t); }
.card__head[aria-expanded="false"] .card__chevron { transform: rotate(-90deg); }
.card__body { display: flex; flex-direction: column; gap: 14px; padding: 0 18px 18px; }
.card__head[aria-expanded="false"] + .card__body { display: none; }

.subcard { padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 12px; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: 1fr 2fr; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .opt { font-weight: 400; color: var(--muted); }
.field .req, .req { color: var(--swiss-red); font-weight: 700; }
.field-note { font-size: 12.5px; color: var(--muted); }
.field-note code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); font-size: 12px; }

input, select, textarea {
  width: 100%; padding: 10px 12px; font-family: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color var(--t), box-shadow var(--t);
}
input::placeholder, textarea::placeholder { color: #9AA5B4; }
input:hover, select:hover, textarea:hover { border-color: #94A3B8; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}
textarea { resize: vertical; min-height: 72px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px;
}

/* Profils */
.profiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.profile {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 14px; background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--r-md);
  cursor: pointer; transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.profile:hover { border-color: #94A3B8; }
.profile.is-active { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, white); box-shadow: var(--shadow-xs); }
.profile__title { font-weight: 600; font-size: 13.5px; }
.profile__desc { font-size: 12px; color: var(--muted); }

/* Uploader logo */
.logo-uploader { display: flex; align-items: center; gap: 14px; }
.logo-thumb {
  width: 64px; height: 64px; object-fit: contain; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; padding: 6px;
}
.logo-uploader__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Color picker */
.color-field { display: flex; gap: 8px; }
.color-field input[type="color"] { width: 46px; padding: 4px; flex: none; cursor: pointer; }
.color-field__hex { text-transform: uppercase; }

.qr-note {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-md);
  color: var(--muted); font-size: 13px; background: var(--surface-2);
}
.qr-note .icon { color: var(--muted); }

.privacy-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.privacy-note .icon { color: #0f9d58; }

/* ------------------------------------------------ 6. LIGNES PRESTATIONS */
.items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.item {
  display: grid; grid-template-columns: 1fr 68px 104px 84px 36px; gap: 8px; align-items: end;
  padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  animation: itemIn .24s cubic-bezier(.2,.7,.3,1);
}
@keyframes itemIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.item.is-leaving { animation: itemOut .18s ease forwards; }
@keyframes itemOut { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
.item .field label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.item input { padding: 8px 9px; font-size: 13px; }
.item__total { display: flex; align-items: center; height: 36px; font-weight: 600; font-size: 13px; }
.item__remove {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--muted);
  cursor: pointer; transition: all var(--t);
}
.item__remove:hover { border-color: var(--swiss-red); color: var(--swiss-red); background: #FEF2F2; }
.item__remove .icon { width: 16px; height: 16px; }

/* ------------------------------------------------ 7. APERÇU FACTURE A4 */
.invoice-preview { position: sticky; top: 90px; }

.invoice-page {
  --iv-pad: 18mm;
  width: 210mm; min-height: 297mm;
  max-width: 100%;
  margin: 0 auto; padding: var(--iv-pad);
  background: #fff; color: #1a2230;
  box-shadow: var(--shadow-lg); border-radius: 4px;
  font-size: 11pt; line-height: 1.5; position: relative; overflow: hidden;
  /* Mise à l'échelle pour tenir dans la colonne d'aperçu à l'écran */
  transform-origin: top center;
}

.iv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.iv-logo { max-width: 220px; max-height: 90px; object-fit: contain; display: block; }
.iv-title-block { text-align: right; }
.iv-title { font-size: 26pt; font-weight: 800; letter-spacing: -.02em; color: var(--brand); line-height: 1; }
.iv-meta { margin-top: 12px; font-size: 10pt; display: grid; gap: 4px; justify-content: end; }
.iv-meta div { display: flex; gap: 10px; justify-content: flex-end; }
.iv-meta dt { color: #64748B; } .iv-meta dd { margin: 0; font-weight: 600; }

.iv-from { margin-top: 20px; font-size: 10pt; color: #475569; }
.iv-from strong { color: #1a2230; font-size: 11pt; }

.iv-billto { margin-top: 26px; }
.iv-label {
  font-size: 8.5pt; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: var(--brand); margin-bottom: 6px;
}
.iv-billto__name { font-weight: 700; font-size: 11.5pt; }
.iv-billto p { font-size: 10pt; color: #475569; }

.iv-table { width: 100%; border-collapse: collapse; margin-top: 26px; font-size: 10pt; }
.iv-table thead th {
  background: var(--brand); color: var(--brand-ink); text-align: right; padding: 9px 10px;
  font-size: 8.5pt; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.iv-table thead th:first-child { text-align: left; border-radius: 5px 0 0 5px; }
.iv-table thead th:last-child { border-radius: 0 5px 5px 0; }
.iv-table td { padding: 9px 10px; text-align: right; border-bottom: 1px solid #EEF1F5; vertical-align: top; }
.iv-table td:first-child { text-align: left; }
.iv-table tbody tr:nth-child(even) td { background: #FAFBFC; }
.iv-item-desc { font-weight: 600; color: #1a2230; }

.iv-bottom { display: flex; justify-content: flex-end; margin-top: 22px; }
.iv-totals { width: 300px; max-width: 100%; }
.iv-totals table { width: 100%; border-collapse: collapse; }
.iv-totals td { padding: 6px 0; font-size: 10pt; }
.iv-totals td:last-child { text-align: right; font-weight: 600; }
.iv-totals .iv-discount td { color: var(--swiss-red); }
.iv-totals .iv-grand td {
  border-top: 2px solid var(--brand); padding-top: 10px; margin-top: 4px;
  font-size: 13pt; font-weight: 800; color: var(--brand);
}

.iv-pay {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.iv-pay__block p { font-size: 9.5pt; color: #475569; }
.iv-pay__block .mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.iv-notes { margin-top: 20px; font-size: 9.5pt; color: #475569; white-space: pre-line; }
.iv-footer { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; font-size: 9pt; color: #94A3B8; }

/* Styles de facture */
.invoice-page[data-style="modern"]::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 7px; background: var(--brand);
}
.invoice-page[data-style="classic"] { border: 1px solid var(--line-2); }
.invoice-page[data-style="classic"] .iv-title { color: #1a2230; }
.invoice-page[data-style="classic"] .iv-table thead th { background: #F1F3F5; color: #1a2230; border-bottom: 2px solid var(--brand); }
.invoice-page[data-style="classic"] .iv-label { color: #475569; }
.invoice-page[data-style="minimal"] .iv-table thead th { background: none; color: #64748B; border-bottom: 1.5px solid var(--ink); }
.invoice-page[data-style="minimal"] .iv-table tbody tr:nth-child(even) td { background: none; }
.invoice-page[data-style="minimal"] .iv-title { font-weight: 600; }

.iv-empty { text-align: center; color: #94A3B8; padding: 30px; font-size: 10pt; }

/* --------------------------------------------------------- 8. RESPONSIVE */
/* Mise à l'échelle de l'aperçu A4 selon la largeur disponible */
@media (max-width: 1400px) { .invoice-page { transform: scale(.92); margin-bottom: -6%; } }
@media (max-width: 1240px) { .invoice-page { transform: scale(.8); margin-bottom: -14%; } }

@media (max-width: 1024px) {
  .studio { grid-template-columns: 1fr; }
  .invoice-preview { position: static; margin-top: 8px; }
  .invoice-page { transform: none; margin-bottom: 0; width: 100%; min-height: auto; --iv-pad: clamp(20px, 5vw, 40px); }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .site-header .btn--primary { display: none; } /* CTA repris par le hero / la barre d'outils */
  .steps { grid-template-columns: 1fr; }
  .profiles { grid-template-columns: 1fr; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .toolbar__actions .btn { flex: 1 1 auto; }
  .item { grid-template-columns: 1fr 1fr; }
  .item .field--desc { grid-column: 1 / -1; }
  .item__total-wrap { grid-column: 1 / -1; }
  .item__remove { grid-column: 2; justify-self: end; }
  .iv-pay { grid-template-columns: 1fr; }
  .iv-top { flex-direction: column; }
  .iv-title-block { text-align: left; }
  .iv-meta, .iv-meta div { justify-content: flex-start; }

  /* Compression de la facture pour tenir les 5 colonnes sur petit écran */
  .invoice-page { --iv-pad: 14px; font-size: 9.5pt; }
  .iv-table { font-size: 8.5pt; }
  .iv-table thead th, .iv-table td { padding: 7px 6px; }
  .iv-totals { width: 100%; }
}

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

/* --------------------------------------------------- 9. IMPRESSION / PDF */
@media print {
  @page { size: A4; margin: 0; }

  .site-header, .toolbar, .form-panel, .alert, .no-print, footer.site-footer { display: none !important; }
  #viewHome { display: none !important; }

  body { background: #fff; }
  .studio { display: block; padding: 0; margin: 0; max-width: none; }
  .invoice-preview { position: static; }

  .invoice-page {
    width: 210mm; min-height: 297mm; max-width: none;
    margin: 0; padding: 16mm; box-shadow: none; border-radius: 0;
    transform: none; font-size: 10.5pt;
  }
  .invoice-page[data-style="classic"] { border: none; }

  /* Éviter les coupures de tableau */
  .iv-table { page-break-inside: auto; }
  .iv-table thead { display: table-header-group; }
  .iv-table tr { page-break-inside: avoid; }
  .iv-bottom, .iv-pay, .iv-notes, .iv-footer { page-break-inside: avoid; }

  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
