@font-face { font-family: "Gloock"; src: url(fonts/Gloock-Regular.woff) format("woff"); font-display: swap; }
@font-face { font-family: "Lora"; src: url(fonts/Lora-Variable.woff) format("woff"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url(fonts/Lora-Italic-Variable.woff) format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-Medium.woff) format("woff"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(fonts/Poppins-Bold.woff) format("woff"); font-weight: 700; font-display: swap; }

:root {
  --cream: #F8F2E6;
  --paper: #FFFCF6;
  --gold: #C29A66;
  --gold-2: #D9BC8C;
  --gold-dark: #9E7845;
  --rose: #C98E86;
  --ink: #3F342B;
  --ink-2: #6B5B4D;
  --muted: #9A8977;
  --line: #EADFCC;
  --danger: #B9625D;
  --serif: "Lora", Georgia, serif;
  --display: "Gloock", "Lora", Georgia, serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--cream); }
body { font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; color: var(--ink); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; font-family: var(--display); font-size: 26px; color: var(--gold-dark); }
.splash img { width: 120px; border-radius: 28px; }

/* ── En-tête ── */
.top { position: sticky; top: 0; z-index: 50; background: rgba(248, 242, 230, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px 6px; }
.brand img { width: 50px; height: 50px; border-radius: 14px; object-fit: cover; box-shadow: 0 2px 10px rgba(158, 120, 69, .18); }
.brand h1 { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .2px; color: var(--ink); line-height: 1.1; }
.brand p { font-family: var(--serif); font-weight: 600; font-size: 12px; color: var(--gold); line-height: 1.3; }
.tabs { max-width: 860px; margin: 0 auto; display: flex; gap: 4px; padding: 4px 12px 8px; }
.tabs button { flex: 1; padding: 9px 6px; border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.tabs button.on { background: var(--paper); color: var(--gold-dark); box-shadow: 0 1px 6px rgba(63, 52, 43, .08); border: 1px solid var(--line); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #fff; font-size: 11px; line-height: 18px; }

.main { max-width: 860px; margin: 0 auto; padding: 14px 16px 30px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

/* ── Cartes ── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 1px 3px rgba(63, 52, 43, .04); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.ico { font-size: 17px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.lbl { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; outline: none; transition: border-color .15s;
  font-size: 16px; /* évite le zoom iOS */
}
input:focus, textarea:focus { border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: #C5B6A3; }
textarea { resize: vertical; }
.mt { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 70px 1fr auto; gap: 0 10px; align-items: end; }
.self-end { align-self: end; margin-bottom: 12px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }

.money { position: relative; }
.money input { padding-right: 32px !important; font-weight: 600; }
.money span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; }

/* ── Choix ── */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 8px 14px; border-radius: 20px; border: 1.5px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #fff; border-color: var(--gold); box-shadow: 0 2px 8px rgba(194, 154, 102, .35); }
.shape-ico { font-size: 15px; line-height: 1; }

.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 640px) { .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.check { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.check.on { border-color: var(--gold); background: #FFF8EC; }
.check-btn { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; text-align: left; min-width: 0; }
.check-btn .txt { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.box { width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; border: 1.5px solid #D5C4AC; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; background: #fff; }
.on > .box, .check.on .box, .formula.on .box { background: linear-gradient(135deg, var(--gold), var(--gold-2)); border-color: var(--gold); }
.x-mini { width: 28px; height: 28px; margin-right: 4px; border-radius: 8px; color: var(--muted); font-size: 17px; }

.add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-row input { flex: 1; padding: 9px 12px !important; }

.seg { display: flex; background: #F1E7D7; border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 9px 10px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--gold); color: #fff; box-shadow: 0 1px 4px rgba(158, 120, 69, .3); }
.seg.small button { padding: 6px 12px; font-size: 13px; }

/* ── Boutons ── */
.btn-gold, .btn-dark, .btn-soft, .btn-outline, .btn-danger-soft, .btn-add { border-radius: 12px; padding: 11px 16px; font-weight: 600; font-size: 14px; transition: transform .1s, opacity .2s; }
.btn-gold:active, .btn-dark:active, .btn-soft:active, .btn-outline:active { transform: scale(.98); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #fff; box-shadow: 0 3px 12px rgba(194, 154, 102, .35); }
.btn-gold.big { width: 100%; padding: 14px; font-size: 15.5px; }
.btn-dark { background: var(--ink); color: #FBF3E6; }
.btn-soft { background: #F1E7D7; color: var(--gold-dark); }
.btn-outline { background: #fff; border: 1.5px solid var(--gold); color: var(--gold-dark); }
.btn-danger-soft { background: #F7E4E1; color: var(--danger); }
.btn-add { width: 100%; margin-top: 10px; border: 1.5px dashed var(--gold-2); color: var(--gold-dark); background: #FFFBF3; }
button:disabled { opacity: .55; }
.link { color: var(--gold-dark); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.row-btns > * { flex: 1 1 auto; }
.actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Barre commande ── */
.order-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ob-title { font-family: var(--display); font-size: 21px; color: var(--ink); line-height: 1.2; }
.ob-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 8px; background: #F1E7D7; color: var(--gold-dark); font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

/* ── Gâteaux ── */
.cake { border: 1.5px solid var(--line); border-radius: 16px; background: #FFFEFB; overflow: hidden; }
.cake-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; background: linear-gradient(135deg, #FFF8EC, #FFFCF6); }
.cake-num { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.cake-sum { flex: 1; min-width: 0; }
.cake-title { font-family: var(--serif); font-weight: 600; font-size: 15.5px; }
.cake-sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { font-size: 22px; color: var(--muted); transition: transform .2s; line-height: 1; }
.chev.up { transform: rotate(180deg); }
.cake-body { padding: 14px; border-top: 1px solid var(--line); }
.cake-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.nc-box { background: #FFF8EC; border: 1px solid #F0DFC3; border-radius: 14px; padding: 12px; margin-bottom: 12px; }

/* ── Mignardises ── */
.mig-group { margin-bottom: 12px; }
.mig-label { font-family: var(--serif); font-weight: 600; color: var(--gold-dark); margin-bottom: 6px; font-size: 14.5px; }
.mig-table { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.mig-row { display: grid; grid-template-columns: 1fr 58px 76px 66px 26px; gap: 6px; align-items: center; padding: 4px 0; }
.mig-row.head { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.mig-row input { padding: 8px 8px !important; text-align: center; }
.mig-name { font-size: 13.5px; font-weight: 500; }
.mig-total { font-size: 13px; font-weight: 600; text-align: right; color: var(--gold-dark); }

/* ── Buffet ── */
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #E3D5C1; border-radius: 20px; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(20px); }
.formulas { display: flex; flex-direction: column; gap: 8px; }
.formula { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fff; text-align: left; width: 100%; }
.formula.on { border-color: var(--gold); background: #FFF8EC; }
.formula-pick { flex: 1; display: flex; gap: 10px; align-items: flex-start; text-align: left; }
.formula .money { width: 110px; flex-shrink: 0; }
.formula b { font-size: 14px; }
.formula-edit { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--line); }
.extra { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }

/* ── Photos ── */
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.photo { position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(63, 52, 43, .75); color: #fff; font-size: 15px; line-height: 1; }
.photo-add { width: 84px; height: 84px; border-radius: 14px; border: 2px dashed var(--gold-2); background: #FFFBF3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; color: var(--muted); }
.photo-add span { font-size: 22px; }

/* ── Paiement ── */
.recap { margin-bottom: 12px; }
.r-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.total-box { background: var(--ink); color: #FBF3E6; border-radius: 16px; padding: 14px 16px; margin: 4px 0 14px; position: relative; overflow: hidden; }
.total-box::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.tb-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.tb-row b { color: var(--gold-2); }
.tb-row.big { font-size: 17px; border-bottom: 1px solid rgba(255,255,255,.12); padding-bottom: 8px; margin-bottom: 4px; }
.paid { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.opt { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.opt input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ── Ingrédients ── */
.ingr { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ingr-group h4 { font-family: var(--serif); font-size: 14.5px; color: var(--gold-dark); margin-bottom: 4px; }
.ingr-group ul { list-style: none; font-size: 13.5px; }
.ingr-group li::before { content: "• "; color: var(--gold); font-weight: 700; }
.ingr .small { grid-column: 1 / -1; }

/* ── Historique ── */
.search { padding: 12px 14px !important; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-style: italic; }
.h-card { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px; cursor: pointer; }
.h-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.h-thumb.ph { background: #F3EADB; display: grid; place-items: center; font-size: 24px; }
.h-body { flex: 1; min-width: 0; }
.h-title { font-family: var(--serif); font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-line { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.h-price { font-family: var(--display); color: var(--gold-dark); font-size: 16px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.foot { text-align: center; padding: 24px 16px 40px; font-family: var(--serif); color: var(--ink-2); font-size: 13px; display: grid; justify-items: center; gap: 2px; }
.foot img { width: 44px; border-radius: 12px; margin-bottom: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #FBF3E6; padding: 12px 20px; border-radius: 14px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 400; max-width: calc(100vw - 32px); text-align: center; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── Modale document ── */
.overlay { position: fixed; inset: 0; background: rgba(40, 32, 25, .55); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--cream); width: 100%; max-width: 860px; max-height: 96vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 700px) { .overlay { align-items: center; padding: 20px; } .sheet { border-radius: 22px; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.sheet-title { flex: 1; font-family: var(--serif); font-weight: 600; font-size: 15px; text-align: center; }
.x { width: 34px; height: 34px; border-radius: 10px; background: #F1E7D7; color: var(--ink-2); font-size: 15px; }
.sheet-opts { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 16px; }
.sheet-opts:empty { display: none; }
.preview { flex: 1; overflow-y: auto; padding: 12px 14px; }
.preview .doc { box-shadow: 0 4px 24px rgba(63, 52, 43, .18); }
.sheet-actions { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-actions > * { flex: 1 1 auto; }

.capture { position: fixed; left: -12000px; top: 0; width: 794px; pointer-events: none; }

/* ═════════ Document A4 (devis / facture) ═════════ */
.doc { position: relative; width: 794px; min-height: 1123px; background: #FBF6EE; color: #3F342B; font-family: var(--sans); font-size: 11.5px; line-height: 1.48; padding: 38px 58px 34px; overflow: hidden; }
.d-frame { position: absolute; left: 20px; top: 20px; right: 20px; height: 1083px; border: 1.6px solid #C9A46E; pointer-events: none; }
.d-frame::after { content: ""; position: absolute; inset: 4px; border: .6px solid rgba(201, 164, 110, .55); }
.doc h4 { font-family: var(--serif); font-weight: 600; font-size: 13.5px; color: #A47C4E; margin-bottom: 4px; }
.d-head { text-align: center; }
.d-logo { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.d-tag { font-family: var(--serif); font-weight: 600; font-size: 15px; color: #B58D5C; margin-top: 4px; }
.d-rule { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 8px; color: #C9A46E; font-size: 8px; }
.d-rule i { display: block; width: 90px; height: 1px; background: #C9A46E; }
.d-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 10px; }
.d-from { color: #6B5B4D; }
.d-from-name { font-family: var(--display); font-size: 17px; color: #3F342B; }
.d-ident { text-align: right; color: #6B5B4D; }
.d-type { font-family: var(--display); font-size: 30px; line-height: 1; color: #3F342B; text-transform: uppercase; letter-spacing: 2px; }
.d-num { font-family: var(--serif); font-weight: 700; font-size: 15px; color: #A47C4E; margin: 4px 0 2px; }
.d-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.d-box { background: #F4EBDD; border-radius: 10px; padding: 8px 14px; border-left: 3px solid #C9A46E; }
.d-strong { font-weight: 600; color: #3F342B; }
.d-lbl { font-weight: 600; color: #6B5B4D; }
.d-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.d-table th { background: #3F342B; color: #F6EAD7; font-weight: 500; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; padding: 7px 10px; text-align: right; }
.d-table th:first-child { text-align: left; border-radius: 6px 0 0 6px; }
.d-table th:last-child { border-radius: 0 6px 6px 0; }
.d-table td { padding: 6px 10px; border-bottom: 1px solid #EADFCC; vertical-align: top; text-align: right; white-space: nowrap; }
.d-table td:first-child { text-align: left; white-space: normal; width: 62%; }
.d-sub { color: #6B5B4D; }
.d-sub span { color: #A47C4E; font-weight: 500; }
.d-buffet { margin-bottom: 12px; }
.d-opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border: 1px solid #EADFCC; border-radius: 8px; margin-bottom: 6px; background: #FFFCF6; }
.d-opt-body { flex: 1; }
.d-opt-price { font-family: var(--serif); font-weight: 700; font-size: 14px; color: #A47C4E; white-space: nowrap; }
.d-check { display: inline-block; width: 12px; height: 12px; border: 1.3px solid #A47C4E; border-radius: 2px; vertical-align: -1px; margin-right: 6px; background: #fff; flex-shrink: 0; margin-top: 2px; }
.d-totals { position: relative; display: flex; justify-content: flex-end; margin-bottom: 12px; }
.d-sum, .d-recap { width: 330px; }
.d-recap { width: 100%; }
.d-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.d-total { font-family: var(--serif); font-size: 15px; border-top: 2px solid #C9A46E; padding-top: 7px; margin-top: 3px; }
.d-total b { color: #A47C4E; }
.d-note { color: #9A8977; font-style: italic; margin-top: 3px; }
.d-stamp { position: absolute; left: 30px; top: 0; transform: rotate(-10deg); border: 3px solid #6FA77C; color: #6FA77C; font-family: var(--display); font-size: 24px; padding: 4px 18px; border-radius: 8px; opacity: .55; text-transform: uppercase; letter-spacing: 2px; }
.d-pay, .d-notes, .d-photos { background: #F4EBDD; border-radius: 10px; padding: 9px 14px; margin-bottom: 9px; }
.d-photo-row { display: flex; gap: 10px; }
.d-photo-row img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; }
.d-bottom { position: relative; display: grid; grid-template-columns: 1fr 290px; gap: 18px; align-items: start; margin-bottom: 10px; }
.d-bottom .d-pay { margin-bottom: 0; }
.d-bottom .d-sum { width: auto; }
.d-sign { border: 1px dashed #C9A46E; border-radius: 10px; padding: 6px 14px 28px; margin-top: 8px; }
.d-sign-title { font-family: var(--serif); font-weight: 700; font-size: 13.5px; color: #A47C4E; text-transform: uppercase; letter-spacing: 1px; }
.d-sign-fields { display: flex; flex-wrap: wrap; gap: 2px 22px; color: #6B5B4D; margin-top: 2px; }
.d-legal { margin-bottom: 10px; }
.d-legal ul { list-style: none; color: #5A4B3E; }
.d-legal li { position: relative; padding-left: 12px; margin-bottom: 1px; }
.d-legal li::before { content: "•"; position: absolute; left: 0; color: #C9A46E; }
.d-foot { text-align: center; color: #6B5B4D; border-top: 1px solid #E2D3BB; padding-top: 6px; }
.socials { display: flex; align-items: center; gap: 16px; }
.soc-qr-wrap { flex-shrink: 0; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid #E2D3BB; }
.soc-qr { display: block; width: 58px; height: 58px; }
.soc-list { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 22px; }
.soc-item { display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-weight: 600; color: #B58D5C; text-decoration: none; white-space: nowrap; }
.soc-ico { width: 18px; height: 18px; flex-shrink: 0; }
.soc-doc { justify-content: center; margin: 4px 0 4px; }
.soc-doc .soc-list { gap: 4px 22px; }
.soc-doc .soc-item { font-size: 12.5px; }
.soc-app { flex-direction: column; margin: 10px 0 8px; gap: 12px; }
.soc-app .soc-qr { width: 120px; height: 120px; }
.soc-app .soc-list { grid-template-columns: 1fr 1fr; gap: 10px 22px; text-align: left; }
.soc-app .soc-item { font-size: 15px; }
.soc-app .soc-ico { width: 22px; height: 22px; }
.foot-tag { font-weight: 600; color: var(--gold); font-size: 14px; }
.d-thanks { font-family: var(--serif); font-style: italic; font-size: 14px; color: #B58D5C; margin-bottom: 2px; }
.d-legal-id { color: #9A8977; margin-top: 0; font-size: 10.5px; }

/* ═════════ Impression ═════════ */
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { position: static !important; left: 0 !important; width: 210mm !important; }
  .doc { min-height: 0 !important; width: 210mm !important; padding-bottom: 16px !important; }
  .d-frame { height: 285mm; }
  .doc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .d-table tr, .d-box, .d-pay, .d-legal, .d-opt, .d-sum, .d-foot { break-inside: avoid; }
}

/* ── Navigation rapide & buffet ── */
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--gold-dark); }
.card { scroll-margin-top: 120px; }
.sub-h { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--gold-dark); margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sec-total { font-family: var(--display); color: var(--gold-dark); font-size: 16px; }
.mb { margin-bottom: 10px; }

/* ── Mise à jour / numéro / formules ── */
.update-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: #FBF3E6; padding: 8px 12px 8px 16px; font-size: 14px; }
.update-bar button { background: var(--gold); color: #fff; font-weight: 600; padding: 8px 14px; border-radius: 10px; }
.num-edit { gap: 6px; font-weight: 600; color: var(--ink-2); }
.num-edit input { width: 76px !important; padding: 6px 8px !important; text-align: center; font-weight: 700; }
.formula { cursor: pointer; }
.formula-txt { flex: 1; min-width: 0; }
.formula-price { font-family: var(--display); color: var(--gold-dark); white-space: nowrap; font-size: 15px; }
.formula-edit-box { margin-top: 10px; padding: 12px; border: 1px solid #F0DFC3; background: #FFF8EC; border-radius: 14px; }

/* ── Synchronisation ── */
.sync-bar { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; }
.sync-bar.flat { background: #FFF8EC; margin-bottom: 10px; }
.sync-text { flex: 1; color: var(--ink-2); }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #BDB2A5; }
.sync-dot.green { background: #6FA77C; } .sync-dot.gold { background: var(--gold); } .sync-dot.orange { background: #D49A4A; } .sync-dot.red { background: #C4625D; }
.code-row { display: flex; gap: 8px; } .code-row input { flex: 1; }

.mig-note { display: block; font-style: italic; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.mig-x { width: 26px; height: 26px; border-radius: 8px; color: var(--danger); background: #F7E4E1; font-size: 16px; line-height: 1; }

/* mentions légales plus compactes pour que le pied de page tienne sur la 1re page */
.d-legal { font-size: 10.4px; line-height: 1.38; margin-bottom: 8px; }
.d-legal h4 { margin-bottom: 2px; }
.d-foot { padding-top: 5px; }
.d-thanks { font-size: 13px; margin-bottom: 0; }

/* ── Documents envoyés ── */
.warn-sent { margin-top: 6px; font-size: 12.5px; color: #8B6E30; background: #FFF4E0; border: 1px solid #E6C97A; border-radius: 10px; padding: 6px 10px; }
.docs-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.doc-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; }
.doc-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.doc-total { font-family: var(--display); color: var(--gold-dark); white-space: nowrap; }
.doc-row .btn-soft { padding: 7px 12px; }
.archive-note { background: #EEF5EF; color: #3D6B47; font-size: 13px; padding: 7px 16px; border-bottom: 1px solid #D6E6D9; }
.num-edit.locked { color: var(--gold-dark); }

/* ── Listes modifiables ── */
.list-ed { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.list-row { display: flex; gap: 6px; align-items: center; }
.list-row input { flex: 1; padding: 9px 12px !important; }
.lr-btn { width: 38px; height: 40px; border-radius: 10px; background: #F1E7D7; color: var(--gold-dark); font-size: 17px; flex-shrink: 0; }
.lr-btn.del { background: #F7E4E1; color: var(--danger); }
.lr-btn:disabled { opacity: .35; }
.mig-name-in { width: 100%; padding: 6px 8px !important; font-size: 14px !important; font-weight: 500; border-color: transparent !important; background: #FFFBF3 !important; }
.mig-name-in:focus { border-color: var(--gold) !important; background: #fff !important; }
.mig-group .add-row { margin-top: 6px; }

/* noms longs : sur plusieurs lignes, tableau des mignardises en 2 lignes */
.autotext { width: 100%; resize: none; overflow: hidden; line-height: 1.35; padding: 9px 12px !important; font-size: 15px !important; min-height: 40px; display: block; }
.list-row { align-items: flex-start; }
.mig-row { grid-template-columns: 64px 84px 1fr 30px !important; row-gap: 4px; padding: 8px 0 !important; border-bottom: 1px dotted var(--line); }
.mig-row .mig-name { grid-column: 1 / -1; }
.mig-row.head { border-bottom: none; padding-bottom: 0 !important; }
.mig-row.head span:first-child { display: none; }
.mig-row .mig-total { text-align: right; }
.mig-name-in { padding: 7px 10px !important; font-weight: 500; border-color: transparent !important; background: #FFFBF3 !important; }
