/* GestVente — feuille de style */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1d2330;
  --text-2: #5a6372;
  --muted: #8a93a3;
  --accent: #1f5fbf;
  --accent-dark: #174a96;
  --accent-soft: #e8f0fc;
  --side: #16202f;
  --side-text: #b9c2d0;
  --green: #1e7a46;  --green-bg: #e3f4ea;
  --orange: #a65b00; --orange-bg: #fdf0dc;
  --red: #b42318;    --red-bg: #fde8e6;
  --blue: #1f5fbf;   --blue-bg: #e8f0fc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 1.05rem; margin-bottom: .8rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .9em; }
.t-pos { color: var(--green); }
.t-neg { color: var(--red); }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex: none; }
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem; flex: none; }
.brand-name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav { padding: .6rem .5rem; flex: 1; overflow-y: auto; }
.sidebar a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 7px; color: var(--side-text); margin-bottom: 2px; }
.sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar a.active { background: var(--accent); color: #fff; }
.sidebar a small { display: block; color: var(--muted); font-size: .75rem; }
.side-foot { padding: .5rem; border-top: 1px solid rgba(255,255,255,.07); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 1.2rem; flex: 1; }
.today { color: var(--muted); font-size: .9rem; }
.burger { display: none; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font-size: 1.1rem; padding: .2rem .55rem; cursor: pointer; }
.content { padding: 1.4rem 1.5rem 2.5rem; max-width: 1400px; width: 100%; }

/* ---------- Cartes et grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; min-width: 0; }
.card.narrow { max-width: 640px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.2rem; }
.grid-wide-left { grid-template-columns: 1.6fr 1fr; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.kpis-2 { grid-template-columns: repeat(2, 1fr); }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .15rem; color: var(--text); }
.kpi span { color: var(--text-2); font-size: .85rem; }
.kpi strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kpi strong.sm { font-size: 1.05rem; }
.kpi small { color: var(--muted); }
.kpi-link:hover { text-decoration: none; border-color: var(--accent); }
.kpi-warn { border-left: 4px solid #e0912a; }
.kpi-danger { border-left: 4px solid var(--red); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; padding: .55rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .6rem; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.table tbody tr:hover { background: #fafbfc; }
.table.compact td, .table.compact th { padding: .45rem .5rem; }
.table tr.inactive td { opacity: .55; }
.r, .table th.r { text-align: right; } .c, .table th.c { text-align: center; }
td.actions { white-space: nowrap; text-align: right; }
td.empty, p.empty { color: var(--muted); text-align: center; padding: 1.4rem .5rem; }
.matrix .yes { color: var(--green); font-weight: 700; }
.matrix .no { color: #c6cbd3; }
.row-actions td { border-bottom: 0; padding-top: .9rem; }

.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }

.pager { display: flex; gap: .3rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 32px; padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 6px; text-align: center; }
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: .85rem; }
.form label, label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; color: var(--text-2); font-weight: 500; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row-3 { grid-template-columns: 1fr 1fr 2fr; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.lines-table input, .lines-table select { padding: .4rem .5rem; }
.lines-table tfoot td { border-bottom: 0; padding-top: .7rem; }
input, select, textarea { font: inherit; color: var(--text); padding: .55rem .7rem; border: 1px solid #cfd4db; border-radius: 7px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input:disabled { background: #f3f4f6; }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); font-weight: 400; }
label.check input, .inline-lbl input[type=checkbox] { width: auto; }
.inline-lbl { flex-direction: row; align-items: center; gap: .4rem; white-space: nowrap; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; }
.filters input[name=s] { min-width: 220px; }
.form-actions { display: flex; gap: .6rem; margin-top: .3rem; }
fieldset.perms { border: 1px solid var(--border); border-radius: 8px; padding: .6rem 1rem .8rem; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem 1rem; }
fieldset.perms legend { padding: 0 .4rem; font-weight: 600; color: var(--text-2); font-size: .88rem; }
.segmented { display: flex; border: 1px solid #cfd4db; border-radius: 8px; overflow: hidden; }
.segmented label { flex: 1; flex-direction: row; justify-content: center; align-items: center; gap: .4rem; padding: .5rem; cursor: pointer; border-right: 1px solid #cfd4db; color: var(--text); }
.segmented label:last-child { border-right: 0; }
.segmented label:has(input:checked) { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.segmented input { width: auto; }
form.inline { display: inline; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 500; padding: .5rem .95rem; border-radius: 7px; border: 1px solid #cfd4db; background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f5f6f8; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #9db5dc; border-color: #9db5dc; cursor: not-allowed; }
.btn-dark { background: var(--side); color: #fff; border-color: var(--side); }
.btn-dark:hover { background: #26324a; }
.btn-danger { color: var(--red); border-color: #f1c4bf; }
.btn-danger:hover { background: var(--red-bg); }
.btn-ghost { color: var(--text-2); }
.btn-sm { padding: .28rem .6rem; font-size: .82rem; }
.btn-lg { padding: .75rem 1.3rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-x { border: 0; background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: .1rem .35rem; border-radius: 5px; }
.btn-x:hover { color: var(--red); background: var(--red-bg); }

/* ---------- Alertes ---------- */
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #bfe6cf; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #f6c7c1; }

/* ---------- Connexion ---------- */
.content-public { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #16202f 0%, #1f3352 100%); }
.login-box { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-brand { text-align: center; margin-bottom: 1.4rem; }
.login-brand .logo { width: 52px; height: 52px; font-size: 1.2rem; border-radius: 12px; margin-bottom: .6rem; }
.login-brand h1 { font-size: 1.3rem; }
.login-brand p { margin: .2rem 0 0; color: var(--muted); }

/* ---------- Caisse ---------- */
.pos { display: grid; grid-template-columns: 1fr 440px; gap: 1.2rem; align-items: start; }
.pos-search { min-height: 70vh; }
.search-box input { font-size: 1.05rem; padding: .75rem 1rem; }
.pos-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .7rem; margin-top: 1rem; }
.pos-item { text-align: left; font: inherit; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: .7rem .75rem; cursor: pointer; display: flex; flex-direction: column; gap: .25rem; min-height: 98px; }
.pos-item:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pos-item.out { opacity: .5; cursor: not-allowed; }
.pi-name { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.pi-code { color: var(--muted); font-size: .78rem; font-family: Consolas, monospace; }
.pi-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; }
.pi-foot strong { color: var(--accent-dark); }
.pi-stock { font-size: .75rem; color: var(--muted); }
.pos-cart { position: sticky; top: 80px; }
.cart-table td { vertical-align: middle; }
.cart-name { font-weight: 500; font-size: .9rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid #cfd4db; border-radius: 7px; overflow: hidden; }
.qty button { border: 0; background: #f3f4f6; width: 26px; height: 30px; cursor: pointer; font-size: 1rem; }
.qty input { width: 42px; border: 0; border-radius: 0; text-align: center; padding: .2rem; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.totals { border-top: 1px solid var(--border); margin: .6rem 0 1rem; padding-top: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.totals > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.totals input { width: 140px; text-align: right; }
.totals .grand { font-size: 1.25rem; padding-top: .4rem; border-top: 1px dashed var(--border); }
.totals .grand strong { color: var(--accent-dark); }
.pos-cart .form-actions { margin-top: 1rem; }
.pos-cart #pos-valider { flex: 1; }
.pos-cart label { margin-bottom: .7rem; }
.pay-info { min-height: 1.2rem; font-size: .9rem; font-weight: 500; }
.pay-info.ok { color: var(--green); }
.pay-info.warn { color: var(--red); }
.pay-info.credit { color: var(--orange); }

/* ---------- Graphiques ---------- */
.month-nav { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; }
.chart { position: relative; padding-left: 0; }
.chart-max { position: absolute; top: -4px; left: 0; font-size: .75rem; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 220px; padding-top: 18px; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), #f0f2f5 calc(25% - 1px) 25%); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; outline: none; }
.bar { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; transition: background .15s; }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--accent-dark); }
.bar-col.today .bar { background: #3b7be0; }
.bar-lbl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .72rem; color: var(--muted); }
.chart { margin-bottom: 1.6rem; }
.tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--side); color: #fff; padding: .4rem .6rem; border-radius: 6px; font-size: .8rem; white-space: nowrap; z-index: 3; pointer-events: none; }
.bar-col:hover .tip, .bar-col:focus .tip { display: block; bottom: auto; top: 0; }
.hbar { margin-bottom: .75rem; }
.hbar-top { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .25rem; }
.hbar-track { height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- Facture ---------- */
.invoice { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin: 0 auto; position: relative; overflow: hidden; }
.invoice.a4 { max-width: 800px; padding: 2.2rem 2.4rem; }
.invoice.ticket { max-width: 320px; padding: 1rem; font-size: .85rem; font-family: Consolas, "Courier New", monospace; }
.inv-head { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--text); margin-bottom: 1rem; }
.inv-shop h2 { font-size: 1.35rem; margin-bottom: .2rem; }
.inv-meta { text-align: right; }
.inv-meta h3 { font-size: 1.05rem; letter-spacing: .08em; margin-bottom: .3rem; }
.inv-client { margin-bottom: 1rem; padding: .7rem .9rem; background: #f6f7f9; border-radius: 6px; }
.inv-lines, .inv-totals { width: 100%; border-collapse: collapse; }

.inv-lines th { text-align: left; border-bottom: 1px solid var(--text); padding: .45rem .3rem; font-size: .85rem; }
.inv-lines td { padding: .45rem .3rem; border-bottom: 1px solid #eceef1; }
.inv-totals { width: 55%; margin: 1rem 0 0 auto; }
.inv-totals td { padding: .3rem; }
.inv-totals .grand td { font-size: 1.15rem; font-weight: 700; border-top: 2px solid var(--text); padding-top: .5rem; }
.inv-totals .due td { color: var(--red); font-weight: 700; }
.inv-foot { text-align: center; margin-top: 2rem; color: var(--text-2); font-style: italic; }
.inv-note { color: var(--red); }
.invoice.ticket .inv-head { flex-direction: column; text-align: center; border-bottom: 1px dashed var(--text); }
.invoice.ticket .inv-meta { text-align: center; }
.invoice.ticket .inv-shop h2 { font-size: 1.1rem; }
.invoice.ticket .inv-totals { width: 100%; }
.invoice.ticket .inv-client { background: none; padding: 0; }
.stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 4rem; font-weight: 800; color: rgba(180, 35, 24, .18); border: 6px solid rgba(180, 35, 24, .18); padding: .2rem 1.2rem; border-radius: 12px; pointer-events: none; }

.danger-zone { border-color: #f1c4bf; }
.danger-zone h2 { color: var(--red); }
.danger-zone .btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.danger-zone .btn-danger:hover { background: #8f1c13; }

.avoirs-lies { margin-top: 1rem; padding: .6rem .8rem; background: var(--orange-bg); border-radius: 6px; font-size: .88rem; }

/* ---------- Journal des ventes ---------- */
.invoice.journal { max-width: 1000px; }
.journal-recap { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.journal-recap > div { border: 1px solid var(--border); border-radius: 6px; padding: .5rem .7rem; display: flex; flex-direction: column; }
.journal-recap span { font-size: .78rem; color: var(--text-2); }
.journal-recap strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.journal-titre { margin: 1.3rem 0 .4rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.journal-table { font-size: .86rem; font-variant-numeric: tabular-nums; }
.journal-table tr.jour td { background: #f1f3f6; font-weight: 600; font-size: .82rem; }
.journal-table tr.detail td { border-bottom: 0; padding-top: 0; color: var(--text-2); font-size: .8rem; }
.journal-table tr.total td { font-weight: 700; border-top: 2px solid var(--text); }
.journal-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1.5rem; }
.journal-kv { width: 100%; margin: 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.journal-kv td { padding: .3rem .2rem; border-bottom: 1px solid #eceef1; }
.journal-kv tr.b td { font-weight: 700; border-top: 2px solid var(--text); }
.journal-kv tr.th td { font-size: .75rem; color: var(--text-2); text-transform: uppercase; }
.journal-kv td.ind { padding-left: 1rem; color: var(--text-2); }
.journal-table td.r, .journal-table td.mono, .journal-table td:first-child { white-space: nowrap; }
@media print {
  .journal-table a { color: inherit; text-decoration: none; }
  .invoice.journal { font-size: 10px; padding: 0; }
  .invoice.journal .journal-table { font-size: 9.5px; }
  .invoice.journal .journal-table th, .invoice.journal .journal-table td { padding: .25rem .25rem; }
  .invoice.journal .journal-recap { grid-template-columns: repeat(4, 1fr) !important; }
  .invoice.journal .journal-cols, .invoice.journal .signatures { grid-template-columns: 1fr 1fr !important; }
  .invoice.journal .inv-head { flex-direction: row !important; }
  .invoice.journal .journal-kv { font-size: 9.5px; }
  .invoice.journal .signatures > div { min-height: 90px; }
  .journal-table tr, .journal-kv tr { page-break-inside: avoid; }
}

/* ---------- Bien / Service ---------- */
.only-service, .lbl-service { display: none; }
#type-article { margin-bottom: .2rem; }

/* ---------- Prix modifiable en caisse ---------- */
.prix-ligne-zone { display: flex; align-items: center; gap: .2rem; margin-top: .2rem; }
.prix-ligne { width: 105px; padding: .2rem .4rem; font-size: .85rem; text-align: right; }
.prix-modifie { display: block; color: var(--orange); font-size: .76rem; }
.prix-perte { display: block; color: var(--red); font-size: .76rem; font-weight: 600; }
button.lien { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* ---------- Lots ---------- */
.span-2 { grid-column: 1 / -1; }
.cmd-equiv { display: block; color: var(--muted); font-size: .78rem; }
.lot-tag { display: inline-block; font-size: .75rem; color: var(--accent-dark); background: var(--accent-soft); border-radius: 4px; padding: 0 .35rem; margin-left: .3rem; }

/* ---------- Livraisons ---------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs a { padding: .6rem 1rem; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: 0 .5rem; font-size: .8rem; margin-left: .3rem; }
.bl-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.signatures > div { border: 1px solid #9aa3b1; border-radius: 6px; padding: .7rem .9rem; min-height: 130px; display: flex; flex-direction: column; gap: .55rem; }
.signatures span { color: var(--text-2); font-size: .9rem; }
.deliver-check { margin: .2rem 0 .3rem; padding: .55rem .7rem; background: #f6f7f9; border-radius: 7px; }
.badge + .badge { margin-left: .25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: static; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -250px; z-index: 20; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .burger { display: block; }
  .grid-2, .grid-3, .grid-wide-left, .kpis-2, .kpis-3, .row, .row-3, .bl-parties, .journal-cols, fieldset.perms { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .filters input[name=s] { min-width: 0; flex: 1; }
  .inv-totals { width: 100%; }
  .journal-recap { grid-template-columns: 1fr 1fr; }
}

/* ---------- Impression ---------- */
@media print {
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .invoice { border: 0; border-radius: 0; max-width: none; }
  .invoice.ticket { width: 76mm; max-width: 76mm; margin: 0; padding: 0; }
  @page { margin: 12mm; }
}
.inv-lines th.r { text-align: right; }

/* ---- Personnalisation des documents ---- */
.invoice { --doc-accent: #1d2330; }
.invoice .inv-head { border-bottom-color: var(--doc-accent); }
.invoice .inv-shop h2, .invoice .inv-meta h3 { color: var(--doc-accent); }
.invoice .inv-lines th { border-bottom-color: var(--doc-accent); color: var(--doc-accent); }
.invoice .inv-totals .grand td { border-top-color: var(--doc-accent); }
.invoice.a4 .inv-client { border-left: 3px solid var(--doc-accent); }
.inv-logo { display: block; max-height: 70px; max-width: 200px; object-fit: contain; margin-bottom: .45rem; }
.invoice.ticket .inv-logo { margin: 0 auto .4rem; max-height: 55px; max-width: 160px; filter: grayscale(1); }
.inv-legal { font-size: .8rem; color: var(--text-2); margin-top: .15rem; }
.inv-cond { margin-top: .8rem; font-size: .88rem; }
.inv-cond + .inv-cond { margin-top: .25rem; }
.inv-mentions { text-align: center; font-size: .75rem; color: var(--text-2); margin-top: .6rem; border-top: 1px solid #eceef1; padding-top: .5rem; }
.invoice.ticket .inv-cond { font-size: .78rem; }
.logo-preview { display: flex; align-items: center; gap: 1rem; padding: .6rem; border: 1px dashed var(--border); border-radius: 6px; background: #fafbfc; }
.logo-preview img { max-height: 60px; max-width: 180px; object-fit: contain; }
@media print {
  .invoice .inv-shop h2, .invoice .inv-meta h3, .invoice .inv-lines th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.inv-client-nom { font-weight: 600; }
.kpi strong.sm ~ small { display: block; }
