/* Page Ventes — présentation sobre, façon tableur : textes seulement (aucun emoji), lignes serrées, séparateurs fins, pas d'ombres ni de pastilles de couleur.
   Chargé après ventes-pages.css ; ne s'applique qu'à #page-ventes et aux sous-pages (#page-venteshist, #page-ventescmd). */

#page-ventes { font-size: 12px; }
#page-ventes .card { border-radius: 3px; box-shadow: none; }
#page-ventes .col-head { padding: 4px 8px; min-height: 28px; font-size: 12px; font-weight: 700; background: var(--panel2); gap: 6px; }
#page-ventes .col-head .editable-title { font-size: 12px; font-weight: 700; white-space: nowrap; }
#page-ventes .badge-muted { font-size: 11px; font-weight: 600; color: var(--muted); }
#page-ventes .col-footer { padding: 4px 8px; }
#page-ventes .col-footer p { font-size: 10px !important; }
#page-ventes .btn, #page-ventes .btn-sm, #page-ventes .btn-outline { border-radius: 3px; font-size: 12px; font-weight: 600; padding: 3px 10px; box-shadow: none; }
#page-ventes .btn-primary { background: var(--accent); color: var(--accent-fg, #fff); }
#page-ventes .input, #page-ventes .input-sm { border-radius: 3px; font-size: 12px; padding: 3px 6px; min-height: 24px; }
#page-ventes .chip { border-radius: 3px; font-size: 11px; padding: 1px 7px; }
#page-ventes .chip.active { background: var(--panel2); color: var(--text); border-color: var(--text); font-weight: 700; }
#ventes-toolbar .btn { padding: 2px 9px; }

