:root {
  --bg: #f3f4f6; --panel: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --primary: #1d4ed8; --primary-text: #fff; --danger: #b91c1c; --accent: #f59e0b; --sel: #dbeafe;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f172a; --panel: #1e293b; --text: #f1f5f9; --muted: #94a3b8; --line: #334155;
          --primary: #3b82f6; --sel: #1e3a8a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none; }
input, select { user-select: text; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: 6px 0; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: var(--radius);
  padding: 10px 14px; font-size: 15px; cursor: pointer; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
.btn.primary:disabled { opacity: .45; }
.btn.ghost { background: transparent; }
.btn.big { padding: 14px 20px; font-size: 17px; }
.btn.small { padding: 6px 10px; font-size: 13px; }

/* Login */
.screen { height: 100%; }
#login { display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { background: var(--panel); border-radius: 16px; padding: 24px; width: min(900px, 100%); max-height: 100%; overflow: auto; }
.login-box h1 { margin: 0 0 4px; }
.serveurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 16px; }
.serveurs button { padding: 18px 10px; font-size: 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer; }
.serveurs button small { display: block; color: var(--muted); margin-top: 4px; }

/* Barre du haut */
#pos { display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { white-space: nowrap; }
.modes { display: flex; gap: 6px; flex-wrap: wrap; }
.modes button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--text); cursor: pointer; font-weight: 600; }
.modes button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-actions input, .top-actions select { padding: 9px 10px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 15px; }
.top-actions input { width: 220px; }

