/* CDF Bar - lot 1. Vert fleuve (Maroni) et rouge balisier, tablette d'abord. */
:root {
  --bg: #e9efeb;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --ink: #14231d;
  --muted: #56675f;
  --line: #d0dad4;
  --primary: #0e5a48;
  --primary-hover: #0a4839;
  --on-primary: #ffffff;
  --accent: #c2362b;
  --on-accent: #ffffff;
  --ok: #1d7a4f;
  --warn: #9a6400;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 35, 29, .08), 0 4px 14px rgba(20, 35, 29, .06);
  --font: "Segoe UI", "Roboto", "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1613;
    --surface: #17221e;
    --surface-2: #1d2a25;
    --ink: #e6eee9;
    --muted: #9badA4;
    --line: #2b3a34;
    --primary: #3aa383;
    --primary-hover: #4bb894;
    --on-primary: #06120e;
    --accent: #e45a4d;
    --on-accent: #1a0503;
    --ok: #4cc28a;
    --warn: #e2a948;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.45 var(--font);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.num, .price, .total-amount { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 1.2em;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer;
  touch-action: manipulation; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--accent); border-color: currentColor; background: transparent; }
.btn-small { min-height: 38px; padding: 0 .9em; font-size: .92rem; }
.btn-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--primary); text-decoration: underline; cursor: pointer; font-weight: 600; }
.btn-block { width: 100%; }
.lbl-short { display: none; }