/* Éléments communs « tableau » */
.vt-row { padding: 3px 8px; border-bottom: 1px solid var(--border); cursor: pointer; line-height: 1.25; font-size: 12px; }
.vt-row:hover { background: var(--panel2); }
.vt-row.sel { background: var(--panel2); box-shadow: inset 2px 0 0 var(--accent); }
.vt-off { opacity: .5; }
.vt-head { display: flex; justify-content: space-between; gap: 8px; padding: 2px 8px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--panel2); border-bottom: 1px solid var(--border); }
.vo-l1 { display: flex; align-items: baseline; gap: 8px; }
.vt-num { flex: none; font-weight: 700; min-width: 46px; }
.vt-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.vt-n { flex: none; text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vo-l2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11px; color: var(--muted); min-height: 15px; }
.vt-m { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-acts { display: flex; gap: 10px; flex: none; }
.vt-a { background: none; border: 0; padding: 0; margin: 0; color: var(--accent); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.vt-a:hover { text-decoration: underline; }
.vt-del { color: var(--danger, #b42318); }
.vb { border: 1px solid var(--border); background: var(--input); color: var(--text); border-radius: 3px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.vb:hover { background: var(--panel2); }
.vb-primary { background: var(--accent); color: var(--accent-fg, #fff); border-color: var(--accent); }
.vb-primary:hover { background: var(--accent); filter: brightness(.95); }
.vb-danger { color: var(--danger, #b42318); }

/* Sections commandes / ventes */
.vj-title { padding: 2px 8px; font-size: 10px; letter-spacing: .04em; background: var(--panel2); }
.vj-title .badge-muted { font-size: 10px; }
.vj-empty { padding: 8px; font-size: 11px; text-align: left; }
.vj-sep { height: 7px; }
.vj-sep span { top: 3px; height: 1px; left: 0; right: 0; border-radius: 0; background: var(--border); }
.vj-sep:hover span, .vj-sep.on span { height: 3px; top: 2px; }

/* Catégories : liste très serrée */
#vc-list { padding: 0; gap: 0; }
.vc-row { min-height: 22px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 12px; font-weight: 500; gap: 6px; }
.vc-row.on { background: var(--panel2); color: var(--text); font-weight: 700; }
.vc-row.vc-all { margin: 0; border-radius: 0; }
.vc-row .vc-box { width: 11px; height: 11px; border-radius: 2px; border: 1px solid var(--muted); }
.vc-row.on .vc-box { background: var(--accent); border-color: var(--accent); }
.vc-row.vc-all .vc-box { display: none; }
.vc-row .vc-n { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
#vc-find { margin: 4px 6px; }

/* Articles : liste serrée (mode Liste) */
#caisse-search { min-height: 24px; }
#grid-articles .sidebar-item { padding: 2px 8px; min-height: 22px; border-bottom: 1px solid var(--border); background: transparent; line-height: 1.25; font-size: 12px; }
#grid-articles .sidebar-item:nth-child(even) { background: transparent; }
#grid-articles .sidebar-item:hover { background: var(--panel2); }
#grid-articles .sidebar-item span { font-size: 12px !important; }
#grid-articles .sidebar-item .av-pills { margin-top: 1px; }
#grid-articles .sidebar-item .av-pill { font-size: 10px; padding: 0 5px; border-radius: 2px; background: transparent; border: 1px solid var(--border); }
#av-bar .chip { min-height: 20px; }

/* Panier : tableau compact */
#cart-lines .cart-line { padding: 2px 8px; font-size: 12px; background: transparent; }
#cart-lines .cart-line .name { font-size: 12px; font-weight: 600; }
#cart-lines .cart-line .line-total { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
#cart-lines .qty-btn { width: 18px; height: 18px; min-width: 0; min-height: 0; border-radius: 2px; font-size: 12px; }
#cart-lines.vcv-compact .cart-line { grid-template-columns: minmax(0, 1fr) 64px 118px 66px; min-height: 26px; }
#cart-lines .vs-qty { width: 32px; height: 20px; min-height: 0; padding: 0 2px; border-radius: 2px; font-size: 12px; }
#cart-lines .vs-disc { width: auto; padding: 0 2px; border: 0; background: none; color: var(--accent); font-size: 11px; font-weight: 600; }
#cart-lines .vs-disc.on { background: none; color: var(--text); text-decoration: underline; }
#cart-lines .av-loc select { font-size: 11px !important; border-radius: 2px; }
#vcv-head { display: none; }
#vcv-head.on { display: grid; grid-template-columns: minmax(0, 1fr) 64px 118px 66px; gap: 6px; padding: 2px 8px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--panel2); border-bottom: 1px solid var(--border); }
#vcv-head span:last-child { text-align: right; }
#vcv-modes button { border-radius: 2px; min-height: 22px; font-size: 11px; font-weight: 600; padding: 0 7px; }
#vcv-modes button.on { background: var(--panel2); color: var(--text); border-color: var(--text); }
#page-ventes .total-row { font-size: 13px; }
#vc-foot .btn { min-height: 30px; }

/* Ventes du jour */
#vs-summary { font-size: 11px; padding: 4px 8px; }
#vs-summary .vs-h { font-size: 12px; }
#sales-list .sidebar-item { padding: 3px 8px !important; border-bottom: 1px solid var(--border); background: transparent; }
#sales-list .sidebar-item .badge-muted { font-size: 10px; min-width: 22px !important; }
#sales-list .vs-pr { margin-left: 6px; }
.vs-badge { background: none; color: var(--danger, #b42318); border: 1px solid currentColor; border-radius: 2px; font-size: 9px; padding: 0 4px; }

/* Détail (vente ou commande) */
.vd-h { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.vd-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.vd-title b { font-size: 13px; }
.vd-title span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.vd-kv { border-collapse: collapse; width: 100%; font-size: 12px; }
.vd-kv td { padding: 1px 0; vertical-align: top; }
.vd-kv td:first-child { width: 56px; color: var(--muted); }
.vd-line { display: flex; justify-content: space-between; gap: 8px; cursor: default; }
.vd-line:hover { background: transparent; }
.vd-total { display: flex; justify-content: space-between; padding: 6px 8px; font-size: 13px; font-weight: 800; border-bottom: 1px solid var(--border); }
.vd-act { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.vd-hist { padding: 6px 8px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); line-height: 1.5; }
#sale-detail .vs-info { font-size: 12px; padding: 4px 8px; }
#sale-detail .vs-act { padding: 6px 8px; }
#sale-detail .vs-tag { color: var(--text); font-weight: 600; }

/* Livraisons */
.vl-tabs { padding: 0; gap: 0; border-bottom: 1px solid var(--border); }
.vl-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; min-height: 26px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.vl-tabs button.on { background: transparent; color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

/* Sous-pages Historique des ventes / Commandes */
#page-venteshist, #page-ventescmd { font-size: 12px; }
.vp-chip { border-radius: 3px; min-height: 24px; padding: 2px 9px; font-size: 12px; font-weight: 600; background: transparent; }
.vp-chip.on { background: var(--panel2); color: var(--text); border-color: var(--text); font-weight: 700; }
.vp-kpi { border-radius: 3px; padding: 3px 8px; }
.vp-kpi span { font-size: 10px; }
.vp-kpi b { font-size: 13px; }
.vp-list, .vp-detail { border-radius: 3px; }
.vp-row { min-height: 28px; padding: 3px 8px; }
.vp-row .vp-m b { font-size: 12px; }
.vp-row .vp-m small { font-size: 11px; }
.vp-row .vp-a { font-size: 12px; }
.vp-day { padding: 2px 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.vp-badge { background: none !important; color: var(--muted) !important; padding: 0; margin-left: 6px; font-weight: 700; border-radius: 0; }
.vp-dh { padding: 6px 8px; }
.vp-dh h3 { font-size: 13px; }
.vp-line { padding: 3px 8px; font-size: 12px; }
.vp-tot { padding: 6px 8px; font-size: 13px; }
.vp-act { padding: 8px; }
.vp-act .btn { border-radius: 3px; }
.vp-notice { border-radius: 3px; }

/* Icônes (catégories, articles) et articles épuisés */
.vi-i { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; color: var(--muted); }
.vi-i .vi-svg { display: block; }
.vi-i.vi-ph img { width: 16px; height: 16px; object-fit: cover; border-radius: 2px; display: block; }
.vc-row.on .vi-i { color: var(--accent); }
#grid-articles .vi-out { opacity: .5; cursor: not-allowed; }
#grid-articles .vi-out:hover { background: transparent; }
#vo-count { margin-left: 8px; }
#vcv-head { display: none !important; }

/* Choix de l'icône dans la fiche article */
.vi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; margin: 4px 0; }
.vi-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 34px; padding: 3px; border: 1px solid var(--border); border-radius: 3px; background: transparent; color: var(--text); cursor: pointer; }
.vi-opt:hover { background: var(--panel2); }
.vi-opt.on { border-color: var(--accent); background: var(--panel2); color: var(--accent); }
.vi-opt em { font-size: 9px; font-style: normal; line-height: 1; }
.vi-i .vi-svg { width: 16px; height: 16px; }
.vi-opt .vi-i .vi-svg { width: 18px; height: 18px; }

/* Profil sans droit de vendre (préparation, livraison) : seulement commandes, détail et livraisons */
#page-ventes.vrole-nosell [data-vcol="categories"], #page-ventes.vrole-nosell [data-vcol="articles"], #page-ventes.vrole-nosell [data-vcol="panier"],
#page-ventes.vrole-nosell [data-vcol="categories"] + .resize-handle, #page-ventes.vrole-nosell [data-vcol="articles"] + .resize-handle, #page-ventes.vrole-nosell [data-vcol="panier"] + .resize-handle,
#page-ventes.vrole-nosell #vv-cols label:has([data-vv="categories"]), #page-ventes.vrole-nosell #vv-cols label:has([data-vv="articles"]), #page-ventes.vrole-nosell #vv-cols label:has([data-vv="panier"]),
#page-ventes.vrole-nosell #vv-cols label:has(#vv-direct) { display: none !important; }

/* Files d'attente (Encaissement, Préparation, Livraison) */
.vq-root { padding: 8px 12px; max-width: 1100px; margin: 0 auto; width: 100%; }
.vq-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 6px; flex-wrap: wrap; }
.vq-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.vq-next { font-size: 13px; color: var(--muted); }
.vq-next b { color: var(--text); }
.vq-sp { flex: 1; }
.vq-tabs { margin-bottom: 4px; }
.vq-list { display: flex; flex-direction: column; }
.vq-item { display: flex; align-items: stretch; gap: 10px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--panel); }
.vq-item.first { background: var(--panel2); border-left: 3px solid var(--accent); }
.vq-item.late .vq-w { color: var(--danger, #b42318); font-weight: 700; }
.vq-n { flex: none; width: 34px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.vq-item.first .vq-n { color: var(--accent); }
.vq-main { flex: 1; min-width: 0; }
.vq-l1 { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.vq-cl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vq-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.vq-l2 { font-size: 12px; color: var(--muted); }
.vq-lines { font-size: 12px; margin-top: 2px; }
.vq-acts { flex: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.vq-acts .vb { min-height: 34px; padding: 0 14px; font-size: 13px; }
@media (max-width: 900px) { .vq-item { flex-wrap: wrap; } .vq-acts { width: 100%; justify-content: stretch; } .vq-acts .vb { flex: 1; min-height: 44px; } }
.vq-search { max-width: 420px; margin: 0 0 6px; }
.vq-tel { margin-left: 8px; font-size: 12px; color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums; }

/* Configuration guidée : options désactivées → éléments masqués (classes posées par files-settings.js) */
body.vf-noicons .vi-i { display: none; }
body.vf-noremise #cart-lines .vs-disc { display: none; }
body.vf-nostock #grid-articles .sidebar-item > span:nth-last-child(2) { display: none; }
body.vf-nostock [data-vstock="adjust"], body.vf-noemp [data-vstock="transfer"], body.vf-noemp [data-vstock="locations"] { display: none; }
body.vf-noemp #vsc-bar, body.vf-noemp .vsc-c { display: none; }

/* Caisse : colonnes de gauche à droite (file · encaissement · payées) */
.vq-root:has(.vc-board) { max-width: none; }
.vc-board { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.2fr) minmax(240px, 1fr); gap: 10px; align-items: start; }
.vc-col { border: 1px solid var(--border); border-radius: 6px; background: var(--panel); padding: 8px; min-width: 0; }
.vc-col h3 { margin: 0 0 6px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.vc-n { background: var(--accent); color: var(--accent-fg, #fff); border-radius: 999px; font-size: 11px; padding: 0 7px; }
.vc-sub { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.vq-item.sel { outline: 2px solid var(--accent); outline-offset: -2px; cursor: pointer; }
.vc-line, .vc-total { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.vc-total { font-size: 16px; border-bottom: 0; padding-top: 8px; }
.vc-chg { min-height: 22px; margin: 6px 0; font-size: 15px; }
.vc-chg.bad { color: var(--danger, #b42318); font-weight: 700; }
.vc-note { background: var(--panel2); border-left: 3px solid var(--accent); padding: 6px 8px; margin: 8px 0; font-size: 12px; }
.vc-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.vc-acts .vb { min-height: 38px; padding: 0 14px; }
@media (max-width: 1000px) { .vc-board { grid-template-columns: 1fr; } }