/* Zone principale */
.main { flex: 1; display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
.left { display: flex; flex-direction: column; padding: 10px; min-height: 0; }
.crumbs { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.grid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(7, 1fr); gap: 6px; min-height: 0; }
.key { position: relative; border-radius: var(--radius); border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-size: 14px; font-weight: 600; line-height: 1.15; overflow: hidden; min-height: 54px; }
.key:active { filter: brightness(.9); transform: scale(.98); }
.key img { width: 28px; height: 28px; margin-bottom: 2px; }
.key .price { font-weight: 400; font-size: 12px; opacity: .85; margin-top: 3px; }
.key.group::after { content: "›"; position: absolute; right: 6px; top: 2px; font-size: 18px; opacity: .6; }
.key.empty { visibility: hidden; }
.results { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; align-content: start; }
.results .key { background: var(--panel); color: var(--text); min-height: 70px; }

/* Ticket */
.right { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 10px; gap: 8px; }
.ticket-head { font-weight: 700; }
.lines { list-style: none; margin: 0; padding: 0; flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); min-height: 80px; }
.lines li { display: grid; grid-template-columns: 40px 1fr auto; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.lines li.sel { background: var(--sel); }
.lines li .q { font-weight: 700; }
.lines li .u { grid-column: 2; font-size: 12px; color: var(--muted); }
.lines li.neg .t { color: var(--danger); }
.totals .row { display: flex; justify-content: space-between; padding: 2px 4px; }
.totals .total { font-size: 26px; font-weight: 800; }
.entry { display: flex; justify-content: space-between; border: 1px dashed var(--line); border-radius: var(--radius); padding: 6px 10px; font-size: 18px; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.keypad button { padding: 12px 0; font-size: 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.keypad button[data-k] { font-size: 14px; font-weight: 600; }
.keypad .danger { color: var(--danger); }
.actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }

/* Dialogues */
dialog { border: none; border-radius: 16px; padding: 0; background: var(--panel); color: var(--text); max-width: 96vw; }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dlg { padding: 20px; width: 480px; max-width: 96vw; }
.dlg.wide { width: 900px; max-height: 88vh; overflow: auto; }
.dlg h2 { margin: 0 0 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pay-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.pay-sum div { background: var(--bg); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; }
.pay-sum strong { font-size: 22px; }
.pay-input { width: 100%; font-size: 24px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.quick, .paymodes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.quick button { flex: 1; min-width: 60px; }
.paymodes button { flex: 1; min-width: 110px; padding: 16px 10px; font-weight: 700; }
.paylist { list-style: none; padding: 0; margin: 10px 0 0; }
.paylist li { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.journal-head { display: flex; gap: 10px; align-items: center; }
.journal-head h2 { margin: 0; margin-right: auto; }
.journal-head input { padding: 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin: 14px 0; }
.kpis div { background: var(--bg); border-radius: var(--radius); padding: 10px; }
.kpis strong { display: block; font-size: 22px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.receipt { font-family: "Consolas", "Courier New", monospace; font-size: 13px; white-space: pre-wrap; background: #fff; color: #000;
  padding: 14px; border-radius: 8px; max-height: 60vh; overflow: auto; }
/* Ecran d'accueil du personnel */
.wide-box { width: min(1100px, 100%); }
.login-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.login-head span { font-size: 22px; font-variant-numeric: tabular-nums; }
.staff-search { display: flex; gap: 8px; align-items: center; margin-top: 12px; position: sticky; top: 0; z-index: 2; background: inherit; }
.staff-search input { flex: 1; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 2px solid #c7d2fe; outline: none; }
.staff-search input::-webkit-search-cancel-button { display: none; }
.staff-search input:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px #e0e7ff; }
.staff-title { margin: 18px 0 0; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.serveurs button.on { border: 2px solid #16a34a; background: #f0fdf4; color: #14532d; }
.serveurs button.on small { color: #15803d; font-weight: 600; }
@media (prefers-color-scheme: dark) { .serveurs button.on { background: #052e16; color: #dcfce7; } .serveurs button.on small { color: #86efac; } }
.serveurs button .fn { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.pin { width: 360px; text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 12px; min-height: 26px; margin: 10px 0; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; background: var(--text); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-pad button { padding: 18px 0; font-size: 24px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.pin-pad button:active { transform: scale(.96); }
.pin-pad .muted-key { font-size: 15px; color: var(--muted); }
.user-actions { display: grid; gap: 10px; margin-top: 8px; }
.user-actions .btn small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.danger-btn { border-color: var(--danger); color: var(--danger); }

/* INDEX (hors CA) */
tr.hors td { color: #c2410c; }
.kpis .kpi-index { border: 2px solid #eb6834; }
/* Boutons de paiement : une couleur par mode (le libelle reste toujours affiche) */
.paymodes .pm { color: #fff; border: none; font-size: 17px; }
.paymodes .pm:hover { filter: brightness(1.08); }
.paymodes .pm-ESPECES { background: #15803d; }   /* Cash : vert */
.paymodes .pm-CR      { background: #1d4ed8; }   /* Credit client : bleu */
.paymodes .pm-VERS    { background: #7e22ce; }   /* Versement : violet */
.paymodes .pm-INDEX   { background: #c2410c; }   /* Index (hors CA) : orange */
.paymodes .hors-ca small { display: block; font-weight: 400; font-size: 11px; opacity: .9; }
/* meme couleur, en pastille, dans la liste des paiements saisis */
.paylist .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* Tables */
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.head-actions { display: flex; gap: 6px; }
.lines li.sent { opacity: .7; }
.lines li.sent .q::before { content: "✓ "; color: #16a34a; }
.lines li.empty { cursor: default; display: block; }
.actions.three { grid-template-columns: 1fr 1.2fr 1.4fr; }
.btn.active { border-color: var(--primary); color: var(--primary); }
.plan { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.plan-banner { background: #fef3c7; color: #78350f; border-radius: var(--radius); padding: 10px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.salles { display: flex; gap: 6px; flex-wrap: wrap; }
.salles button { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-weight: 600; }
.salles button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #111; font-size: 12px; }
.tables { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; align-content: start; }
.tbl { border-radius: 12px; border: 2px solid var(--line); padding: 10px 6px; min-height: 92px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--panel); color: var(--text); }
.tbl .num { font-size: 22px; font-weight: 800; }
.tbl .amt { font-weight: 700; }
.tbl .meta { font-size: 12px; color: var(--muted); }
.tbl.free { border-color: #86efac; }
.tbl.occ { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; }
.tbl.occ .meta { color: #991b1b; }
.tbl:active { transform: scale(.97); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff;
  padding: 12px 18px; border-radius: 999px; z-index: 50; }
.toast.err { background: var(--danger); }
#printArea { display: none; }

@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .right { border-left: none; border-top: 1px solid var(--line); }
  .lines { max-height: 25vh; }
  .top-actions input { width: 140px; }
}
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; width: 72mm; font-family: "Consolas", "Courier New", monospace; font-size: 11px; white-space: pre-wrap; color: #000; }
  @page { size: 80mm auto; margin: 3mm; }
}

/* =====================  THEME EN COULEURS  ===================== */
:root { --bg: #eef2ff; --primary: #2563eb; --sel: #dbeafe; --grad: linear-gradient(90deg, #1e3a8a, #2563eb 60%, #7c3aed); }
@media (prefers-color-scheme: dark) { :root { --bg: #0b1226; --sel: #1e3a8a; } }

/* barre du haut */
.topbar { background: var(--grad); color: #fff; border-bottom: none; box-shadow: 0 2px 10px rgba(30, 58, 138, .25); }
.topbar .muted { color: #c7d2fe; }
.topbar .modes button { border-color: rgba(255,255,255,.45); color: #fff; background: rgba(255,255,255,.08); }
.topbar .modes button.active { background: #fff; color: #1e3a8a; border-color: #fff; }
.topbar .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.topbar .btn:hover { background: rgba(255,255,255,.22); }
.topbar .btn.primary { background: #fbbf24; color: #1f2937; border-color: #fbbf24; }
.topbar .btn.active { background: #fff; color: #1e3a8a; border-color: #fff; }
.topbar input, .topbar select { background: rgba(255,255,255,.95); color: #111827; border-color: transparent; }

/* ecran d'accueil */
#login { background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 50%, #7c3aed 100%); }
.login-box { box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-box h1 { color: #1e3a8a; }
@media (prefers-color-scheme: dark) { .login-box h1 { color: #c7d2fe; } }
.serveurs button.staff { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel); transition: transform .08s, box-shadow .15s; }
.serveurs button.staff:hover { box-shadow: 0 6px 16px rgba(37, 99, 235, .18); transform: translateY(-1px); }
.serveurs .av { width: 46px; height: 46px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 17px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.serveurs button.on .av { box-shadow: 0 0 0 3px #22c55e; }
.banner { padding: 12px 14px; border-radius: 12px; margin: 10px 0; font-size: 15px; }
.banner.closed { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.banner.ok { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }

/* grille de boutons et plan des tables */
.left { background: transparent; }
.key { box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.salles button { background: #fff; }
.salles button.active { background: var(--grad); border-color: transparent; }
.tbl.free { background: linear-gradient(180deg, #f0fdf4, #dcfce7); border-color: #4ade80; color: #14532d; }
.tbl.occ { background: linear-gradient(180deg, #fee2e2, #fecaca); border-color: #ef4444; }
@media (prefers-color-scheme: dark) { .tbl.free { background: #052e16; color: #dcfce7; } .tbl.occ { background: #450a0a; color: #fee2e2; } }

/* ticket */
.right { background: var(--panel); }
.ticket-head { background: var(--grad); color: #fff; margin: -10px -10px 0; padding: 10px 12px; }
.ticket-head .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.totals .total { background: linear-gradient(90deg, #059669, #10b981); color: #fff; border-radius: 12px; padding: 8px 12px; margin-top: 4px; }
.keypad button { background: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .keypad button { background: #1e293b; } }
.keypad button[data-k="qte"] { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.keypad button[data-k="plus"] { background: #dcfce7; color: #166534; border-color: #86efac; }
.keypad button[data-k="minus"] { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.keypad button[data-k="c"] { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }
.keypad button[data-k="del"] { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
#btnPay { background: linear-gradient(90deg, #059669, #16a34a); border-color: #059669; }
#btnPay:disabled { opacity: .45; }
#btnSend { background: linear-gradient(90deg, #2563eb, #4f46e5); color: #fff; border-color: #2563eb; font-weight: 600; }
#btnCancel { background: #f1f5f9; }
@media (prefers-color-scheme: dark) { #btnCancel { background: #1e293b; } }

/* dialogues */
dialog { box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.dlg h2 { color: #1e3a8a; }
@media (prefers-color-scheme: dark) { .dlg h2 { color: #c7d2fe; } }
.pin-pad button { background: #fff; font-weight: 700; }
@media (prefers-color-scheme: dark) { .pin-pad button { background: #1e293b; } }
.pin-dots span { background: #4f46e5; }
#pinOk { background: linear-gradient(90deg, #059669, #16a34a); border-color: #059669; }
.pay-sum div:nth-child(1) { background: #e0e7ff; } .pay-sum div:nth-child(2) { background: #dcfce7; } .pay-sum div:nth-child(3) { background: #fef3c7; }
@media (prefers-color-scheme: dark) { .pay-sum div { background: #1e293b !important; } }
.toast { background: linear-gradient(90deg, #1e3a8a, #4f46e5); }

/* Client du ticket / TVA 0 % */
.client-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #eef2ff; color: #1e3a8a; font-weight: 600; }
.client-bar.exo { background: #dbeafe; border: 2px solid #2563eb; }
.client-bar .badge0 { background: #2563eb; color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.client-bar button { border: none; background: transparent; color: inherit; font-size: 16px; cursor: pointer; }
@media (prefers-color-scheme: dark) { .client-bar, .client-bar.exo { background: #1e3a8a; color: #dbeafe; } }
.wide-client { width: 560px; }
.toolbar-line { display: flex; gap: 8px; }
.toolbar-line .pay-input { flex: 1; font-size: 18px; }
/* pave tactile de la fenetre de saisie (prix / quantite) */
.num-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.num-pad button { font-size: 24px; font-weight: 700; padding: 14px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.num-pad button:active { background: #e0e7ff; }
.client-res { list-style: none; padding: 0; margin: 10px 0 0; max-height: 50vh; overflow: auto; }
.client-res li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.client-res li:hover { background: var(--sel); }
.client-res .badge0 { background: #2563eb; color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.lines li .u .ht { color: #2563eb; font-weight: 600; }

/* Nouveau client */
.client-form h3 { margin: 4px 0 10px; color: #1e3a8a; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.cf-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.cf-grid .span2 { grid-column: span 2; }
.cf-grid label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.cf-grid label.check small { color: var(--muted); }
.cf-grid input:not([type=checkbox]) { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 15px; }
.btn.add-client { background: linear-gradient(90deg, #059669, #16a34a); color: #fff; border-color: #059669; font-weight: 600; }
.client-res li.vide { cursor: default; background: transparent !important; }
.regime { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.reg { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; }
.reg input { margin-top: 3px; transform: scale(1.3); }
.reg span { display: flex; flex-direction: column; gap: 2px; }
.reg small { color: var(--muted); font-size: 12px; }
.reg.local:has(input:checked) { border-color: #16a34a; background: #f0fdf4; }
.reg.exo:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
@media (prefers-color-scheme: dark) { .reg.local:has(input:checked), .reg.exo:has(input:checked) { background: #1e293b; } }

.key.key-index { background: linear-gradient(180deg, #fed7aa, #fdba74); color: #7c2d12; border-color: #ea580c; }


/* Ventes en attente */
.actions { grid-template-columns: 1fr 1fr 1.6fr; }
.actions:has(#btnReprendre:not(.hidden)) { grid-template-columns: 1fr 1fr 1fr 1.6fr; }
.btn.attente { background: #fef3c7; color: #92400e; border-color: #fcd34d; font-weight: 600; }
.btn.reprendre { background: linear-gradient(90deg, #f59e0b, #d97706); color: #fff; border-color: #d97706; font-weight: 700; }
@media (prefers-color-scheme: dark) { .btn.attente { background: #451a03; color: #fde68a; } }


/* Rapport A4 au-dessus de la caisse */
.rapport-dlg { width: 96vw; height: 94vh; max-width: 96vw; max-height: 94vh; padding: 0; border-radius: 12px; overflow: hidden; }
.rapport-dlg iframe { width: 100%; height: 100%; border: 0; display: block; }


/* Z et Mes heures */
.btn.z-caisse { background: linear-gradient(90deg, #b91c1c, #dc2626); color: #fff; border-color: #b91c1c; font-weight: 700; }
.btn.z-caisse:disabled { opacity: .45; }
.seg-mini { display: flex; gap: 6px; margin-bottom: 8px; }
tr.tot-h td { font-weight: 800; border-top: 2px solid var(--line); }
#zDlg .dlg, #heuresDlg .dlg { width: 560px; }
.check-line { display: flex; gap: 8px; align-items: center; margin: 10px 0; font-weight: 600; }


/* Onglet liste (FOURNISSEURS...) : recherche + pages */
.crumbs { flex-wrap: wrap; }
.liste-outils { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.liste-outils input { padding: 8px 12px; border-radius: 10px; border: 2px solid #93c5fd; min-width: 240px; font-size: 15px; background: var(--panel); color: var(--text); }
.pager { display: flex; gap: 4px; }
.pager .btn { min-width: 40px; font-weight: 700; }
.pager .btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.key.key-liste { background: linear-gradient(180deg, #f1f5f9, #e2e8f0); color: #0f172a; }


/* Bowling OPEN / FAC */
.sous-onglets { display: inline-flex; border: 2px solid #2563eb; border-radius: 999px; overflow: hidden; }
.sous-onglets button { border: none; background: var(--panel); color: #1e3a8a; font-weight: 800; padding: 8px 18px; cursor: pointer; font-size: 15px; }
.sous-onglets button.on { background: var(--grad); color: #fff; }
@media (prefers-color-scheme: dark) { .sous-onglets button { color: #bfdbfe; } }


/* ✕ sur les lignes du ticket */
.lines li { grid-template-columns: 40px 1fr auto 34px; align-items: center; }
.lines li .u { grid-column: 2 / span 2; }
.del-l { grid-row: 1 / span 2; grid-column: 4; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #fca5a5; background: #fee2e2; color: #b91c1c; font-weight: 800; cursor: pointer; font-size: 14px; }
.del-l:hover { background: #fecaca; }
.lines-bar { display: flex; justify-content: flex-end; min-height: 0; }
.tout-annuler { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; font-weight: 700; }
/* Retour d'articles (montants negatifs) */
.btn-retour { font-weight: 700; color: #b91c1c; border-color: #fca5a5; }
.btn-retour.active { background: #dc2626; color: #fff; border-color: #dc2626; }
.retour-bar { padding: 8px 10px; border-radius: 10px; background: #dc2626; color: #fff; font-weight: 800; text-align: center; letter-spacing: .3px; }
.right.retour .lines li .t { color: #dc2626; }
.right.retour .totals .row.total { background: #dc2626; color: #fff; }
.right.retour .totals .row.total #total { color: #fff; }
#btnPay.rembourser { background: #dc2626; border-color: #dc2626; }
.pay-retour { background: #dc2626; color: #fff; padding: 8px 10px; border-radius: 8px; font-weight: 700; margin-bottom: 8px; }


/* Familles en bas a gauche */
.left { gap: 8px; }
.modes.modes-bas { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin: 0 -10px -10px; background: var(--grad); border-top-right-radius: 14px; box-shadow: 0 -2px 10px rgba(30,58,138,.2); }
.modes.modes-bas button { flex: 1 1 auto; min-width: 110px; padding: 14px 16px; font-size: 15px; font-weight: 800; letter-spacing: .02em; border-radius: 12px; border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.modes.modes-bas button:hover { background: rgba(255,255,255,.22); }
.modes.modes-bas button.active { background: #fff; color: #1e3a8a; border-color: #fbbf24; box-shadow: 0 0 0 2px #fbbf24; }


/* Familles : bande pleine largeur en haut (gros boutons) */
.modes.modes-bande { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 14px; background: var(--grad); border-top: 1px solid rgba(255,255,255,.25); box-shadow: 0 3px 10px rgba(30,58,138,.25); }
.modes.modes-bande button { flex: 1 1 auto; min-width: 120px; padding: 14px 18px; font-size: 16px; font-weight: 900; letter-spacing: .06em; border-radius: 12px; border: 2px solid rgba(255,255,255,.55); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.modes.modes-bande button:hover { background: rgba(255,255,255,.22); }
.modes.modes-bande button.active { background: #fff; color: #1e3a8a; border-color: #fbbf24; box-shadow: 0 0 0 2px #fbbf24; }
/* une couleur par famille : bouton plein ; famille choisie = cadre blanc + halo jaune */
.modes.modes-bande button[style*="--c"] { background: var(--c); border-color: rgba(255,255,255,.35); text-shadow: 0 1px 2px rgba(0,0,0,.25); opacity: .88; transition: transform .1s, opacity .1s; }
.modes.modes-bande button[style*="--c"]:hover { opacity: 1; filter: brightness(1.08); }
.modes.modes-bande button[style*="--c"].active { background: var(--c); color: #fff; opacity: 1; border: 3px solid #fff; box-shadow: 0 0 0 3px #fbbf24, 0 6px 14px rgba(0,0,0,.3); transform: translateY(-2px); }

