/* styles for area tickets */
.tk-today{display:flex;flex-direction:column;gap:12px}
.tk-kpi{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-top:6px}
.tk-kpi b{font-size:30px;font-weight:700;letter-spacing:-.05em;line-height:1.1;white-space:nowrap}
.tk-kpi b small{font-size:20px;letter-spacing:0;color:var(--muted);font-weight:700}
.tk-read{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin:12px 0 2px;padding:8px 12px;border-radius:12px;background:rgba(74,31,230,.06);font-size:13px}
.tk-read b{font-weight:750}
.tk-read span{font-weight:700;color:var(--accent)}
.tk-chart{width:100%;height:150px;margin-top:6px}
.tk-chart svg{display:block;overflow:visible}
.tk-grid{stroke:var(--line);stroke-dasharray:3 4}
.tk-base{stroke:rgb(var(--k) / .14)}
.tk-y{font:600 10.5px var(--mono);fill:var(--faint)}
.tk-x{font:700 11px var(--f);fill:var(--faint)}
.tk-x.td{fill:var(--ink)}
.tk-x.on{fill:var(--accent)}
.tk-b{fill:#C9BCFF;transform-box:fill-box;transform-origin:bottom;animation:tkGrow .7s var(--spring) both;transition:fill .25s}
.tk-b.on{fill:var(--accent)}
.nost .tk-b{animation:none}
.tk-b0{fill:rgb(var(--k) / .14)}
.tk-b0.has{fill:#C9BCFF}
.tk-hit{fill:transparent;cursor:pointer}
@keyframes tkGrow{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@media (prefers-reduced-motion:reduce){.tk-b{animation:none}}

.tk-seg button.on{background:var(--raised);box-shadow:0 6px 16px -8px rgba(40,30,120,.4)}
.tk-seg button{min-height:24px;padding:12px 6px}
.tk-cons .li{padding:9px 0}
.tk-q{font-weight:700;font-size:15px;white-space:nowrap}
.tk-cost b{white-space:nowrap;text-align:right}
.tk-cost{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:10px 12px;border-radius:14px;background:rgba(7,138,94,.08);font-size:13.5px;font-weight:700}
.tk-cost small{font-size:12px;color:var(--muted);font-weight:600}
.tk-hint{display:flex;gap:10px;align-items:flex-start;font-size:13px;color:var(--muted);font-weight:600;line-height:1.5}
.tk-hint .ico{color:var(--accent);margin-top:1px}
.tk-miss{display:flex;flex-direction:column;gap:6px}
.tk-pills{display:flex;flex-wrap:wrap;gap:6px}

.tk-top .tx b{font-size:14px}
.tk-bar{display:block;height:5px;border-radius:5px;background:rgba(74,31,230,.08);margin-top:6px;overflow:hidden}
.tk-bar i{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,#7A4DFF,#4A1FE6);animation:tkBar .8s var(--ease) both;transform-origin:left}
.nost .tk-bar i{animation:none}
@keyframes tkBar{from{transform:scaleX(0)}}

/* saisie */
.tk-dates{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.tk-dates .input{flex:1;min-width:150px;height:44px}
.tk-search{position:relative}
.tk-search .input{padding-left:44px;height:52px;font-size:16px}
.tk-sico{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--faint);display:flex}
.tk-sug:empty{display:none}
.tk-quick{display:flex;flex-wrap:wrap;gap:7px}
.tk-quick .chip{gap:6px;padding:9px 13px 9px 10px;color:var(--ink)}
.tk-quick .chip .ico{width:16px;height:16px;color:var(--accent)}
.tk-quick .chip:active{transform:scale(.94)}
.tk-ac{display:flex;flex-direction:column;border-radius:16px;background:var(--glass-hi);box-shadow:0 0 0 1px var(--line) inset;overflow:hidden;animation:rise .3s var(--ease) both}
.tk-opt{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:48px;padding:10px 14px;font-weight:700;font-size:14.5px;transition:background .15s}
.tk-opt+.tk-opt{border-top:1px solid var(--line)}
.tk-opt:hover,.tk-opt:focus-visible{background:rgba(74,31,230,.06)}
.tk-opt.new{justify-content:flex-start;color:var(--accent)}
.tk-opt span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-lines{display:flex;flex-direction:column}
.tk-line{display:flex;align-items:center;gap:10px;padding:10px 0;min-width:0}
.tk-line+.tk-line{border-top:1px solid var(--line)}
.tk-line .tx{flex:1;min-width:0}
.tk-line .tx b{display:block;font-weight:750;font-size:15px;letter-spacing:-.015em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-line .tx em{display:block;font-style:normal;font-size:12px;color:var(--faint);font-weight:600;margin-top:1px}
.tk-ok{display:inline-flex;align-items:center;gap:3px;color:var(--ok)}
.tk-ok .ico{width:13px;height:13px}
.tk-step{display:flex;align-items:center;gap:4px;flex:none}
.tk-step .step{width:44px;height:44px;border-radius:15px}
.tk-step .step .ico{width:19px;height:19px}
.tk-step input{all:unset;box-sizing:border-box;width:54px;height:44px;text-align:center;font-size:19px;font-weight:700;border-radius:12px}
.tk-step input:focus{background:var(--glass-hi);box-shadow:0 0 0 2px rgba(74,31,230,.35)}
.tk-ca{position:relative}
.tk-ca .input{height:64px;font-size:30px;font-weight:700;padding-right:46px;letter-spacing:-.04em}
.tk-ca b{position:absolute;right:16px;top:50%;transform:translateY(-50%);font-size:22px;color:var(--faint)}
.tk-px{all:unset;cursor:pointer;position:absolute;top:4px;right:4px;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:rgb(var(--k) / .62);color:#fff}
.tk-px .ico{width:14px;height:14px}
.tk-px::before{content:"";position:absolute;inset:-9px}

/* fiche ticket */
.tk-sheetca{display:flex;justify-content:space-between;align-items:baseline;padding:12px 14px;border-radius:16px;background:rgba(74,31,230,.06)}
.tk-sheetca b{font-size:24px;letter-spacing:-.04em}
.tk-shots{display:flex;gap:8px;overflow-x:auto}
.tk-shots img{height:180px;border-radius:14px;flex:none}
.tk-cost.part{background:rgb(var(--k) / .05)}
.tk-cost span small{display:block;font-size:11.5px;color:var(--muted);font-weight:600}
.tk-edit .ctabar{margin-top:6px}

/* QA polish */
.tk-nw{white-space:nowrap}
.tk-today .btn.sm,.tk-dup .btn.sm{min-height:44px}
.tk-dup{align-items:center}
.tk-chart{position:relative}
.tk-chart-empty{margin:-122px 18px 26px;min-height:96px;display:grid;place-items:center;text-align:center;font-size:13px;font-weight:650;color:var(--muted);line-height:1.45;position:relative;pointer-events:none}
.tk-cam{display:grid;place-items:center;width:26px;height:26px;border-radius:9px;background:rgba(7,138,94,.1);color:var(--ok);flex:none}
.tk-cam .ico{width:15px;height:15px}
.tk-cal{display:flex;flex-direction:column;gap:8px}
.tk-undo{all:unset;cursor:pointer;margin-left:8px;padding:8px 4px;font-weight:800;color:#B9A6FF}
.tk-step .step:active{transform:scale(.86)}
.tk-step input.bump{animation:tkBump .35s var(--spring)}
@keyframes tkBump{40%{transform:scale(1.25);color:var(--accent)}}
.tk-step input.l3{font-size:17px}
.tk-step input.l4{font-size:15px}

/* keyboard: chart days and history rows */
.tk-hit:focus{outline:none}
.tk-hit:focus-visible{fill:rgba(74,31,230,.08);stroke:var(--accent);stroke-width:2;rx:8px}
.li.tap[data-act=ticket]:focus-visible{outline:2.5px solid var(--accent);outline-offset:2px;border-radius:14px}

/* saisie: the save bar sits on a frosted backing so it never reads over the text below */
.tk-ed-grid,.tk-ed-l,.tk-ed-r{display:contents}
.tk-edit .ctabar{padding:8px;border-radius:26px;background:rgb(var(--w) / .66);-webkit-backdrop-filter:blur(20px) saturate(1.8);backdrop-filter:blur(20px) saturate(1.8);border:1px solid var(--edge);filter:none;box-shadow:0 18px 40px -16px rgba(40,30,120,.35)}
.tk-edit .ctabar .btn{height:54px}
@media (min-width:960px){
  .inner.narrow.tk-edit{max-width:1080px}
  .tk-ed-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:14px;align-items:start}
  .tk-ed-l,.tk-ed-r{display:flex;flex-direction:column;gap:14px;min-width:0}
  /* desktop: the save button lives right under the total, always in reach, never floating over content */
  .tk-ed-r{position:sticky;top:14px}
  .tk-ed-r > :nth-child(1){order:1}
  .tk-ed-r > .ctabar{order:2;position:static;margin:0;padding:0;background:none;border:0;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
  .tk-ed-r > :nth-child(n+2):not(.ctabar){order:3}
}

/* ───────── V3 : parties, saisie rapide, couverts/TVA, ventes → stock ───────── */
.tk-today-b{display:flex;gap:8px;flex-wrap:wrap}
.tk-today-b .btn.sm{min-height:44px}
.tk-tip{display:flex;gap:9px;align-items:flex-start;font-size:12.5px;font-weight:650;color:var(--muted);line-height:1.45}
.tk-tip .ico{width:17px;height:17px;color:var(--accent);flex:none;margin-top:1px}
.tk-kpis{display:flex;gap:16px;flex-wrap:wrap;margin-top:4px;font-size:13px;font-weight:650;color:var(--muted)}
.tk-kpis b{color:var(--ink);font-weight:750}

/* parties du ticket */
.tk-parts{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;margin:0 -4px;padding:2px 4px 4px;scroll-snap-type:x proximity}
.tk-parts::-webkit-scrollbar{display:none}
.tk-part{all:unset;box-sizing:border-box;cursor:pointer;flex:none;scroll-snap-align:start;min-height:52px;min-width:92px;padding:8px 13px;border-radius:16px;background:var(--glass);border:1px solid var(--edge);display:flex;flex-direction:column;justify-content:center;gap:1px;transition:transform .2s var(--spring),background .2s,color .2s}
.tk-part b{font-size:13.5px;font-weight:800;letter-spacing:-.01em;white-space:nowrap}
.tk-part em{font-style:normal;font-size:11.5px;font-weight:650;color:var(--faint);display:flex;align-items:center;gap:3px;white-space:nowrap}
.tk-part em .ico{width:12px;height:12px}
.tk-part.on{background:var(--ink-bg);color:var(--on-ink);border-color:var(--ink-bg);box-shadow:0 10px 22px -12px rgb(var(--sk) / .6)}
.tk-part.on em{color:rgba(255,255,255,.7)}
.tk-part.all{border-style:dashed;border-color:rgba(74,31,230,.3)}
.tk-part.all.on{border-style:solid}
.tk-part.add{min-width:52px;align-items:center;color:var(--accent);background:rgba(74,31,230,.08);border-color:transparent}
.tk-part:active{transform:scale(.94)}
.tk-part:focus-visible{outline:2.5px solid var(--accent);outline-offset:2px}
.tk-ptools{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.tk-ptools .btn.sm{min-height:44px;padding-left:12px;padding-right:12px}
.tk-ptools .btn[disabled]{opacity:.35}
.tk-pdel{color:var(--bad)}
.tk-addpart{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:12px;padding:12px 14px;min-height:60px;border-radius:18px;border:1.5px dashed rgba(74,31,230,.25);color:var(--accent);transition:background .2s,transform .2s var(--spring)}
.tk-addpart > span{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.tk-addpart b{font-size:14px;font-weight:800;color:var(--ink)}
.tk-addpart em{font-style:normal;font-size:12px;font-weight:600;color:var(--muted)}
.tk-addpart .ico{flex:none}
.tk-addpart:hover{background:rgba(74,31,230,.05)}
.tk-addpart:active{transform:scale(.98)}
.tk-dupnote{display:flex;gap:9px;align-items:flex-start;padding:10px 12px;border-radius:14px;background:rgba(184,108,0,.1);color:var(--warn);font-size:13px;font-weight:650;line-height:1.4;animation:rise .35s var(--ease) both}
.tk-dupnote .ico{width:18px;height:18px;flex:none;margin-top:1px}
.tk-dupnote b{font-weight:800}
.tk-line{flex-wrap:wrap}
.tk-line.dup .tx b{text-decoration:line-through;text-decoration-color:rgba(184,108,0,.6);color:var(--muted)}
.tk-line.dup .tk-step{opacity:.55}
.tk-dupf{flex-basis:100%;display:flex;align-items:center;gap:8px;padding:6px 6px 6px 10px;border-radius:12px;background:rgba(184,108,0,.09);color:var(--warn);font-size:12.5px;font-weight:700;animation:rise .3s var(--ease) both}
.tk-dupf .ico{width:15px;height:15px;flex:none}
.tk-dupf span{flex:1;min-width:0}
.tk-dupf button{all:unset;cursor:pointer;min-height:36px;padding:0 12px;border-radius:10px;background:var(--solid);color:var(--ink);font-weight:800;font-size:12.5px;white-space:nowrap;box-shadow:0 0 0 1px var(--line) inset}
.tk-dupf.kept{background:rgba(74,31,230,.07);color:var(--accent)}
.tk-line.tap{cursor:pointer;border-radius:12px}
.tk-pb{display:inline-block;font-size:10.5px;font-weight:800;padding:1px 6px;border-radius:6px;background:rgba(74,31,230,.1);color:var(--accent);margin-right:4px}
.tk-line .tx[data-act]{cursor:pointer}
.tk-step input[readonly]{cursor:pointer;background:rgba(74,31,230,.06)}

/* CA, couverts, TVA */
.tk-fin{display:flex;flex-direction:column;gap:12px}
.tk-covrow{display:flex;align-items:center;gap:10px;padding-top:12px;border-top:1px solid var(--line)}
.tk-covl{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.tk-avg{font-size:12.5px;font-weight:650;color:var(--muted)}
.tk-avg b{color:var(--ink);font-weight:750}
.tk-vatt{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:10px;min-height:48px;padding:0 12px;border-radius:14px;background:rgb(var(--k) / .04);font-size:13.5px;font-weight:750;transition:background .2s}
.tk-vatt:hover{background:rgb(var(--k) / .07)}
.tk-vatt:focus-visible{outline:2.5px solid var(--accent)}
.tk-vtl{flex:1;min-width:0}
.tk-vtl em{font-style:normal;color:var(--faint);font-weight:650;margin-left:4px;font-size:12px}
.tk-vsum{font-size:12.5px;font-weight:650;color:var(--muted);white-space:nowrap}
.tk-vsum b{color:var(--ink)}
.tk-vatt > .ico{width:18px;height:18px;transition:transform .3s var(--spring);color:var(--faint)}
.tk-vatt.on > .ico{transform:rotate(180deg)}
.tk-vat{display:grid;grid-template-columns:1fr 1fr;gap:8px;animation:rise .3s var(--ease) both}
.tk-vr{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:750;color:var(--muted)}
.tk-vr .input{height:46px;font-size:16px;font-weight:700}
.tk-vr.ht .input{background:rgba(74,31,230,.05)}
.tk-vline{grid-column:1/-1;display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;font-weight:650;color:var(--muted)}
.tk-vline b{color:var(--ink);font-weight:750}
.tk-vline .warn{color:var(--warn)}

/* pavé numérique */
.tk-kp,.tk-lsh{display:flex;flex-direction:column;gap:12px}
.tk-kpt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-kpv{display:flex;align-items:baseline;justify-content:center;gap:8px;min-height:70px;padding:8px 14px;border-radius:20px;background:rgba(74,31,230,.06);box-shadow:0 0 0 2px rgba(74,31,230,.25) inset}
.tk-kpv .mono{font-size:42px;font-weight:700;letter-spacing:-.04em;line-height:1.2}
.tk-kpv small{font-size:15px;font-weight:750;color:var(--muted)}
.tk-kpv.empty .mono{color:var(--faint)}
.tk-kpc{display:flex;gap:7px;flex-wrap:wrap}
.tk-kpc:empty{display:none}
.tk-kpc .chip{color:var(--accent);border-color:rgba(74,31,230,.2)}
.tk-keys button{height:56px}
.tk-keys.sm button{height:50px}
.tk-keys button .ico{width:22px;height:22px}

/* ventes → stock */
.tk-stock{display:flex;flex-direction:column;gap:10px}
.tk-stock .hstack .btn.sm{min-height:40px}
.tk-mvs{display:flex;flex-direction:column}
.tk-mv{display:flex;align-items:center;gap:10px;padding:9px 0}
.tk-mv+.tk-mv{border-top:1px solid var(--line)}
.tk-mv .tx{flex:1;min-width:0}
.tk-mv .tx b{display:block;font-size:14px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-mv .tx em{display:block;font-style:normal;font-size:12px;color:var(--faint);font-weight:600;margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-mq{font-weight:750;font-size:14.5px;white-space:nowrap;color:var(--bad)}
.tk-line .tk-mq{color:var(--ink)}
.tk-unls{display:flex;flex-direction:column;gap:6px}
.tk-unl{display:flex;align-items:center;gap:10px;padding:8px 0}
.tk-unl+.tk-unl{border-top:1px solid var(--line)}
.tk-unl .tx{flex:1;min-width:0}
.tk-unl .tx b{display:block;font-size:14px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-unl .tx em{display:block;font-style:normal;font-size:12px;color:var(--faint);font-weight:600}
.tk-unl .btn.sm{min-height:44px;flex:none}
.tk-recap{display:flex;flex-direction:column;gap:12px}
.tk-recap .tk-mv{animation:rise .4s var(--ease) both}
.tk-recap .tk-mv:nth-child(2){animation-delay:60ms}.tk-recap .tk-mv:nth-child(3){animation-delay:120ms}.tk-recap .tk-mv:nth-child(n+4){animation-delay:180ms}
.tk-sfin{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px}
.tk-sfin span{display:flex;flex-direction:column;gap:2px;padding:9px 12px;border-radius:14px;background:rgb(var(--k) / .04)}
.tk-sfin em{font-style:normal;font-size:11.5px;font-weight:750;color:var(--faint)}
.tk-sfin b{font-size:16px;font-weight:750}
.tk-sstock{display:flex;flex-direction:column;gap:6px}

/* lier un article */
.tk-lpath{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.tk-lpath .ico{width:14px;height:14px}
.tk-prods{display:flex;flex-direction:column;max-height:min(46vh,380px);overflow-y:auto;border-radius:16px;background:var(--glass-hi);box-shadow:0 0 0 1px var(--line) inset}
.tk-prod{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:10px;min-height:54px;padding:8px 14px;transition:background .15s}
.tk-prod+.tk-prod{border-top:1px solid var(--line)}
.tk-prod[hidden]{display:none}
.tk-prod .tx{flex:1;min-width:0;display:flex;flex-direction:column}
.tk-prod b{font-size:14.5px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-prod em{font-style:normal;font-size:12px;font-weight:600;color:var(--faint)}
.tk-prod em i{font-style:normal;color:var(--accent);font-weight:800}
.tk-prod.sug{background:rgba(74,31,230,.06)}
.tk-prod:hover,.tk-prod:focus-visible{background:rgba(74,31,230,.08)}
.tk-prod .ico{color:var(--faint);flex:none}
.tk-chips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -4px;padding:0 4px 2px}
.tk-chips::-webkit-scrollbar{display:none}
.tk-eq{display:flex;align-items:center;gap:12px}
.tk-eq > span{font-size:17px;font-weight:800;white-space:nowrap}
.tk-eq .tk-kpv{flex:1;min-height:60px;justify-content:flex-end}
.tk-eq .tk-kpv .mono{font-size:34px}
.tk-unit1{text-align:right;font-weight:800;font-size:15px}
.tk-unit1 em{font-style:normal;color:var(--faint);font-weight:650;font-size:12.5px}
.tk-lex{font-size:13px;font-weight:650;color:var(--muted);padding:10px 12px;border-radius:14px;background:rgba(7,138,94,.08)}
.tk-lex b{color:var(--ok);font-weight:800}
.tk-lks{display:flex;flex-direction:column}
.tk-lk{display:flex;align-items:center;gap:8px;padding:6px 0}
.tk-lk+.tk-lk{border-top:1px solid var(--line)}
.tk-lk .tx{all:unset;box-sizing:border-box;cursor:pointer;flex:1;min-width:0;display:flex;flex-direction:column;min-height:48px;justify-content:center;padding:4px 6px;border-radius:12px}
.tk-lk .tx:hover{background:rgba(74,31,230,.05)}
.tk-lk b{font-size:14.5px;font-weight:750}
.tk-lk em{font-style:normal;font-size:12px;color:var(--muted);font-weight:600}
@media (max-width:380px){.tk-vat{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){.tk-dupnote,.tk-dupf,.tk-vat,.tk-recap .tk-mv{animation:none}}
.tk-sfoot{grid-template-columns:1.5fr 1fr}
.tk-sfoot .btn{white-space:nowrap}
.tk-lastq{color:var(--muted)}
@media (min-width:960px){.tk-chips{flex-wrap:wrap;overflow:visible}}