/* ---------- Ecrans d'identification ---------- */
.auth {
  min-height: 100dvh;
  display: grid; place-items: start center;
  padding: clamp(24px, 8vh, 96px) 20px 32px;
}
.auth-card { width: min(100%, 460px); }
.brand { margin-bottom: 28px; }
.brand-name {
  font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 700; letter-spacing: -.02em;
  color: var(--primary); margin: 0;
}
.brand-sub { color: var(--muted); margin: 4px 0 0; }
.field-label { display: block; font-weight: 600; margin-bottom: 8px; }
.input {
  width: 100%; min-height: 56px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 1.15rem;
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.input-code { text-transform: uppercase; letter-spacing: .25em; font-weight: 650; text-align: center; }
.hint { color: var(--muted); font-size: .92rem; margin-top: 8px; }
.results { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.results button {
  width: 100%; min-height: 56px; padding: 0 18px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font-size: 1.1rem; font-weight: 600; cursor: pointer;
}
.results button:hover { border-color: var(--primary); }
.who { font-size: 1.35rem; font-weight: 650; margin-bottom: 4px; }
.back-row { margin-top: 18px; text-align: center; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 4px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex: none; }

/* ---------- Pave numerique ---------- */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 20px; min-height: 18px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots span.on { background: var(--ink); border-color: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button {
  min-height: 64px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 1.5rem; font-weight: 600; cursor: pointer;
  touch-action: manipulation;
}
.keypad button:active { background: var(--surface-2); }
.keypad .key-ok { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-size: 1.1rem; }
.keypad .key-del { font-size: 1.1rem; color: var(--muted); }

/* ---------- Messages ---------- */
.notice { padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; font-weight: 500; }
.notice-error { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.notice-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.offline {
  position: sticky; top: 0; z-index: 30;
  background: var(--warn); color: #fff; text-align: center; padding: 10px 16px; font-weight: 600;
}

/* ---------- Ecran du bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(16px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-name { font-size: 1.15rem; font-weight: 650; margin-right: auto; }
.topbar-name small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }

.bar-layout {
  display: grid; gap: 24px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 340px;
  padding: 20px clamp(16px, 3vw, 28px) 32px;
  max-width: 1280px; margin: 0 auto;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; }
.sticky-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.sticky-head .topbar { position: static; background: none; backdrop-filter: none; border: 0; padding-bottom: 4px; }
.cats {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 6px clamp(16px, 3vw, 28px) 10px;
}
.cats::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; cursor: pointer; white-space: nowrap; touch-action: manipulation;
}
.cat-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.cat-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: .8rem; font-weight: 700;
}
.cat-section { scroll-margin-top: 140px; margin-bottom: 26px; }
.cat-title { font-size: 1.05rem; font-weight: 650; color: var(--muted); margin: 0 0 10px; }
.tile {
  position: relative;
  aspect-ratio: 18 / 25;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  outline: 3px solid transparent; outline-offset: 2px;
  transition: outline-color .15s ease;
}
.tile.has-qty { outline-color: var(--primary); }
.tile-add {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  background: none; cursor: pointer; touch-action: manipulation;
  transition: transform .08s ease;
}
.tile-add:active { transform: scale(.97); }
.tile-add:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tile-img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.tile-ph {
  display: grid; place-items: center; width: 100%; height: 100%; padding: 10px;
  text-align: center; font-size: 1.05rem; font-weight: 700; line-height: 1.2;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border: 2px dashed color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 16px;
}
.tile.is-out { box-shadow: none; }
.tile.is-out .tile-add { cursor: not-allowed; }
.tile.is-out .tile-img, .tile.is-out .tile-ph { filter: grayscale(1); opacity: .4; }
.tile-out {
  position: absolute; left: 8px; right: 8px; top: 42%;
  padding: 6px 0; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--bg);
  text-align: center; font-weight: 700; pointer-events: none;
}
.tile-qty {
  position: absolute; top: -10px; right: -10px;
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font-size: 1.15rem; font-weight: 700; box-shadow: var(--shadow);
}
.tile-minus {
  position: absolute; top: 6px; left: 6px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow);
  font-size: 1.6rem; line-height: 1; font-weight: 600; cursor: pointer;
  display: grid; place-items: center;
}

.panel {
  position: sticky; top: 140px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 18px;
}
.panel h2 { margin-bottom: 12px; }
.lines { list-style: none; margin: 0 0 12px; padding: 0; }
.lines li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line-name { flex: 1; min-width: 0; }
.line-btns { display: flex; gap: 6px; }
.line-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 1.25rem; font-weight: 600; line-height: 1; cursor: pointer;
  display: grid; place-items: center; touch-action: manipulation;
}
.line-btn:disabled { opacity: .35; cursor: not-allowed; }
.recap-toggle { display: none; }
.line-qty {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px;
  display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 700;
}
.lines .empty { color: var(--muted); border: 0; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 14px; }
.total-amount { font-size: 1.9rem; font-weight: 700; }
.panel-actions { display: grid; gap: 8px; }
.panel-actions .btn-primary { min-height: 60px; font-size: 1.15rem; }

.today { margin-top: 22px; }
.today h3 { font-size: 1rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.today ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.today li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; font-size: .95rem; }
.today .t-time { color: var(--muted); }
.today .t-amount { font-weight: 600; }
.today .t-cancel { grid-column: 2 / -1; justify-self: start; }
.today li.is-cancelled .t-summary, .today li.is-cancelled .t-amount { text-decoration: line-through; color: var(--muted); }

.flash-ok {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-bottom: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); font-weight: 600;
}
.banner-text { flex: 1 1 180px; }
.day-title { font-size: .98rem; font-weight: 650; color: var(--muted); margin: 16px 0 4px; text-transform: none; }
.day-title::first-letter { text-transform: uppercase; }
.ticket-list .t-cancel { grid-column: 2 / -1; justify-self: start; }

/* ---------- Releve ---------- */
.statement { max-width: 760px; margin: 0 auto; padding: 20px clamp(16px, 3vw, 28px) 40px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.month-nav strong { font-size: 1.2rem; text-transform: capitalize; }
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.sum-table { width: 100%; border-collapse: collapse; }
.sum-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sum-table td:last-child, .sum-table td.num { text-align: right; }
.sum-table tfoot td { border: 0; font-weight: 700; font-size: 1.15rem; padding-top: 12px; }
.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ticket-list li:last-child { border: 0; }
.ticket-list .when { color: var(--muted); font-size: .92rem; }
.ticket-list li.is-cancelled .what, .ticket-list li.is-cancelled .amount { text-decoration: line-through; color: var(--muted); }

/* ---------- Telephone : ecran simplifie ---------- */
@media (max-width: 899px) {
  .bar-layout { grid-template-columns: 1fr; padding-bottom: 140px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 25;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .12);
  }
  .panel h2 { display: none; }
  .bar-layout { padding-bottom: 200px; }
  .recap-toggle:not([hidden]) {
    display: flex; align-items: baseline; justify-content: space-between; width: 100%;
    padding: 0 2px 6px; border: 0; background: none; color: var(--muted);
    font-size: .88rem; font-weight: 600; cursor: pointer;
  }
  .recap-action { color: var(--primary); text-decoration: underline; }
  .panel .lines {
    display: flex; gap: 6px; margin: 0 -2px 10px; padding: 0 2px;
    overflow-x: auto; scrollbar-width: none;
  }
  .panel .lines::-webkit-scrollbar { display: none; }
  .panel .lines li {
    flex: none; gap: 6px; padding: 3px 12px 3px 3px; border: 0; border-radius: 999px;
    background: var(--surface-2); font-size: .92rem; font-weight: 600;
  }
  .panel .lines .line-qty { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; }
  .panel .lines .line-name { flex: none; }
  .panel .lines .line-btns, .panel .lines .empty { display: none; }
  .panel.open .lines { display: block; max-height: 42vh; overflow-y: auto; margin-bottom: 12px; }
  .panel.open .lines li { display: flex; padding: 6px 0; border-radius: 0; background: none; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .panel.open .lines .line-name { flex: 1; }
  .panel.open .lines .line-btns { display: flex; }
  .panel-actions { grid-template-columns: auto 1fr; }
  .today-wrap { order: 2; }
    .cat-title { display: none; }
  .catalogue { touch-action: pan-y; min-height: 60vh; }
  .tile-minus { width: 38px; height: 38px; font-size: 1.4rem; top: 4px; left: 4px; }
  .cat-section { margin-bottom: 12px; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .topbar { gap: 6px; }
  .topbar-name { font-size: 1rem; }
  .topbar .btn-small { padding: 0 .7em; }
}
@media (max-width: 380px) {
  .tile-minus { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Gestion : connexion et comite ---------- */
.admin-who { display: grid; line-height: 1.25; }
.admin-who .muted { font-size: .85rem; }
.admin-form select { min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.login-rescue { margin-top: 28px; }
.perm-list { display: grid; gap: 4px; }
.perm-list .check-line { min-height: 34px; font-weight: 500; }
.perm-tags .tag { margin: 2px 0; }
.card-form { margin-top: 28px; max-width: 920px; }

/* ---------- Gestion : produits ---------- */
.thumb-cell { width: 52px; }
.thumb { display: block; width: 40px; height: 54px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.thumb-ph { border: 1px dashed var(--line); }
.thumb-big { width: 120px; height: 166px; display: grid; place-items: center; text-align: center; padding: 6px; font-weight: 700; color: var(--muted); }
.brand-preview { object-fit: contain; background: #fff; }
.prod-photo { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.prod-photo > div { display: grid; gap: 10px; flex: 1; min-width: 220px; }
.admin-table tr.is-muted td { color: var(--muted); }

/* ---------- Gestion : version ---------- */
.app-version { font-size: .72em; font-weight: 600; color: var(--muted); margin-left: 4px; }

/* ---------- Gestion : tresorerie ---------- */
.amount-due { color: var(--accent); }
.amount-credit { color: var(--ok); }
.card-form h3 { font-size: 1rem; margin: 18px 0 8px; }

/* ---------- Gestion : pointage ---------- */
.bank-table td { vertical-align: top; }
.bank-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 430px; }
.bank-form select, .bank-form input[name="person"] { min-height: 36px; }
.bank-form input[name="person"] { flex: 1 1 220px; }

/* ---------- Gestion : commande hebdomadaire ---------- */
.order-form { max-width: 640px; }
.order-form h2 { margin: 18px 0 6px; font-size: 1.05rem; color: var(--primary); }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.qty-row.has-qty { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.qty-name { display: grid; gap: 2px; }
.qty-name .muted { font-size: .85rem; }
.qty-ctl { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-ctl input { width: 56px; min-height: 40px; text-align: center; font-size: 1.1rem; font-weight: 700; }
.qty-ctl .line-btn { width: 40px; height: 40px; font-size: 1.3rem; }
.nav-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .78rem; text-align: center; }
.plain-list { padding-left: 18px; }

/* ---------- Gestion : annuaire ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.page-head h1 { margin: 0; }
.admin-table a { color: var(--ink); text-decoration: none; }
.admin-table a:hover { color: var(--primary); text-decoration: underline; }
.fiche-form { display: grid; gap: 16px; max-width: 920px; }
.fiche-form fieldset {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px;
  margin: 0; padding: 16px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.fiche-form legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-weight: 700; color: var(--primary); }
.fiche-form label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.fiche-form input:not([type=checkbox]), .fiche-form select, .fiche-form textarea {
  min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-weight: 400; font-size: 1rem;
}
.fiche-form textarea { padding: 8px 10px; }
.fiche-form .wide { grid-column: 1 / -1; }
.fiche-form .hint { margin: -6px 0 0; }
.check-line { display: flex !important; align-items: center; gap: 8px; color: var(--ink) !important; align-self: end; min-height: 42px; }
.check-line input { width: 20px; height: 20px; accent-color: var(--primary); }
.inline-form input, .inline-form select { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.admin-table input:not([type=checkbox]), .admin-table select { min-height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); width: 100%; min-width: 120px; }
.wide-input { min-width: 260px; }
#enfants, .danger-zone { margin-top: 28px; }
.danger-zone { padding: 16px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-radius: var(--radius); max-width: 920px; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.card-stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; color: var(--muted); }
.stat-num { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.notice-warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
details { margin: 8px 0; background: var(--surface); border-radius: var(--radius-sm); padding: 10px 14px; }
details summary { cursor: pointer; font-weight: 600; }

/* ---------- Livre d'or ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 999px; background: var(--surface-2); }
.seg { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.gb-area { min-height: 110px; padding: 12px 14px; font-size: 1.05rem; line-height: 1.4; resize: vertical; }
.gb-under { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.gb-under .hint { margin: 6px 0 0; }
.gb-count { color: var(--muted); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gb-send { display: flex; justify-content: flex-end; margin-top: 10px; }
.gb-entry { padding: 12px 0; border-bottom: 1px solid var(--line); }
.gb-entry:last-child { border-bottom: 0; }
.gb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; font-size: .92rem; }
.gb-message { margin: 0; white-space: pre-line; }
.gb-reply { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .95rem; }
.gb-admin { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.gb-form { display: grid; gap: 8px; margin-top: 10px; max-width: 560px; }
.gb-form label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.gb-form select, .gb-form textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; }
.gb-form .btn { justify-self: start; }
.admin-main h2 { margin-top: 28px; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 700; }

/* ---------- Ambiance Maroni : frise inspiree de l'art tembe ---------- */
:root { --tembe: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2766%27%20height%3D%2722%27%20viewBox%3D%270%200%2066%2022%27%3E%3Crect%20width%3D%2766%27%20height%3D%2722%27%20fill%3D%27%2314231d%27/%3E%3Cpath%20d%3D%27M0%2011C11%200%2022%200%2033%2011S55%2022%2066%2011%27%20fill%3D%27none%27%20stroke%3D%27%23f2c230%27%20stroke-width%3D%274%27/%3E%3Cpath%20d%3D%27M0%2011C11%2022%2022%2022%2033%2011S55%200%2066%2011%27%20fill%3D%27none%27%20stroke%3D%27%23c8102e%27%20stroke-width%3D%274%27/%3E%3Cpath%20d%3D%27M0%2011C11%205%2022%205%2033%2011S55%2017%2066%2011%27%20fill%3D%27none%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%271.6%27/%3E%3Ccircle%20cx%3D%2733%27%20cy%3D%2711%27%20r%3D%273%27%20fill%3D%27%233aa35b%27/%3E%3Ccircle%20cx%3D%270%27%20cy%3D%2711%27%20r%3D%273%27%20fill%3D%27%233aa35b%27/%3E%3Ccircle%20cx%3D%2766%27%20cy%3D%2711%27%20r%3D%273%27%20fill%3D%27%233aa35b%27/%3E%3Ccircle%20cx%3D%2716.5%27%20cy%3D%273.5%27%20r%3D%271.6%27%20fill%3D%27%23ffffff%27/%3E%3Ccircle%20cx%3D%2749.5%27%20cy%3D%2718.5%27%20r%3D%271.6%27%20fill%3D%27%23ffffff%27/%3E%3C/svg%3E"); --head: #0e5a48; }
@media (prefers-color-scheme: dark) { :root { --head: #0b4a3b; } }
.sticky-head { background: var(--head); border: 0; color: #fff; }
.sticky-head::after { content: ""; display: block; height: 22px; background: var(--tembe) repeat-x; background-size: 66px 22px; }
.sticky-head .topbar { color: #fff; }
.sticky-head .topbar-name, .sticky-head .topbar-name small { color: #fff; }
.sticky-head .topbar-name small { opacity: .8; }
.sticky-head .topbar-name::before { content: "Comité des fêtes de Saint-Laurent-du-Maroni"; display: block; font-size: .78rem; font-weight: 600; opacity: .8; }
.sticky-head .topbar .btn { background: rgba(255, 255, 255, .16); border-color: transparent; color: #fff; }
.sticky-head .topbar .btn:hover { background: rgba(255, 255, 255, .26); }
.sticky-head .topbar .btn-quiet { background: none; color: rgba(255, 255, 255, .85); }
.sticky-head .cat-chip { background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff; }
.sticky-head .cat-chip[aria-pressed="true"] { background: #fff; color: #0e5a48; }
.sticky-head :focus-visible { outline-color: #f2c230; }
.cat-title { color: var(--primary); }
.tile.has-qty { outline-color: var(--accent); }
.panel { overflow: hidden; padding-top: 30px; }
.panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: var(--tembe) repeat-x; background-size: 36px 12px; }
.brand::after { content: ""; display: block; width: 132px; height: 14px; margin-top: 14px; border-radius: 3px; background: var(--tembe) repeat-x; background-size: 42px 14px; }
.cat-section { scroll-margin-top: 160px; }
.panel { top: 160px; }
@media (max-width: 899px) {
  .sticky-head::after { height: 16px; background-size: 48px 16px; }
  .sticky-head .topbar-name::before { content: "Comité des fêtes"; }
  .panel { top: auto; padding-top: 22px; }
  .catalogue { overflow-x: hidden; padding: 12px 12px 0; margin: -12px -12px 0; }
}

/* ---------- Caisse barman ---------- */
.caisse-layout { grid-template-columns: minmax(0, 1fr) 380px; }
.caisse-panel { max-height: calc(100dvh - 180px); overflow-y: auto; overflow-x: hidden; }
.caisse-panel h2 { font-size: 1rem; color: var(--muted); margin: 14px 0 8px; }
.caisse-panel h2:first-of-type { margin-top: 0; }
.caisse-panel .lines li { gap: 8px; }
.caisse-panel .line-name { flex: 1; }
.caisse-panel .price { white-space: nowrap; }
.tile-price {
  position: absolute; right: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(20, 35, 29, .82); color: #fff; font-size: .85rem; font-weight: 700; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.client-search .results { margin: 6px 0; max-height: 260px; overflow-y: auto; }
.client-search .results button { min-height: 46px; font-size: 1rem; }
.client-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-chip {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.client-chip strong { display: block; font-size: 1.05rem; }
.client-chip .muted { font-size: .85rem; }
.seg-wide { display: flex; width: 100%; margin: 12px 0 8px; }
.seg-wide .seg { flex: 1; min-height: 46px; padding: 0 8px; white-space: nowrap; }
.seg:disabled { opacity: .4; cursor: not-allowed; }
.caisse-panel .input { min-height: 46px; font-size: 1rem; }
.caisse-panel .panel-actions { margin-top: 12px; grid-template-columns: auto 1fr; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.modal-card { width: min(100%, 720px); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--bg); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal-head h2 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.form-grid label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.caisse-tickets li { grid-template-columns: 56px 1fr auto; }
.caisse-tickets .t-cancel { grid-column: 2 / -1; justify-self: start; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 560px); padding: 12px 18px; border-radius: var(--radius); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast-ok { background: var(--ok); color: #fff; }
.toast-error { background: var(--accent); color: #fff; }
@media (max-width: 899px) {
  .caisse-layout { grid-template-columns: 1fr; padding-bottom: 32px; }
  .page-caisse .caisse-panel { position: static; max-height: none; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding-top: 30px; }
  .page-caisse .caisse-panel h2 { display: block; }
  .page-caisse .caisse-panel .lines { display: block; }
  .page-caisse .caisse-panel .lines li { display: flex; background: none; border-radius: 0; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .page-caisse .caisse-panel .line-btns { display: flex; }
  .page-caisse .cat-title { display: block; }
  .page-caisse .cat-section { display: block !important; }
}
.admin-table td.actions { display: table-cell; white-space: nowrap; }
.admin-table td.actions > form { display: inline-block; margin: 2px 6px 2px 0; vertical-align: middle; }
.admin-table td.actions > a { display: inline-flex; margin: 2px 6px 2px 0; vertical-align: middle; }

/* ---------- Gestion ---------- */
.page-admin { font-size: 16px; }
.admin-narrow { max-width: 520px; margin: 0 auto; padding: 48px 20px; }
.admin-form { display: grid; gap: 10px; margin-top: 18px; }
.admin-form input, .inline-form input { min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.admin-bar nav { display: flex; flex-wrap: wrap; gap: 4px; margin-right: auto; }
.admin-bar nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-weight: 500; }
.admin-bar nav a[aria-current="page"] { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 650; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 24px; }
.filter { width: min(100%, 360px); min-height: 44px; padding: 0 12px; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { font-size: .85rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.admin-table .num { text-align: right; white-space: nowrap; }
.admin-table tr.is-cancelled td { color: var(--muted); text-decoration: line-through; }
.admin-table tfoot td { font-weight: 700; border: 0; }
.bar-col { width: 30%; }
.price-form { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.price-form input { width: 76px; min-height: 38px; padding: 0 8px; text-align: right; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.sale-bar { display: block; height: 10px; border-radius: 5px; background: var(--primary); min-width: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form, .admin-table form { margin: 0; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.tag-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tag-wait { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.tag-off { background: var(--surface-2); color: var(--muted); }
.tag-alert { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 20px; }
.code-reveal { border: 2px solid var(--primary); background: var(--surface); border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 24px; }
.code-value { font-size: 2.4rem; font-weight: 700; letter-spacing: .3em; color: var(--primary); margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.qr-sheet { background: #fff; color: #14231d; border-radius: var(--radius-lg); padding: 32px; text-align: center; max-width: 420px; box-shadow: var(--shadow); }
.qr-sheet #qr { display: inline-block; }
.qr-sheet .muted { color: #56675f; word-break: break-all; }
.qr-title { font-size: 1.5rem; font-weight: 700; margin: 18px 0 6px; }
@media print {
  .admin-bar, .admin-main > h1, .admin-main > p, .notice { display: none !important; }
  .qr-sheet { box-shadow: none; margin: 40px auto; }
  body { background: #fff; }
}
