/* LCT Boutique — © LeCodeTech */
:root {
  --bic: #1F3BD1; --bic-d: #1730B0; --bic-soft: #E8ECFD; --ink: #141A3A; --ink2: #454C73; --line: #CDD5F0; --line2: #E6EAF7;
  --paper: #F6F7FB; --card: #FFFFFF; --red: #C42E41; --red-soft: #FBE3E6; --yellow: #FFE34F; --yellow-soft: #FFF6C9;
  --green: #1E7B45; --green-soft: #DDF2E6; --r: 14px; --r-s: 10px;
  --f: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.45 var(--f); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bic); }
.ic { width: 22px; height: 22px; flex: none; }
.num, .amount, td.n, .tk-lines td:not(:first-child) { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); }
.small { font-size: .88rem; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--bic); outline-offset: 2px; }

/* Écrans d'accueil (activation, code, erreur) */
.boot, .gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.gate__in { width: 100%; max-width: 440px; display: grid; gap: 18px; }
.gate__logo { width: 220px; height: auto; }
.gate h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.gate p { margin: 0; }
.gate .card { padding: 20px; }
.devcode { font-size: .85rem; color: var(--ink2); }
.devcode b { letter-spacing: .06em; color: var(--ink); }

/* Barre du haut */
.top { position: sticky; top: 0; z-index: 20; background: var(--bic); color: #fff; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.top__in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 40px; }
.top__sym { width: 46px; height: 28px; flex: none; }
.top__txt { min-width: 0; flex: 1; }
.top__txt b { display: block; font-size: 1.06rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__txt small { display: block; opacity: .82; font-size: .78rem; }
.top__btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.top__btn--back { background: transparent; margin-left: -8px; }
.top h1 { margin: 0; font-size: 1.15rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-bar { background: var(--yellow); color: var(--ink); font-size: .9rem; padding: 8px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center; }
.demo-bar a { color: var(--ink); font-weight: 700; }

/* Contenu */
main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 96px + var(--safe-b)); display: grid; gap: 14px; }
main.no-nav { padding-bottom: calc(40px + var(--safe-b)); }
h2 { margin: 0 0 10px; font-size: 1.05rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card--big { background: var(--bic); color: #fff; border-color: var(--bic); }
.card--big .label { opacity: .85; }
.card--big .amount { display: block; font-size: 2.3rem; font-weight: 800; line-height: 1.1; margin: 4px 0; letter-spacing: -.5px; }
.hello { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hello h1 { margin: 0; font-size: 1.4rem; text-transform: none; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.rows li, .row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.rows li:last-child { border-bottom: 0; }
.row--strong { font-weight: 800; font-size: 1.05rem; border-bottom: 0; padding-top: 12px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--paper); border-radius: var(--r-s); padding: 12px; min-width: 0; }
.kpi span { display: block; font-size: .82rem; color: var(--ink2); }
.kpi b { display: block; font-size: 1.15rem; margin-top: 2px; overflow-wrap: anywhere; }
.kpi--pos b { color: var(--green); } .kpi--neg b { color: var(--red); }
.alert { display: flex; gap: 10px; align-items: center; padding: 13px 14px; border-radius: var(--r-s); background: var(--bic-soft); color: var(--ink); text-decoration: none; font-weight: 600; }
.alert--warn { background: var(--yellow-soft); } .alert--bad { background: var(--red-soft); color: #7A1726; } .alert--ok { background: var(--green-soft); color: #14532D; }
.alert .ic { color: currentColor; }
.alert span { flex: 1; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; }
.btn--main { background: var(--bic); border-color: var(--bic); color: #fff; }
.btn--main:active { background: var(--bic-d); }
.btn--light { background: #fff; color: var(--bic); border-color: #fff; }
.btn--wa { background: #1E8E4E; border-color: #1E8E4E; color: #fff; }
.btn--danger { color: var(--red); border-color: #F0B8C0; }
.btn--dangerfill { background: var(--red); border-color: var(--red); color: #fff; }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 40px; padding: 7px 14px; font-size: .92rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btns .btn { flex: 1 1 auto; }
.link { background: none; border: 0; padding: 0; color: var(--bic); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Formulaires */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .lab { font-weight: 700; font-size: .95rem; }
.field small { color: var(--ink2); font-size: .85rem; }
.in, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.05rem;
}
.field textarea { min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus, .in:focus { border-color: var(--bic); outline: none; box-shadow: 0 0 0 3px var(--bic-soft); }
.field--row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; display: grid; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.err { color: var(--red); font-weight: 600; margin: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; }
a.chip { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.modes .chip { border-radius: 12px; white-space: normal; text-align: center; line-height: 1.15; min-height: 50px; padding: 6px; }
.modes .chip[aria-pressed="true"] { background: var(--bic); border-color: var(--bic); }
.search { position: relative; }
.search .ic { position: absolute; left: 13px; top: 14px; color: var(--ink2); pointer-events: none; }
.search input { padding-left: 44px !important; }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer; min-width: 0; }
.li__main { flex: 1; min-width: 0; }
.li__main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li__main small { display: block; color: var(--ink2); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li__side { text-align: right; flex: none; }
.li__side b { display: block; }
.li--off { opacity: .55; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--green-soft); color: #14532D; white-space: nowrap; }
.badge--bas { background: var(--yellow-soft); color: #6B4E00; } .badge--rupture, .badge--bad { background: var(--red-soft); color: #7A1726; } .badge--muted { background: var(--line2); color: var(--ink2); }
.group-title { margin: 8px 2px 0; font-size: .85rem; color: var(--ink2); font-weight: 700; }
.empty { text-align: center; padding: 28px 16px; display: grid; gap: 12px; justify-items: center; }
.empty p { margin: 0; color: var(--ink2); }

/* Vente */
.sell { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.tile { width: 100%; height: 100%; min-height: 92px; display: grid; align-content: space-between; gap: 6px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.tile:active { border-color: var(--bic); background: var(--bic-soft); }
.tile b { font-size: .98rem; line-height: 1.2; overflow-wrap: anywhere; }
.tile__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 6px; }
.tile__price { font-weight: 800; color: var(--bic); white-space: nowrap; }
.tile.in-cart { border-color: var(--bic); box-shadow: inset 0 0 0 1px var(--bic); }
.tile__qty { position: absolute; }
.cartbar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 15; padding: 10px 16px; }
.cartbar a { max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; text-decoration: none; box-shadow: 0 8px 24px rgba(20,26,58,.25); }
.cartbar b { font-size: 1.1rem; }
.cartbar span.go { background: var(--yellow); color: var(--ink); font-weight: 800; padding: 8px 14px; border-radius: 10px; }
.cline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.cline:last-child { border-bottom: 0; }
.cline__name b { display: block; }
.cline__price { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink2); }
.cline__price input { width: 110px; min-height: 38px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; font-size: .95rem; }
.cline__total { text-align: right; font-weight: 800; align-self: center; }
.step { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.step button { width: 44px; height: 42px; border: 0; background: var(--paper); font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.step input { width: 58px; height: 42px; border: 0; text-align: center; font-weight: 800; font-size: 1.05rem; }
.change { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 12px; background: var(--green-soft); font-weight: 800; font-size: 1.15rem; }
.change--due { background: var(--red-soft); color: #7A1726; }
.tot { display: grid; gap: 4px; }
.tot div { display: flex; justify-content: space-between; }
.tot .big { font-size: 1.35rem; font-weight: 800; padding-top: 6px; border-top: 1px solid var(--line2); margin-top: 4px; }

/* Graphique */
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: #9AABF0; } .chart .bar--now { fill: var(--bic); }
.chart text { font: 600 9px var(--f); fill: var(--ink2); }
.top5 { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.top5 li { display: grid; gap: 4px; }
.top5 .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: .95rem; }
.top5 .lbl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top5 .track { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.top5 .fill { height: 100%; border-radius: 4px; background: var(--bic); }

/* Détails */
.big-num { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--ink2); } .dl dd { margin: 0; text-align: right; font-weight: 700; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: .95rem; }
.hist li:last-child { border-bottom: 0; }
.plus { color: var(--green); font-weight: 800; } .minus { color: var(--red); font-weight: 800; }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daynav b { text-align: center; flex: 1; text-transform: capitalize; }
.daynav .btn { min-width: 48px; padding: 8px; }

/* Ticket et facture */
.tk { background: #fff; color: #000; font: 13px/1.35 "Courier New", Courier, monospace; padding: 14px; border: 1px dashed #B9C0DD; border-radius: 6px; max-width: 360px; margin: 0 auto; position: relative; overflow: hidden; }
.tk--a4 { max-width: 760px; font: 14px/1.45 var(--f); padding: 28px; border-style: solid; }
.tk-head { text-align: center; display: grid; gap: 1px; }
.tk--a4 .tk-head { text-align: left; }
.tk-shop { font-size: 1.15rem; font-weight: 800; }
.tk--a4 .tk-shop { font-size: 1.5rem; }
.tk-meta { margin: 10px 0; padding: 8px 0; border-top: 1px dashed #999; border-bottom: 1px dashed #999; display: grid; gap: 1px; }
.tk--a4 .tk-meta { border: 0; padding: 0; margin: 18px 0; }
.tk--a4 .tk-title { font-size: 1.7rem; font-weight: 800; color: var(--bic); }
.tk-lines { width: 100%; border-collapse: collapse; }
.tk-lines th { text-align: left; font-size: .8em; border-bottom: 1px solid #000; padding: 3px 2px; }
.tk-lines td { padding: 3px 2px; vertical-align: top; }
.tk-lines th:not(:first-child), .tk-lines td:not(:first-child) { text-align: right; white-space: nowrap; }
.tk--a4 .tk-lines th { background: var(--bic); color: #fff; border: 0; padding: 7px 8px; }
.tk--a4 .tk-lines td { padding: 7px 8px; border-bottom: 1px solid #DDE2F2; }
.tk-tot { margin-top: 8px; border-top: 1px dashed #999; padding-top: 6px; display: grid; gap: 1px; }
.tk--a4 .tk-tot { margin-left: auto; width: 60%; border-top: 0; }
.tk-tot div { display: flex; justify-content: space-between; gap: 10px; }
.tk-tot .tk-big { font-size: 1.15em; font-weight: 800; }
.tk-foot { text-align: center; margin: 12px 0 0; }
.tk-sign { margin-top: 10px; padding-top: 6px; border-top: 1px dashed #999; text-align: center; font-size: 10px; line-height: 1.3; color: #333; }
.tk--a4 .tk-sign { text-align: left; display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 11px; }
.tk-sign img { height: 18px; width: auto; }
.tk-stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); border: 3px solid #C42E41; color: #C42E41; font: 900 1.6rem/1 var(--f); padding: 6px 14px; border-radius: 8px; opacity: .75; pointer-events: none; white-space: nowrap; }
.tk-demo { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: rgba(31,59,209,.12); font: 900 3rem/1 var(--f); transform: rotate(-25deg); }
#print { display: none; }

/* Barre du bas */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav__in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--nav-h); }
.nav a { display: grid; place-items: center; align-content: center; gap: 2px; color: var(--ink2); text-decoration: none; font-size: .74rem; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--bic); }
.nav a.nav__sell { color: #fff; }
.nav a.nav__sell span.dot { display: grid; place-items: center; width: 50px; height: 34px; border-radius: 12px; background: var(--bic); }
.nav a.nav__sell .lbl { color: var(--bic); }

/* Dialogues */
.dlg-back { position: fixed; inset: 0; z-index: 60; background: rgba(20, 26, 58, .5); display: grid; align-items: end; padding: 16px; padding-bottom: calc(16px + var(--safe-b)); }
.dlg { background: var(--card); border-radius: 18px; padding: 20px; width: 100%; max-width: 440px; margin: 0 auto; display: grid; gap: 14px; box-shadow: 0 18px 40px rgba(20, 26, 58, .3); }
.dlg h2 { margin: 0; font-size: 1.15rem; }
@media (min-width: 560px) { .dlg-back { align-items: center; } }

/* Signature */
.sign { display: grid; justify-items: center; gap: 6px; padding: 18px 0 6px; text-align: center; font-size: .82rem; color: var(--ink2); }
.sign img { width: 150px; height: auto; }

/* Message flottant */
.toast { position: fixed; left: 50%; top: calc(72px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(20,26,58,.3); animation: tin .2s ease-out; }
.toast--bad { background: var(--red); }
@keyframes tin { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

@media (min-width: 560px) {
  .sell { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .modes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media print {
  @page { margin: 8mm; }
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; }
  #print .tk { border: 0; max-width: none; padding: 0; }
  #print .tk--ticket { width: 72mm; margin: 0; font-size: 11px; }
}

/* ---------- LCT Quincaillerie : liste de vente, gros, artisans ---------- */
.slist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; padding: 10px 10px 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.sline.in-cart { border-color: var(--bic); box-shadow: inset 0 0 0 1px var(--bic); }
.sline__main { display: grid; gap: 3px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; font: inherit; color: inherit; }
.sline__main b { font-size: .98rem; line-height: 1.2; overflow-wrap: anywhere; }
.sline__main small { color: var(--ink2); font-size: .8rem; line-height: 1.3; }
.sline__side { display: grid; gap: 6px; justify-items: end; }
.sline__btns { grid-column: 1 / -1; display: flex; gap: 8px; }
.sline__btns button { flex: 1; min-height: 40px; border-radius: 10px; border: 1.5px solid var(--bic); background: #fff; color: var(--bic); font-weight: 800; font-size: .9rem; cursor: pointer; }
.sline__btns button.pk { background: var(--bic); color: #fff; }
.sline__btns button:active { transform: scale(.98); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: var(--bic-soft); color: var(--bic); vertical-align: middle; }
.pill--late { background: var(--red-soft); color: #7A1726; }
.cinfo { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bic-soft); font-size: .88rem; line-height: 1.4; }
.cinfo.bad { background: var(--red-soft); color: #7A1726; }
textarea.csv { min-height: 160px; font-family: ui-monospace, monospace; font-size: .8rem; }
.tk-valid { font-size: .8rem; }
