/* ============================================================
   Waale Caisse — styles (mobile d'abord, iPhone 13 : 390 × 844)
   Thème clair très contrasté : lisible en plein soleil au marché
   ============================================================ */
:root {
  /* Charte Waale — couleurs tirées du logo */
  --navy: #02394d;      /* Abysse : anneau du logo, en-tête, onglets, boutons principaux */
  --navy-d: #012836;    /* Abysse profond */
  --teal: #03868e;      /* Lagon : cœur du logo, accents, focus */
  --ice: #bddeed;       /* Glacier : lettres WAALE */
  --ice-l: #e3f0f6;     /* Glacier clair */
  --bg: #eaf3f7;        /* Brume : fond des écrans */
  --card: #ffffff;
  --ink: #0e2631;       /* texte */
  --ink2: #4d6976;      /* texte secondaire */
  --line: #cfe0e8;
  --amber: #f2b705;     /* Or : « BRASSERIE », appel à l'action, ardoises */
  --amber-d: #7d5c00;   /* Or foncé, pour du texte lisible */
  --amber-l: #fdf1c7;   /* Or pâle */
  --green: #1d8656;
  --red: #c0392b;
  --radius: 14px;
  --tabs-h: 58px;
  --paybar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-padding-bottom: calc(var(--tabs-h) + var(--paybar-h) + env(safe-area-inset-bottom, 0px) + 12px); scroll-padding-top: 70px; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 16px; /* 16px : évite le zoom auto de Safari */
  -webkit-appearance: none; appearance: none;
}
select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234d6976' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #c4e7ea; }
textarea { resize: vertical; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.err { color: var(--red); min-height: 1.2em; margin: 10px 0 0; font-size: 14px; }

/* ---------- Boutons ---------- */
.btn { border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 14px;
  font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:disabled { background: #a9bfca; border-color: #a9bfca; }
.btn.ghost { background: var(--amber-l); border-color: transparent; color: var(--amber-d); }
.btn.danger { color: var(--red); }
.btn.big { padding: 14px 18px; font-size: 17px; }
.btn.small { padding: 6px 10px; font-size: 14px; }
.link { color: var(--teal); font-weight: 600; text-decoration: none; font-size: 14px; }

/* ---------- Marque ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 22px; letter-spacing: .5px; }
.brand small { color: var(--ink2); }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--amber); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 20px; font-family: Georgia, serif; }
.brand.small .brand-mark { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
.brand.small { font-weight: 700; font-size: 17px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; padding: 26px 22px;
  box-shadow: 0 10px 40px rgba(2, 40, 54, .1); }
.login-card h2 { margin: 22px 0 6px; }
.login-card label { display: block; margin-top: 14px; font-size: 14px; color: var(--ink2); font-weight: 600; }
.login-card input { margin-top: 5px; }
.login-card .btn { width: 100%; margin-top: 20px; }

/* ---------- Structure ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: calc(8px + var(--safe-t)) 16px 8px; background: rgba(244, 239, 230, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.day-total { border: 0; background: var(--navy); color: #fff; border-radius: 10px; padding: 5px 12px; text-align: right; line-height: 1.1; cursor: pointer; }
.day-total small { display: block; font-size: 11px; opacity: .7; }
.day-total b { font-size: 16px; }
.view { padding: 12px 16px 0; max-width: 760px; margin: 0 auto; }
.spacer { height: calc(var(--tabs-h) + var(--paybar-h) + var(--safe-b) + 20px); }
#v-ventes .spacer, #v-reglages .spacer { height: calc(var(--tabs-h) + var(--safe-b) + 20px); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.card-title .muted { font-weight: 500; font-size: 14px; }
.card-title { font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title.pad { margin: 18px 2px 8px; }
.pad { padding-left: 2px; padding-right: 2px; }
.row2 { display: flex; gap: 10px; align-items: flex-end; }
.grow { flex: 1; min-width: 0; }
.field { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); }
.field input, .field select, .field textarea { margin-top: 4px; color: var(--ink); font-weight: 400; }
.empty { text-align: center; color: var(--ink2); padding: 14px; margin: 0; }
.empty.small { padding: 6px; font-size: 14px; }

/* ---------- En-tête de vente ---------- */
.sale-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sale-no { font-weight: 700; font-size: 18px; }
.sale-time { color: var(--ink2); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Interrupteur commerçant ---------- */
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; padding-bottom: 6px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw { width: 48px; height: 29px; border-radius: 20px; background: #c3d6df; position: relative; transition: .2s; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .2s; }
.switch input:checked + .sw { background: var(--teal); }
.switch input:checked + .sw::after { left: 22px; }
.sw-lbl { font-size: 14px; font-weight: 600; line-height: 1.1; }
.sw-lbl small { display: block; color: var(--ink2); font-weight: 400; }

/* ---------- Grille produits ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.pbtn { position: relative; border: 0; border-radius: 10px; min-height: 54px; padding: 6px 6px 5px;
  color: #fff; text-align: left; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); cursor: pointer; overflow: hidden; }
.pbtn:active { transform: scale(.95); filter: brightness(1.1); }
.pbtn .pn { font-weight: 700; font-size: 12.5px; line-height: 1.12; word-break: break-word; padding-right: 14px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.pbtn.light { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), inset 0 0 0 1px rgba(0, 0, 0, .08); }
.pbtn.light .pn { text-shadow: none; }
.pbtn .pp i { font-style: normal; font-size: 10px; opacity: .8; }
.pbtn .pp { font-size: 11.5px; margin-top: 2px; opacity: .92; font-variant-numeric: tabular-nums; }
.pbtn .badge { position: absolute; top: -5px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
  background: var(--navy); color: #fff; border: 2px solid var(--bg); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.pbtn { overflow: visible; }
.pbtn .nr { position: absolute; bottom: 6px; right: 7px; font-size: 10px; opacity: .8; }
.pbtn.pulse { animation: pulse .25s; }
@keyframes pulse { 50% { transform: scale(.93); } }

/* ---------- Panier ---------- */
.cart { list-style: none; margin: 0; padding: 0; }
.cart li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.cart li:first-child { border-top: 0; }
.cart .cn { flex: 1; min-width: 0; }
.cart .cn b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart .cn small { color: var(--ink2); }
.qty { display: flex; align-items: center; gap: 2px; }
.qty button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 20px;
  font-weight: 700; line-height: 1; cursor: pointer; }
.qty span { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty .q-in { width: 44px; height: 36px; padding: 0 2px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums;
  border: 1.5px solid transparent; border-radius: 9px; background: var(--ice-l); color: var(--navy); }
.qty .q-in:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px #c4e7ea; }
.cart .ct { width: 74px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Segments / pastilles ---------- */
.seg { display: flex; background: #dceaf1; border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.card .seg { margin-bottom: 0; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 4px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.small button { padding: 7px 2px; font-size: 13px; }
.remise-input { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.remise-input input { font-size: 20px; font-weight: 700; text-align: right; }
.remise-input span { font-size: 20px; font-weight: 700; width: 24px; }
.pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pills button { flex: 1 1 calc(33% - 8px); border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 12px 6px; font-weight: 600; font-size: 14px; cursor: pointer; }
.pills button.on { border-color: var(--navy); background: var(--navy); color: #fff; }

/* ---------- Totaux ---------- */
.totals > div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals small { color: var(--ink2); }
.totals #row-rist b, .totals #row-remise b { color: var(--green); }
.totals .grand { border-top: 1.5px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 19px; }

/* ---------- Barre de validation ---------- */
.paybar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 30;
  height: var(--paybar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(2, 40, 54, .08); }
.paybar small { display: block; color: var(--ink2); font-size: 12px; }
.paybar b { font-size: 24px; font-variant-numeric: tabular-nums; }
.paybar .btn { flex: 0 0 auto; }
.paybar > div { flex: 1; min-width: 0; }
.paybar .btn.big { padding: 13px 14px; font-size: 16px; }
.paybar .btn.attente { background: var(--amber-l); border-color: var(--amber-l); color: var(--amber-d); }
.paybar .btn.attente:disabled { opacity: .45; }

/* ---------- Onglets ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; display: flex; background: var(--navy);
  padding-bottom: var(--safe-b); height: calc(var(--tabs-h) + var(--safe-b)); }
.tabs button { flex: 1; border: 0; background: transparent; color: #8fb3c4; font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.tabs button i { font-style: normal; font-size: 20px; filter: grayscale(1); opacity: .7; }
.tabs button.on { color: #fff; }
.tabs button.on i { filter: none; opacity: 1; }

/* ---------- Synthèse ventes ---------- */
.sum-main { display: grid; grid-template-columns: .7fr 1fr 1fr; gap: 8px; }
.sum-main > div { background: var(--bg); border-radius: 10px; padding: 8px; }
.sum-main small { display: block; color: var(--ink2); font-size: 12px; }
.sum-main b { font-size: 17px; font-variant-numeric: tabular-nums; }
.sum-main .hl { background: var(--navy); color: #fff; }
.sum-main .hl small { color: #bddeed; }
.sum-sub { font-size: 13px; color: var(--ink2); margin-top: 8px; }
details summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details summary::after { content: "▾"; color: var(--ink2); }
details[open] summary::after { content: "▴"; }
details summary::-webkit-details-marker { display: none; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl td { padding: 6px 0; border-top: 1px solid var(--line); }
.tbl td.r { text-align: right; white-space: nowrap; padding-left: 8px; }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0 0 12px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list:empty { display: none; }
.list li { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li.click { cursor: pointer; }
.list li.click:active { background: var(--amber-l); }
.list .li-main { flex: 1; min-width: 0; }
.list .li-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .li-main small { color: var(--ink2); }
.list .li-right { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .li-right small { display: block; font-weight: 400; color: var(--ink2); }
.list li.off { opacity: .5; }
.list li.annul .li-right { text-decoration: line-through; color: var(--red); }
.dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
/* Poignée de glisser-déposer (6 points) : zone tactile de 36 × 44 px minimum */
.grip { flex: none; width: 36px; align-self: stretch; min-height: 44px; margin: -11px 0 -11px -12px;
  display: flex; align-items: center; justify-content: center; cursor: grab;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.grip::before { content: ""; width: 12px; height: 18px;
  background: radial-gradient(circle, #8aa7b4 1.7px, transparent 2.1px) 0 0 / 6px 6px; }
.grip:active { cursor: grabbing; }
.list.sorting { overflow: visible; }
.list.sorting li:not(.dragging) { transition: transform .15s ease; }
.list li.dragging { position: relative; z-index: 5; background: var(--card); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(2, 40, 54, .22); opacity: .97; }
.list li.dragging .grip { cursor: grabbing; }
body.no-select, body.no-select * { -webkit-user-select: none; user-select: none; }
.chk { width: 26px; height: 26px; flex: none; accent-color: var(--green); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--amber-l); color: var(--amber-d); margin-left: 4px; vertical-align: middle; }
.tag.g { background: #dcefe2; color: var(--green); }
.tag.r { background: #f6dcd9; color: var(--red); }
.who { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }
.journal { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.journal li { padding: 6px 0; border-top: 1px solid var(--line); }
.journal small { color: var(--ink2); }

/* ---------- Feuille modale ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(29, 26, 22, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 8px 18px calc(18px + var(--safe-b)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40%); opacity: .4; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 12px; }
.sheet .field { margin-bottom: 12px; }
.sheet .chkline { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 600; }
.sheet .actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet .actions .btn { flex: 1; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.colors button { width: 36px; height: 36px; border-radius: 10px; border: 3px solid transparent; cursor: pointer; }
.colors button.on { border-color: var(--navy); }
.ok-big { text-align: center; padding: 6px 0 4px; }
.ok-big .check { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; font-size: 34px;
  display: grid; place-items: center; margin: 0 auto 10px; }
.ok-big b { display: block; font-size: 32px; font-variant-numeric: tabular-nums; }
.detail-lines { list-style: none; padding: 0; margin: 10px 0; font-size: 15px; }
.detail-lines li { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 60;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  max-width: 90vw; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--red); }

/* ---------- Écrans plus larges (iPad, ordinateur) ---------- */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .pbtn { min-height: 72px; padding: 9px 8px 7px; }
  .pbtn .pn { font-size: 14px; }
  .paybar { padding: 0 max(16px, calc((100vw - 760px) / 2 + 16px)); }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 350px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
.click { cursor: pointer; }
input[type=checkbox].chk { -webkit-appearance: checkbox; appearance: auto; width: 26px; height: 26px; padding: 0; margin: 0; }

/* ---------- Hors ligne ---------- */
.net { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; background: var(--amber-l); color: var(--amber-d); white-space: nowrap; }
.net.off { background: #012836; color: #fff; }
.net.bad { background: #f6dcd9; color: var(--red); }
.ok-big .check.off { background: var(--amber); }
.note { background: var(--amber-l); color: var(--amber-d); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
.pending { border-color: var(--amber); background: #fffbea; }
.list.flat { border: 0; border-radius: 0; background: transparent; margin-bottom: 10px; }
.list.flat li { padding-left: 0; padding-right: 0; }
.pending .btn { width: 100%; }
.pending .li-right .btn { width: auto; display: block; margin-top: 4px; }

.pick { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; border: 2px dashed #a9bfca; position: relative; cursor: pointer;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.preview { margin-top: 6px; width: 25%; min-width: 86px; }
.preview .pbtn { display: flex; cursor: default; }

/* ---------- Rapprochement ---------- */
.list .li-main small b.pt { display: inline; font-weight: 700; color: var(--ink); white-space: nowrap; }
.exports { display: flex; gap: 8px; margin: 0 0 10px; }
.exports .btn { flex: 1; text-align: center; text-decoration: none; color: var(--ink); }
#pay-time { font-variant-numeric: tabular-nums; }
.sheet .actions { flex-wrap: wrap; }

/* ---------- Icônes et couleurs des boutons ---------- */
.pbtn .pn .pi { margin-right: 3px; text-shadow: none; }
.pills button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.15; }
.pills button .pi { font-size: 20px; line-height: 1; }
.pills button.c { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
/* type coloré choisi : anneau foncé + coche */
.pills button.c.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ink); font-weight: 800; }
.pills button.c.on::after { content: "✓"; position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--card); }
.preview-pay { margin-top: 8px; padding: 6px 4px; grid-template-columns: 1fr 1fr; gap: 14px; }
.preview-pay button { pointer-events: none; }
.dot.ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; line-height: 1; }
.dot.ico.blanc { background: #fff; border: 1.5px solid var(--line); }
.colors button.none { background: #fff linear-gradient(135deg, transparent 46%, #b3392f 46%, #b3392f 54%, transparent 54%); border-color: var(--line); }
.colors button.none.on { border-color: var(--navy); }
.icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 6px; }
.icons button { aspect-ratio: 1; min-height: 38px; border: 2px solid transparent; border-radius: 9px; background: var(--bg); font-size: 21px; line-height: 1; padding: 0; cursor: pointer; }
.icons button.on { border-color: var(--navy); background: #fff; }
.icons button.none { font-size: 18px; color: var(--ink2); }
.icon-free { margin-top: 6px; }

/* ---------- Ardoises ---------- */
.ardoises-btn { display: flex; align-items: center; gap: 6px; width: 100%; margin: -2px 0 12px; padding: 10px 12px;
  border: 1.5px dashed var(--amber); border-radius: 12px; background: #fffbea; color: var(--amber-d); font-weight: 700; font-size: 15px; cursor: pointer; text-align: left; }
.ardoises-btn b { background: var(--amber); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 13px; }
.ardoises-btn span { font-weight: 600; }
.ardoises-btn.vide { border-color: var(--line); color: var(--ink2); background: transparent; }
.ardoises-btn.vide b { background: var(--line); color: var(--ink2); }
.ardoise-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 12px; padding: 10px 12px;
  border-radius: 12px; background: var(--amber); color: #fff; }
.ardoise-banner small { display: block; font-size: 12px; opacity: .9; }
.ardoise-banner b { display: block; font-size: 18px; }
.ardoise-banner .btn { background: #fff; border-color: #fff; flex: none; }
#row-rist b { white-space: nowrap; }
#info { resize: none; overflow-y: auto; min-height: 0; max-height: 40vh; line-height: 1.35; }
textarea.need { border-color: var(--red); box-shadow: 0 0 0 3px #f6dcd9; }
.ardoises-card { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  border-color: var(--amber); background: #fffbea; font: inherit; color: var(--ink); font-weight: 700; }
.ardoises-card small { display: block; font-weight: 400; color: var(--ink2); font-size: 12px; }

.del-ard { display: block; margin: 6px 0 0 auto; padding: 4px 9px; }
.small-chk { margin: -4px 2px 12px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.small-chk .chk { width: 22px; height: 22px; }

/* ---------- Modification d'une vente ---------- */
.edit-card { border: 2px solid var(--navy); background: #fff; }
.edit-card .card-title { margin-bottom: 2px; }
.ed-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 6px; align-items: center; margin-top: 8px; }
.ed-row span { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: -2px; }
.ed-row input { padding: 9px 8px; font-size: 16px; min-width: 0; }
.edit-card > small { display: block; margin-top: 6px; font-size: 12px; }
.list .li-main small.li-info { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* Import FileMaker */
.import-card p { margin: 0 0 10px; }
.import-card .btn { display: inline-flex; }
.imp-stats { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 6px 0 10px; font-size: 15px; }
.imp-stats b { text-align: right; white-space: nowrap; }

.sheet .list li.imp { align-items: flex-start; }
.sheet .list li.imp.off { opacity: .55; }
.sheet .imp-note { display: block; color: var(--amber-d); }
.sheet .imp-motif { display: block; color: var(--red); }
.imp-warn { background: var(--amber-l); border-radius: 10px; padding: 8px 10px; font-size: 14px; margin: 0 0 10px; }
.imp-warn small { display: block; margin-top: 4px; }
.imp-assoc { background: var(--card, #fff); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.imp-assoc-t { font-weight: 700; margin-bottom: 2px; }
.imp-assoc p { margin: 0 0 8px; }
.imp-row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.imp-row span { font-weight: 600; }
.imp-row small { color: var(--ink2); font-weight: 400; }
.imp-row select { font-size: 16px; padding: 8px 32px 8px 10px; }
.imp-row.creer select { border-color: var(--amber); background-color: var(--amber-l); }
input[type=radio] { -webkit-appearance: auto; appearance: auto; width: 20px; height: 20px; padding: 0; margin: 0 8px 0 0; accent-color: var(--amber); flex: none; }
.field .chkline { font-weight: 400; color: var(--ink); margin-top: 6px; }
.btn.danger:disabled { opacity: .45; }

/* ============================================================
   Charte Waale : en-tête, marque, onglets, appel à l'action
   ============================================================ */
.top { background: linear-gradient(135deg, var(--navy-d) 0%, var(--navy) 55%, #0a5a6c 100%); border-bottom: 0; color: #fff;
  box-shadow: 0 2px 12px rgba(1, 40, 54, .25); }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; display: block; box-shadow: 0 0 0 2px rgba(189, 222, 237, .55); }
.brand.small { gap: 10px; }
#top-title { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; font-size: 16px; }
.day-total { background: var(--amber); color: var(--navy-d); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.day-total small { opacity: .8; font-weight: 600; }
.top .net { background: rgba(255, 255, 255, .16); color: #fff; }
.top .net.bad { background: #f6dcd9; color: var(--red); }

.login { background: radial-gradient(120% 80% at 50% 0%, #0a6672 0%, var(--navy) 45%, var(--navy-d) 100%); }
.login-card { box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.login-logo { display: block; width: 190px; height: auto; margin: -4px auto 4px; }
.login-sub { text-align: center; margin: 0; color: var(--ink2); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.login-card h2 { color: var(--navy); }

.card-title { color: var(--navy); }
.card-title.pad { text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--ink2); }
.card-title.pad .btn { text-transform: none; letter-spacing: 0; }

.tabs { background: var(--navy-d); box-shadow: 0 -2px 12px rgba(1, 40, 54, .25); }
.tabs button { position: relative; }
.tabs button.on { color: var(--amber); }
.tabs button.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--amber); }

#btn-valider { background: var(--amber); border-color: var(--amber); color: var(--navy-d); font-weight: 800; box-shadow: 0 3px 0 #b88a00; }
#btn-valider:disabled { background: #d3e0e6; border-color: #d3e0e6; color: #8aa3ae; box-shadow: none; }
.paybar .btn.attente { background: var(--ice-l); border-color: var(--ice); color: var(--navy); }
.paybar b { color: var(--navy); }

.ardoise-banner { color: var(--navy-d); }
.ardoises-btn { color: var(--amber-d); }
.ardoises-btn b { color: var(--navy-d); }
.ok-big .check.off { color: var(--navy-d); }
.edit-card .card-title { color: var(--navy); }
.totals .grand b { color: var(--navy); }
.sum-main .hl b { color: var(--amber); }

/* Aide à l'installation sur l'écran d'accueil */
.install-tip { background: var(--ice-l); border: 1px solid var(--ice); color: var(--navy); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 14px 0 0; line-height: 1.4; }
.ios-share { display: inline-block; width: 14px; height: 17px; vertical-align: -3px; margin: 0 1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 17'%3E%3Cpath d='M7 1v10M3.5 4.5 7 1l3.5 3.5M4.5 7.5H2v8.5h10V7.5H9.5' fill='none' stroke='%2302394d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }

/* Raccourcis de paiement dans la barre du bas */
.paybar { gap: 8px; }
.pb-tot { flex: 1; min-width: 0; }
.pb-pay { display: flex; gap: 4px; flex: none; }
.pb-pay:empty { display: none; }
.pb-pay button { width: 42px; height: 48px; padding: 2px 0 0; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; line-height: 1; }
.pb-pay button .pm-i { font-size: 19px; }
.pb-pay button small { font-size: 10.5px; font-weight: 800; letter-spacing: .02em; color: inherit; display: block; max-width: 40px; overflow: hidden; white-space: nowrap; }
.pb-pay button:active { transform: scale(.94); }
.pb-pay button.on { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 2px var(--amber); }
.paybar .btn.attente { padding-left: 12px; padding-right: 12px; }
#btn-valider { padding-left: 14px; padding-right: 14px; }
@media (max-width: 599px) {
  .paybar .pb-txt { display: none; }               /* « En attente » réduit à son icône ⏸ sur téléphone */
  .paybar .btn.attente { font-size: 19px; padding: 10px 11px; }
  .paybar.pay3 { gap: 6px; padding: 0 12px; }
  .paybar.pay3 .pb-pay button { width: 39px; }
  .paybar.pay3 b { font-size: 20px; }
  .paybar.pay3 #btn-valider { padding-left: 12px; padding-right: 12px; }
}
.ic-pause { width: 16px; height: 16px; fill: currentColor; vertical-align: -2px; }
@media (max-width: 599px) { .paybar .btn.attente { min-width: 44px; height: 48px; padding: 0 12px; } .paybar .ic-pause { width: 18px; height: 18px; } }
#pb-net { display: block; white-space: nowrap; overflow: hidden; }

/* Réorganisation des cartes produits (appui long puis glisser) */
.pbtn { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.grid.tri .pbtn { transition: transform .15s; }
.pbtn-place { opacity: .25; outline: 2px dashed var(--navy); outline-offset: -2px; }
.pbtn-fantome { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; margin: 0;
  box-shadow: 0 12px 28px rgba(1, 40, 54, .35), 0 0 0 3px var(--amber); opacity: .95; }
.exports .btn.pdf { background: var(--navy); border-color: var(--navy); color: #fff; }
.exports { flex-wrap: wrap; }
.exports .btn { min-width: 0; }
.exports .btn.pdf { flex-basis: 100%; }
.ordre-note { margin: 12px 0 6px; }
#btn-ordre-commun { width: 100%; }

/* Utilisateur connecté, sous le titre de l'en-tête */
.top-t { display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; color: inherit; padding: 0; text-align: left; cursor: pointer; min-width: 0; line-height: 1.1; }
.top .top-user { color: var(--ice); font-size: 12px; font-weight: 600; letter-spacing: .01em; margin-top: 2px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .top-user:empty { display: none; }

/* Panier : bouton de suppression directe de la ligne */
.cart li { gap: 6px; }
.cart .ct { width: 66px; }
.cart .del-l { flex: none; width: 34px; height: 34px; border-radius: 9px; border: 0; background: #fbe7e4; color: var(--red);
  display: grid; place-items: center; padding: 0; cursor: pointer; }
.cart .del-l svg { width: 17px; height: 17px; }
.cart .del-l:active { transform: scale(.92); background: #f6d0ca; }
.cart .cn b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; font-size: 14.5px; }

/* ---------- Disposition des cartes (lignes, espaces vides) ---------- */
.cartes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cartes .grid { margin-bottom: 0; }
.g-fixe { gap: 6px; }
.pvide { min-height: 54px; border-radius: 10px; position: relative; }
.dispo .pvide { border: 2px dashed #a9c4d0; background: rgba(255, 255, 255, .5); }
.g-vide { border: 2px dashed #a9c4d0; border-radius: 10px; min-height: 40px; display: grid; place-items: center; color: var(--ink2); font-size: 13px; }
.dispo-bar { display: flex; justify-content: flex-end; margin: -4px 0 6px; }
.dispo-ouvrir { border: 0; background: none; color: var(--teal); font-weight: 700; font-size: 13px; padding: 4px 2px; cursor: pointer; }
.dispo-outils { display: none; }
.dispo-bar.on { display: block; position: sticky; top: calc(56px + var(--safe-t)); z-index: 15; background: var(--card); border: 1.5px solid var(--teal);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; box-shadow: 0 6px 18px rgba(1, 40, 54, .15); }
.dispo-bar.on .dispo-ouvrir { display: none; }
.dispo-bar.on .dispo-outils { display: block; }
.dispo-outils b { color: var(--navy); }
.dispo-outils p { margin: 4px 0 8px; font-size: 13px; color: var(--ink2); line-height: 1.35; }
.dispo-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.dispo-btns .btn { flex: 1 1 auto; }
.ctl-ex { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; }
.dispo .pbtn, .dispo .pvide { cursor: grab; touch-action: none; }
.dispo .pbtn { animation: tremble .35s infinite alternate ease-in-out; }
.dispo .pbtn:nth-child(2n) { animation-delay: .17s; }
@keyframes tremble { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }
.tri .pbtn, .tri .pvide { animation: none; }
.ctl { position: absolute; z-index: 2; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #fff; padding: 0;
  font-size: 13px; font-weight: 800; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.ctl-br { top: -8px; left: -6px; background: var(--navy); color: #fff; }
.ctl-del { top: -8px; right: -6px; background: var(--red); color: #fff; }
.dispo .pbtn .pn { padding-left: 10px; }
/* lignes de 5 ou 6 cartes : texte plus petit, mots non coupés au milieu */
.g-n5 .pbtn, .g-n6 .pbtn { padding: 5px 4px 4px; }
.g-n5 .pbtn .pn { font-size: 11px; padding-right: 2px; word-break: normal; overflow-wrap: anywhere; hyphens: auto; }
.g-n6 .pbtn .pn { font-size: 10px; padding-right: 0; word-break: normal; overflow-wrap: anywhere; hyphens: auto; letter-spacing: -.01em; }
.g-n5 .pbtn .pp, .g-n6 .pbtn .pp { font-size: 10px; }
@media (min-width: 600px) { .g-n5 .pbtn .pn, .g-n6 .pbtn .pn { font-size: 13px; } }
