/* ===== Ecran de caisse (POS) ===== */
main.wide { max-width: none; padding: 10px 14px; }

.pos { display: grid; grid-template-columns: minmax(400px, 40%) 1fr; gap: 14px; height: calc(100vh - 28px); min-height: 560px; }

/* --- colonne ticket --- */
.pos-left { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.12); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.pos-head { background: #1d4ed8; color: #fff; display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.pos-left .alert { margin: 8px 10px 0; }

.pos-total { background: #0f172a; color: #fff; padding: 8px 18px 10px; display: flex; align-items: baseline; gap: 10px; }
.pos-total span { font-size: 15px; opacity: .8; margin-inline-end: auto; }
.pos-total b { font-size: 50px; line-height: 1.05; font-weight: 700; color: #e0f2fe; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.pos-total small { font-size: 22px; font-weight: 700; }

.pos-lines { flex: 1; min-height: 110px; overflow-y: auto; border-bottom: 2px solid #dbeafe; }
.pos-lines table { border-radius: 0; font-size: 14px; }
.pos-lines thead th { background: #dbeafe; color: #0f172a; position: sticky; top: 0; }
.pos-lines td { padding: 5px 8px; }
.pos-lines td.kg { font-weight: 700; color: #2563eb; }
.pos-lines td.t { font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-lines tr { cursor: pointer; }
.pos-lines tr.active td { background: #dbeafe; }
.pos-lines tr.over td.kg { color: #c00; text-decoration: underline wavy; }
.pos-lines input.px { width: 82px; padding: 3px 5px; font-size: 14px; }
.pos-lines .del { background: #b02020; color: #fff; border: 0; border-radius: 4px; cursor: pointer; padding: 2px 9px; font-size: 16px; }
.pos-lines .empty { color: #8a8a8a; text-align: center; padding: 26px 10px; }

.pos-pad { padding: 8px 10px 4px; background: #f8fafc; }
.pad-display { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 2px solid #1d4ed8; border-radius: 8px; padding: 4px 12px; margin-bottom: 6px; }
.pad-display span { font-weight: 600; color: #0f172a; }
.pad-display b { font-size: 30px; font-variant-numeric: tabular-nums; }
.pad-display small { font-size: 15px; }
.pad-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pad-keys button { padding: 10px 0; font-size: 20px; font-weight: 700; border: 1px solid #cbd5e1; background: #fff; border-radius: 7px; cursor: pointer; }
.pad-keys button:hover { background: #dbeafe; }
.pad-keys button:active { background: #dbeafe; }
.pad-keys .pre { background: #e2e8f0; border-color: #cbd5e1; font-size: 16px; }
.pad-keys .back { background: #eee; }
.pad-keys .clr { background: #f6d2d2; border-color: #e0a0a0; color: #a00; }

.pos-pay { padding: 8px 10px 10px; background: #f8fafc; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-row label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.pay-btns { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 8px; }
.pay-btns .btn { padding: 12px 8px; font-weight: 700; }
.btn.ok { background: #1f8a3b; }
.btn.ok:hover { background: #17702f; }

/* --- colonne produits --- */
.pos-right { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.12); padding: 12px; display: flex; flex-direction: column; min-height: 0; }
.pos-search input { font-size: 16px; padding: 10px 14px; border-radius: 22px; margin-bottom: 10px; }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-content: start; padding: 2px; }

.tile { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 8px; background: #ffffff; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; text-align: center; font-family: inherit; transition: transform .08s, box-shadow .08s, border-color .08s; }
.tile:hover { border-color: #2563eb; box-shadow: 0 4px 12px rgba(180,86,27,.25); transform: translateY(-2px); }
.tile:active { transform: scale(.97); }
.tile .ph { display: block; height: 130px; border-radius: 8px; overflow: hidden; background: #fff; }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .tn { font-weight: 700; font-size: 16px; color: #2b2b2b; margin-top: 4px; }
.tile .tp { font-weight: 700; color: #fff; background: #2563eb; border-radius: 12px; padding: 2px 8px; font-size: 14px; align-self: center; }
.tile .ts { font-size: 12px; color: #1f7a2e; }
.tile.low .ts { color: #c77a00; font-weight: 700; }
.tile.low { border-color: #f0b44c; }
.tile.out { opacity: .5; cursor: not-allowed; filter: grayscale(1); }
.tile.out .ts { color: #c00; font-weight: 700; }
.tile.out:hover { transform: none; box-shadow: none; border-color: #e2e8f0; }

/* --- miniatures (page Stock / fiche produit) --- */
img.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; background: #fff; vertical-align: middle; }
img.thumb.big { width: 160px; height: 120px; display: block; margin: 6px 0 10px; }

@media (max-width: 900px) {
    .pos { grid-template-columns: 1fr; height: auto; }
    .pos-left { order: 2; }
    .pos-right { order: 1; max-height: 55vh; }
    .pos-lines { max-height: 220px; }
}
