/* Caisse Latino — interface tablette (tactile, paysage en priorité)
   Direction artistique « Noche » : fond prune très sombre, accent dégradé rose → mangue,
   typographie Bricolage Grotesque (grasse, lisible dans la pénombre d'un club). */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #110a0f;
  --bg-glow: #2a0f1f;
  --panel: #1d1219;
  --panel-2: #2a1b24;
  --panel-3: #38242f;
  --line: #3b2733;
  --text: #fcf4ef;
  --muted: #bfa9b4;
  --accent: #ff3d77;
  --accent-2: #ff8a3d;
  --grad: linear-gradient(120deg, #ff3d77 0%, #ff6a52 55%, #ff9a3d 100%);
  --on-accent: #1a0610;
  --ok: #2ed47a;
  --warn: #ffb547;
  --danger: #ff4d5e;
  --card: #3d7bff;
  --cash: #12a660;
  --radius: 16px;
  --radius-sm: 12px;
  --tap: 56px; /* hauteur minimale d'une cible tactile */
  --topbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Bricolage", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 85% -10%, var(--bg-glow), transparent 60%), var(--bg);
  color: var(--text);
  font: 500 17px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
input, select, textarea { -webkit-user-select: text; user-select: text; }
#app { height: 100dvh; display: flex; flex-direction: column; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; }

button {
  font: inherit;
  font-weight: 700;
  color: inherit;
  border: 0;
  cursor: pointer;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  padding: 0 18px;
  transition: transform .07s ease, filter .12s ease, background-color .12s ease;
  touch-action: manipulation;
}
button:active:not(:disabled) { transform: scale(.96); filter: brightness(1.18); }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
button.primary { background: var(--grad); color: var(--on-accent); font-weight: 800; }
button.danger { background: var(--danger); color: #fff; }
button.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
button.small { min-height: 48px; padding: 0 16px; font-size: 15px; }
button.block { width: 100%; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: var(--tap);
  padding: 0 14px;
  width: 100%;
}
textarea { padding: 12px 14px; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label.field { display: grid; gap: 6px; font-size: 15px; color: var(--muted); font-weight: 600; }
label.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-size: 17px; }
label.check input { width: 28px; height: 28px; min-height: 0; accent-color: var(--accent); }

.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }

/* ---------- marque ---------- */
.wordmark { display: inline-flex; align-items: baseline; gap: 8px; line-height: 1; }
.wordmark b {
  font-weight: 800; letter-spacing: -.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark small { font-size: .42em; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

/* ---------- barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--topbar-h);
  padding: 8px 12px; background: rgba(20, 11, 17, .92); border-bottom: 1px solid var(--line);
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
}
.topbar > * { flex-shrink: 0; }
.topbar .brand { font-size: 24px; margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--panel-2); font-size: 14px; font-weight: 700; }
.chip.ok { background: rgba(46,212,122,.15); color: #8ef0b8; }
.chip.warn { background: rgba(255,181,71,.16); color: #ffd08a; }
.chip.pm-card { background: rgba(61,123,255,.2); color: #a9c4ff; }
.chip.pm-cash { background: rgba(18,166,96,.22); color: #8ef0b8; }
.chip.danger { background: rgba(255,77,94,.18); color: #ffa3ad; }
.chip.ok::first-letter, .chip.danger::first-letter { font-size: 11px; }
.clock { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); padding: 0 4px; }
.nav { display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 14px; }
.nav button { min-height: 48px; padding: 0 18px; background: transparent; color: var(--muted); border-radius: 10px; }
.nav button.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.who .name { font-weight: 800; }
.who .role { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

main.view { flex: 1; min-height: 0; overflow: auto; }

/* Défilement tactile : inertie, pas de rebond qui fait bouger toute la page */
main.view, .products, .lines, .tabs, .topbar, .modal-body, .table-wrap {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* Barres de défilement visibles (souris / tablettes Windows) */
main.view, .products, .lines, .modal-body, .table-wrap { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- connexion ---------- */
.login {
  display: grid; place-items: center; height: 100%; padding: 24px; overflow: auto;
  background:
    radial-gradient(700px 500px at 0% 100%, rgba(255,61,119,.16), transparent 70%),
    radial-gradient(600px 420px at 100% 0%, rgba(255,138,61,.12), transparent 70%);
}
.login-card { width: min(960px, 100%); display: grid; grid-template-columns: 1fr minmax(320px, 400px); gap: 48px; align-items: center; }
.login-card.solo { grid-template-columns: minmax(0, 460px); justify-content: center; text-align: center; }
.login-brand { display: grid; gap: 18px; align-content: center; }
.login-brand .wordmark { font-size: 76px; flex-direction: column; align-items: flex-start; gap: 10px; }
.login-card.solo .login-brand .wordmark { align-items: center; font-size: 60px; }
.login-brand .wordmark small { font-size: 16px; order: -1; }
.login-brand .tagline { color: var(--muted); font-size: 18px; margin: 0; }
.login-brand .login-clock { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.login-pad { display: grid; gap: 16px; background: rgba(29,18,25,.85); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-pad .pad-title { text-align: center; color: var(--muted); font-weight: 600; }
.login-caisse { display: flex; gap: 10px; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.login-card.solo .login-caisse { justify-content: center; }
.login-caisse .chip { font-size: 17px; padding: 10px 18px; background: var(--panel-2); }
.login h1 { margin: 0; font-size: 30px; }
.seg { display: flex; background: var(--panel); border-radius: var(--radius); padding: 4px; gap: 4px; }
.seg button { flex: 1; background: transparent; min-height: 52px; }
.seg button.active { background: var(--accent); color: #fff; }
.pin-dots { display: flex; justify-content: center; gap: 16px; height: 22px; align-items: center; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); transition: transform .12s ease; }
.pin-dots span.on { background: var(--grad); border-color: transparent; transform: scale(1.12); }
.pin-dots.shake { animation: shake .32s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.error-text { color: #ffa3ad; min-height: 22px; font-weight: 700; text-align: center; }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.numpad button { min-height: 68px; font-size: 30px; font-weight: 700; background: var(--panel-2); font-variant-numeric: tabular-nums; }
.numpad button.fn { font-size: 22px; color: var(--muted); background: var(--panel); }

/* ---------- caisse ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 37%); grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 520px; }
.catalog { display: flex; flex-direction: column; min-height: 0; padding: 14px; gap: 14px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; flex-shrink: 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; padding-bottom: 2px; scrollbar-width: none; }
.tabs button {
  flex: 0 0 auto; min-height: 60px; padding: 0 24px; font-size: 19px; color: var(--muted);
  background: var(--panel); display: inline-flex; align-items: center; gap: 10px;
}
.tabs button::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tab-color, var(--accent)); opacity: .7; }
.tabs button.active { color: var(--text); background: var(--panel-3); box-shadow: inset 0 -4px 0 var(--tab-color, var(--accent)); }
.tabs button.active::before { opacity: 1; box-shadow: 0 0 12px var(--tab-color, var(--accent)); }
.tabs-row { display: flex; gap: 8px; align-items: stretch; flex-shrink: 0; }
.tabs-row .tabs { flex: 1; min-width: 0; }
.misc-btn { flex: 0 0 auto; min-height: 60px; padding: 0 22px; font-size: 18px; background: transparent; box-shadow: inset 0 0 0 2px var(--accent); color: #ffb3c8; }

.products { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); grid-auto-rows: 116px; gap: 12px; align-content: start; padding-bottom: 8px; }
.tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 14px 16px; text-align: left;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tile-color, var(--accent)) 16%, var(--panel)) 0%, var(--panel) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tile-color, var(--accent)) 28%, transparent);
  border-radius: var(--radius);
  min-height: 0; height: 100%;
}
.tile::after { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--tile-color, var(--accent)); }
.tile .t-name { font-size: 19px; font-weight: 700; line-height: 1.15; }
.tile .t-price { font-size: 21px; color: var(--muted); font-weight: 800; }
.tile .t-badge {
  position: absolute; bottom: 12px; right: 12px; min-width: 32px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; height: 32px; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--grad); color: var(--on-accent);
}
.tile.flash { animation: tile-flash .35s ease-out; }
@keyframes tile-flash { from { box-shadow: inset 0 0 0 3px var(--accent-2), 0 0 24px rgba(255,138,61,.45); } }
.products.entries { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 180px; }
.products.entries .tile { background: var(--grad); box-shadow: 0 12px 32px rgba(255,61,119,.22); color: var(--on-accent); padding: 18px 20px; }
.products.entries .tile:nth-child(3n+2) { background: linear-gradient(120deg, #ff8a3d, #ffc247); }
.products.entries .tile:nth-child(3n+3) { background: linear-gradient(120deg, #b04dff, #ff3d77); color: #fff; }
.products.entries .tile::after { display: none; }
.products.entries .tile .t-name { font-size: 28px; font-weight: 800; }
.products.entries .tile .t-price { font-size: 38px; color: inherit; }
.products.entries .tile .t-badge { background: rgba(26,6,16,.85); color: #fff; }
.tile .badge { font-size: 12px; background: rgba(0,0,0,.3); padding: 2px 8px; border-radius: 999px; }

.ticket { display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); min-height: 0; }
.ticket-head { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.ticket-head h2 { margin: 0; font-size: 21px; flex: 1; }
.ticket-head .count { background: var(--panel-2); padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--muted); }
.edit-banner { background: rgba(255,181,71,.16); color: #ffd08a; padding: 10px 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.lines { flex: 1; overflow: auto; padding: 4px 10px; }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.ticket .empty { margin: 14px 6px; padding: 36px 16px; border: 2px dashed var(--line); border-radius: var(--radius); font-weight: 600; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(84px, auto); gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); align-items: center; min-height: 64px; }
.line .l-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line .l-unit { font-size: 14px; color: var(--muted); }
.line .l-unit.warn-text { color: #ffa3ad; white-space: normal; }
.line .l-total { text-align: right; font-weight: 800; }
.qty { display: flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 14px; padding: 3px; }
.qty button { min-height: 48px; width: 48px; padding: 0; font-size: 24px; background: var(--panel-2); border-radius: 11px; }
.qty span { min-width: 30px; text-align: center; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.summary { padding: 12px 16px 10px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.summary .s-row { display: flex; justify-content: space-between; align-items: baseline; }
.summary .s-row.disc { color: #ffd08a; }
.summary .s-total { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.ticket-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 10px; }
.ticket-actions .on { background: var(--warn); color: #241400; }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.pay button { min-height: 96px; display: grid; place-content: center; gap: 2px; font-size: 21px; font-weight: 800; letter-spacing: .04em; border-radius: var(--radius); }
.pay .card { background: linear-gradient(160deg, #4f8bff, #2f62e0); color: #fff; box-shadow: 0 10px 26px rgba(61,123,255,.28); }
.pay .cash { background: linear-gradient(160deg, #19bd6f, #0e8a4f); color: #fff; box-shadow: 0 10px 26px rgba(18,166,96,.28); }
.pay button:disabled { box-shadow: none; }
.pay small { font-size: 16px; font-weight: 700; opacity: .92; letter-spacing: 0; font-variant-numeric: tabular-nums; }

.blocker { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; }
.blocker > div { max-width: 480px; display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 32px; }
.blocker h2 { margin: 0; font-size: 28px; }
.blocker p { margin: 0; }

/* ---------- pages ---------- */
.page { padding: 18px; display: grid; gap: 16px; align-content: start; max-width: 1200px; margin: 0 auto; width: 100%; }
.page h2 { margin: 0; font-size: 26px; }
.page h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi:first-child { background: linear-gradient(150deg, rgba(255,61,119,.22), var(--panel) 70%); border-color: rgba(255,61,119,.35); }
.kpi .k-label { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi .k-value { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:active { background: var(--panel-2); }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.diff-neg { color: #ffa3ad; font-weight: 800; }
.diff-pos { color: #ffd08a; font-weight: 800; }
.diff-ok { color: #8ef0b8; font-weight: 800; }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; }
.subtabs button.active { background: var(--grad); color: var(--on-accent); }
.log-details { font-size: 14px; color: var(--muted); word-break: break-word; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.warn-text { color: #ffa3ad; }
.alert-text { color: #ffd08a; font-weight: 700; }

/* ---------- envoi en cours ---------- */
.sending-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(8,3,6,.6); display: grid; place-items: center; }
.sending-overlay > div { background: var(--panel); border: 1px solid var(--line); padding: 22px 30px; border-radius: 18px; font-size: 20px; font-weight: 800; display: flex; gap: 14px; align-items: center; }
.sending-overlay > div::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modales ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,3,6,.74); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .14s ease-out; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: rise .18s ease-out; }
.modal.wide { width: min(880px, 100%); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-head { padding: 14px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 22px; flex: 1; }
.modal-toasts { display: grid; gap: 8px; padding: 0 20px; }
.modal-toasts:not(:empty) { padding-top: 12px; }
.modal-toasts .toast { box-shadow: none; font-size: 16px; padding: 12px 14px; }
.modal-body { padding: 18px 20px; overflow: auto; min-height: 0; display: grid; gap: 14px; }
.modal-actions { padding: 14px 20px; display: flex; gap: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-actions button { flex: 1; min-height: 64px; font-size: 19px; }
.amount-display { font-size: 44px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.big-total { text-align: center; }
.big-total .label { color: var(--muted); font-weight: 600; }
.big-total .value { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }
.change { text-align: center; font-size: 28px; font-weight: 800; color: #8ef0b8; min-height: 38px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.quick button { min-height: 60px; font-size: 20px; }
.quick button:first-child { box-shadow: inset 0 0 0 2px var(--cash); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice-grid button { min-height: 72px; font-size: 18px; }
.choice-grid button.active { background: var(--grad); color: var(--on-accent); }

/* Paiement espèces : récapitulatif à gauche, pavé à droite (tient sur un écran de tablette) */
.pay-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.pay-info { display: grid; gap: 12px; align-content: start; }
.pay-info .amount-display { font-size: 34px; background: var(--bg); border-radius: var(--radius); padding: 10px; }
.pay-info .big-total .value { font-size: 50px; }
.pay-pad .numpad button { min-height: 64px; }

/* ---------- toasts : sous la barre du haut, à droite (au-dessus du ticket) ---------- */
#toast-root { position: fixed; right: 16px; top: calc(var(--safe-top) + var(--topbar-h) + 10px); display: grid; gap: 8px; z-index: 45; pointer-events: none; width: min(440px, calc(100% - 32px)); }
.toast { background: #2c1c26; border: 1px solid var(--line); border-left: 6px solid var(--ok); padding: 14px 18px; border-radius: 14px; font-weight: 700; font-size: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: pop .18s ease-out; }
.toast.error { border-left-color: var(--danger); }
@keyframes pop { from { transform: translateY(-10px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- tablettes paysage plus étroites (iPad 1024 px, Android 10" ~960 px) ---------- */
@media (max-width: 1140px) {
  .clock, .who .role, .topbar .wordmark small { display: none; }
  .topbar { gap: 8px; }
  .topbar .brand { font-size: 22px; }
  .nav button { padding: 0 12px; }
  .chip { padding: 7px 10px; }
  .who .name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pos { grid-template-columns: minmax(0, 1fr) minmax(340px, 38%); }
}

/* ---------- portrait / petits écrans ---------- */
@media (max-width: 820px), (orientation: portrait) {
  :root { --topbar-h: 124px; }
  .pos { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .catalog, .ticket { min-width: 0; }
  .ticket { border-left: 0; border-top: 1px solid var(--line); max-height: 52dvh; }
  .products { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: 100px; }
  .products.entries { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: 140px; }
  .who .role, .clock { display: none; }
  .topbar { flex-wrap: wrap; overflow: visible; }
  .topbar .nav { order: 3; width: 100%; }
  .topbar .nav button { flex: 1; }
  .login-card { grid-template-columns: minmax(0, 440px); justify-content: center; gap: 28px; text-align: center; }
  .login-brand .wordmark { align-items: center; font-size: 56px; }
  .login-caisse { justify-content: center; }
  .login-brand .login-clock { display: none; }
  .pay-layout { grid-template-columns: 1fr; gap: 14px; }
}

/* ---------- impression du rapport Z ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .topbar, .no-print, #toast-root { display: none !important; }
  #app { height: auto; }
  main.view { overflow: visible; }
  .panel, .kpi, .kpi:first-child { background: #fff; border: 1px solid #ccc; }
  th, td { border-color: #ccc; padding: 6px; }
  .muted, th, .kpi .k-label { color: #444; }
  .diff-neg, .diff-pos, .diff-ok, .alert-text { color: #000; }
}
