/* EXTRAS RIAD — feuille de style. Mobile d'abord, zéro dépendance. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('/fonts/playfair.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #FBF7F1; --card: #FFFFFF; --ink: #1F1A17; --muted: #6B625A; --line: #E7DFD3;
  --green: #1E3D33; --green-soft: #E6EEE9; --terra: #B8552F; --terra-soft: #F7E6DE;
  --gold: #C69E63; --gold-soft: #F6EDDC; --red: #C62828; --red-soft: #FCE8E6; --ok: #1E8A5D;
  --radius: 14px; --shadow: 0 1px 2px rgba(31,26,23,.06), 0 6px 18px rgba(31,26,23,.06);
  --tap: 44px; --gutter: 16px; --tabs-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: Playfair, Georgia, serif; font-weight: 600; font-size: 1.35rem; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .6rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ic { width: 22px; height: 22px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.red { color: var(--red) !important; font-weight: 700; }

/* ---------- connexion ---------- */
body.auth { display: grid; place-items: center; min-height: 100dvh; padding: var(--gutter); }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow); text-align: center; }
.auth-logo { border-radius: 20px; }
.auth-kicker { margin: 12px 0 0; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.auth-card h1 { font-size: 2rem; margin-top: 2px; }
.auth-sub { color: var(--muted); margin-bottom: 18px; }
.auth-card form { text-align: left; }
.auth-card label { display: block; font-size: .85rem; font-weight: 600; margin: 12px 0 6px; }
.auth-card input { width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 54px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); padding: 0; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--green); background: var(--green-soft); }
.pw-eye .ic { width: 22px; height: 22px; }
.auth-card .auth-submit { margin-top: 22px; }
.auth-card label { margin-top: 14px; }
.alert { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: .9rem; }

/* ---------- coquille ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; background: var(--green); color: #fff; }
.top-back { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.top-title { flex: 1; min-width: 0; }
.top-kicker { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.top-title h1 { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-who { font-size: .8rem; opacity: .85; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { flex: 1; padding: 14px var(--gutter) calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); max-width: 760px; width: 100%; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); }
.tab-btn { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tab-btn.active { color: var(--green); }
.tab-btn.active .ic { stroke-width: 2.2; }

/* ---------- composants ---------- */
.btn { min-height: var(--tap); padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.accent { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #F0C9C5; background: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .tab-btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(198,158,99,.6); outline-offset: 2px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card.tap { cursor: pointer; }
.card.tap:active { transform: scale(.995); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.field textarea { min-height: 80px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.section-title { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.free { background: var(--green-soft); color: var(--green); }
.badge.busy { background: var(--gold-soft); color: #8A6A2E; }
.badge.due { background: var(--terra-soft); color: var(--terra); }
.badge.paid { background: #E3F3EA; color: var(--ok); }
.badge.cat { color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.amount { font-weight: 700; }
.amount.big { font-size: 1.5rem; font-family: Playfair, Georgia, serif; }
.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi > div { background: var(--card); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); }
.kpi .lbl { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .val { font-size: 1.1rem; font-weight: 700; margin-top: 2px; }
@media (max-width: 420px) { .kpi .val { font-size: .95rem; } .kpi .lbl { font-size: .66rem; } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.line-price { text-align: right; white-space: nowrap; }
.line-price small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.reason { font-size: .78rem; color: var(--red); font-style: italic; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; }
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.chip.cat.active { background: var(--chip-color, var(--green)); border-color: var(--chip-color, var(--green)); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; color: var(--green); }
.stepper input { width: 44px; height: 40px; border: 0; text-align: center; font-weight: 700; font-size: 16px; }
.price-input { width: 96px; min-height: 40px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; text-align: right; font-weight: 700; font-size: 16px; background: #fff; }
.price-input.red { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.sticky-foot { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); padding: 10px var(--gutter); z-index: 15; }
.sticky-foot .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.has-foot { padding-bottom: calc(var(--tabs-h) + 96px + env(safe-area-inset-bottom)); }
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.service-btn { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; min-height: 60px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.service-btn .nm { font-weight: 600; font-size: .92rem; }
.service-btn .pr { color: var(--muted); font-size: .85rem; }
.service-btn.added { border-color: var(--green); background: var(--green-soft); }
.service-btn .cnt { position: absolute; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table td.r, .table th.r { text-align: right; white-space: nowrap; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 8px; }
.menu-list button { width: 100%; min-height: 56px; background: none; border: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; text-align: left; font-weight: 600; }
.menu-list .desc { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.month-nav select { flex: 1; min-height: var(--tap); border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 10px; font-size: 16px; font-weight: 600; }
.segment { display: grid; grid-template-columns: 1fr 1fr; background: #EFE9E0; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.segment button { border: 0; background: none; min-height: 40px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.segment button.active { background: #fff; color: var(--green); box-shadow: var(--shadow); }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gold); }
.log-item { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.log-item .when { color: var(--muted); font-size: .75rem; }
.log-item.erreur { color: var(--red); }
.log-item.avertissement { color: #8A6A2E; }
.sheet-host { position: fixed; inset: 0; z-index: 50; background: rgba(31,26,23,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--paper); border-radius: 20px 20px 0 0; padding: 16px var(--gutter) calc(20px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
.sheet h2 { font-family: Playfair, Georgia, serif; font-size: 1.25rem; margin-bottom: 10px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 14px; }
.sheet .actions .btn { flex: 1; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem; z-index: 60; max-width: 90vw; box-shadow: var(--shadow); }
.toast.err { background: var(--red); }
@media (min-width: 720px) {
  .kpi { grid-template-columns: repeat(4, 1fr); }
  .service-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .topbar, .tabs, .sticky-foot { display: none; } .content { padding: 0; } }
@media (min-width: 720px) {
  .tabs { left: 50%; right: auto; width: 100%; max-width: 760px; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 16px 16px 0 0; }
}
/* recherche de prestations (écran Commande et gestion du catalogue) */
.search-box { position: relative; display: flex; align-items: center; margin: 14px 0 4px; }
.search-box .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; min-height: 50px; padding: 10px 44px 10px 42px; border: 2px solid var(--gold); border-radius: 14px; background: #fff; font-size: 16px; font-weight: 600; box-shadow: var(--shadow); }
.search-box input::placeholder { font-weight: 400; }
.search-clear { position: absolute; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--line); font-size: 1.2rem; line-height: 1; }
.list li.result { cursor: pointer; }
.list li.result .ic { color: var(--green); }
.badge.off { background: #EEE; color: var(--muted); }
.badge.sync { background: #E6EEF7; color: #2F5D8A; }
.card.pending { border-left: 4px solid #2F5D8A; }
.octo-urls { width: 100%; min-height: 84px; font-family: inherit; font-size: .9rem; }
.type-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.type-row:last-child { border-bottom: 0; }
.type-row select { max-width: 180px; }
.octo-state { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.octo-state.warn { background: var(--gold-soft); color: #8A6A2E; }
.octo-state.err { background: var(--terra-soft); color: var(--terra); }
.octo-report li { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.octo-report li:last-child { border-bottom: 0; }
.octo-report .k { font-weight: 700; margin-right: 6px; }
.filters-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.filters-row select { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px 10px; font-size: 15px; }
.tree-sub { padding-left: 10px; border-left: 3px solid var(--line); margin: 6px 0 10px; }
/* aucun défilement horizontal sur téléphone ; les menus déroulants restent dans leur colonne */
html, body { overflow-x: hidden; max-width: 100%; }
.filters-row > * { min-width: 0; }
.filters-row select { width: 100%; max-width: 100%; text-overflow: ellipsis; }
.grid-2 > * { min-width: 0; }
.field select { max-width: 100%; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* accès du personnel : mot de passe provisoire */
.prov { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.prov span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.prov b { font-family: ui-monospace, Menlo, monospace; font-size: 1.35rem; letter-spacing: .08em; }
.link-msg { font-family: Inter, system-ui, sans-serif; font-size: .92rem; line-height: 1.45; }

/* personnel : liste et formulaire façon caisse */
.plist .item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; min-height: 64px; cursor: pointer; }
.plist .item:last-child { border-bottom: 0; }
.plist .item:active { background: var(--green-soft); }
.plist .main { flex: 1; min-width: 0; }
.plist .t, .plist .s { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .t { font-weight: 700; }
.plist .s { font-size: .9rem; color: var(--muted); }
.plist .item > .ic { color: var(--muted); }
.thumb { width: 48px; height: 48px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { min-height: 48px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--green); box-shadow: var(--shadow); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; margin-bottom: 4px; }
.switch { appearance: none; width: 52px; height: 32px; border-radius: 999px; background: #D9D2C7; position: relative; cursor: pointer; border: 0; padding: 0; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; }

/* aperçu de la note des extras */
.note-preview { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); min-height: 200px; }
.note-preview img { display: block; width: 100%; height: auto; }
.note-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .9rem; background: #fff; }

/* ---- Historique des modifications ---- */
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border-bottom: 0; }
.audit-head { display: flex; gap: 10px; align-items: baseline; }
.audit-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; min-width: 64px; }
.audit-verb { font-weight: 600; }
.audit-obj { font-weight: 700; }
.audit-lines { margin: 6px 0 0 74px; padding: 0; list-style: none; font-size: .9rem; }
.audit-lines li { padding: 2px 0; }
.audit-raw { margin: 4px 0 0 74px; }
.audit-raw pre { font-size: .72rem; white-space: pre-wrap; word-break: break-all; background: #F4F1EB; border-radius: 8px; padding: 8px; max-height: 260px; overflow: auto; }
.act-creation .audit-verb { color: var(--ok); }
.act-archivage .audit-verb, .act-suppression .audit-verb, .act-annulation .audit-verb { color: var(--terra); }
.act-cloture .audit-verb { color: #2F5D8A; }
.audit-filters input[type=date], .audit-filters input[type=search] { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 16px; background: #fff; }
@media (max-width: 480px) { .audit-lines, .audit-raw { margin-left: 0; } }

/* ---------- espace du client (téléphone du client) ---------- */
body.guest { background: var(--paper); }
.guest-shell { max-width: 640px; margin: 0 auto; min-height: 100dvh; }
.g-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) var(--gutter) 18px; background: var(--green); color: #fff; }
.g-head h1 { margin: 2px 0 0; font-family: Playfair, Georgia, serif; font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.g-kicker { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.g-sub { margin: 4px 0 0; font-size: .88rem; opacity: .85; }
.g-lang { display: flex; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; flex: none; }
.g-lang button { min-width: 44px; min-height: 36px; border: 0; background: transparent; color: #fff; font-weight: 700; font-size: .8rem; }
.g-lang button.active { background: var(--gold); color: var(--green); }
.g-main { padding: 14px var(--gutter) 24px; }
.g-card p { margin: 0 0 12px; }
.g-room { font-family: Playfair, Georgia, serif; font-size: 1.15rem; color: var(--green); font-weight: 600; }
.g-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 5; }
.g-tabs button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--muted); }
.g-tabs button.active { background: var(--green); color: #fff; }
.g-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--terra); color: #fff; font-size: .75rem; margin-left: 4px; }
.g-search { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; margin-bottom: 10px; }
.g-cats { margin-bottom: 6px; }
.g-group h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 14px 2px 8px; }
.g-list { padding: 4px 14px; }
.g-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.g-item:last-child { border-bottom: 0; }
.g-name { font-weight: 600; }
.g-price { color: var(--terra); font-weight: 700; margin-top: 2px; }
.g-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; flex: none; }
.g-step button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.25rem; color: var(--green); font-weight: 700; }
.g-step span { min-width: 24px; text-align: center; font-weight: 700; }
.g-cart { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(608px, calc(100% - 2 * var(--gutter))); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; background: var(--green); color: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 10; }
.g-cart div { display: flex; flex-direction: column; font-size: .9rem; }
.g-total { display: flex; justify-content: space-between; align-items: center; background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.g-reason { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--terra-soft); color: var(--terra); font-size: .9rem; }
.g-when { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 0 0 12px; }
.g-when legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0 4px; }
.g-when label { display: flex; align-items: center; gap: 8px; min-height: 40px; flex-wrap: wrap; }
.g-when input[type=time] { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 16px; background: #fff; }
body.guest .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }

/* ---------- personnel : demandes des clients, QR codes des chambres ---------- */
.req-banner { background: var(--terra-soft); border: 1px solid #EFC9B8; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.req-banner h3 { margin: 0 0 8px; color: var(--terra); font-size: 1rem; }
.req-card { border-left: 4px solid var(--terra); }
.room-check { background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .9rem; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.qr-card { text-align: center; }
.qr-card svg { width: 100%; max-width: 220px; height: auto; display: block; margin: 8px auto; }
.qr-card h3 { margin: 0; font-family: Playfair, Georgia, serif; }
.tab-btn { position: relative; }
.tab-btn .tab-dot { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 999px; background: var(--terra); color: #fff; font-size: .7rem; display: grid; place-items: center; padding: 0 5px; }
@media print {
  body:not(.guest) .topbar, body:not(.guest) .tabs, .qr-actions, .no-print { display: none !important; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
  .qr-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
.req-card .badge, .qr-actions .btn { white-space: nowrap; }

/* ---------- commissions (écran réservé) ---------- */
.com-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.com-tabs button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); }
.com-tabs button.active { background: var(--green); color: #fff; }
.com-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.com-month { display: flex; align-items: center; gap: 6px; }
.com-month strong { min-width: 9.5em; text-align: center; font-size: 1.05rem; text-transform: capitalize; }
.com-hero { display: flex; flex-direction: column; gap: 4px; background: var(--green); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.com-hero-label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.com-hero-total { font-family: Playfair, Georgia, serif; font-size: 2.1rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.com-hero-split { font-size: .88rem; opacity: .9; }
.com-hero-wait { margin-top: 6px; align-self: flex-start; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 12px; font-size: .82rem; }
.com-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 18px; }
.com-person { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; font: inherit; color: inherit; }
.com-person:hover { border-color: var(--green); }
.com-person.active { border-color: var(--green); box-shadow: 0 0 0 2px var(--green) inset; }
.com-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 700; }
.com-person-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.com-person-name { font-weight: 600; }
.com-person-total { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.com-wait { color: var(--terra); }
.com-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.com-detail-head h3 { margin: 0; font-size: 1.05rem; flex: 1 1 auto; }
.com-sub { margin: 14px 2px 8px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.com-stay { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.com-stay > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; }
.com-stay > summary::-webkit-details-marker { display: none; }
.com-stay > summary::after { content: '›'; font-size: 1.3rem; color: var(--muted); transition: transform .15s; }
.com-stay[open] > summary::after { transform: rotate(90deg); }
.com-stay-head, .com-stay-sum { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.com-stay-sum { margin-left: auto; text-align: right; }
.com-stay .com-table-wrap, .com-stay .com-mobile { padding: 0 14px 12px; margin-top: 0; }
.com-help { margin: 16px 2px; } .com-help summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.com-cat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.com-cat > summary { padding: 12px 14px; cursor: pointer; }
.com-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 14px; background: var(--gold-soft); }
.com-bulk input, .com-rates input[type=text] { width: 64px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 16px; text-align: right; background: #fff; }
.com-rates-wrap { padding: 0 14px 12px; }
.com-rates { min-width: 520px; }
.com-rates td { vertical-align: middle; }
.com-saved { width: 24px; font-weight: 700; }
.com-saved.ok { color: var(--ok); } .com-saved.err { color: var(--red); }
@media (max-width: 640px) { .com-rates-wrap { display: block !important; } .com-hero-total { font-size: 1.8rem; } .com-month strong { min-width: 7.5em; } }
/* ---------- commissions : détail par séjour ---------- */
.com-block h3 { margin: 14px 2px 8px; font-size: 1rem; }
.com-stay { padding: 12px; }
.com-table-wrap { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.com-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.com-table th { text-align: left; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.com-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.com-table .num { text-align: right; white-space: nowrap; }
.com-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); }
.com-mobile { display: none; list-style: none; margin: 8px 0 0; padding: 0; }
.com-mobile li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.com-mobile li:last-child { border-bottom: 0; }
.com-mobile .com-total { border-top: 2px solid var(--line); }
.com-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.com-pills span { background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 3px 10px; font-size: .82rem; }
@media (max-width: 640px) { .com-table-wrap { display: none; } .com-mobile { display: block; } }
@media (max-width: 640px) {
  .com-stay > summary { flex-wrap: wrap; position: relative; padding-right: 34px; }
  .com-stay > summary::after { position: absolute; right: 14px; top: 14px; }
  .com-stay-sum { margin-left: 0; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: baseline; width: 100%; }
  .com-rates-wrap { padding: 0 10px 10px; }
  .com-rates { min-width: 0; }
  .com-rates thead, .com-rates .com-r-price { display: none; }
  .com-rates tr { display: grid; grid-template-columns: 1fr 1fr auto 24px; gap: 6px 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
  .com-rates td { border: 0; padding: 0; text-align: left; }
  .com-rates .com-r-name { grid-column: 1 / -1; }
  .com-rates td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
  .com-rates input[type=text] { width: 100%; }
}

/* commissions : relevé d'une réservation (sobre : filets fins, pas de fonds colorés) */
.com-statement { border-top: 1px solid var(--line); padding: 16px 18px 18px; display: grid; gap: 16px; }
.com-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.com-facts dt { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.com-facts dd { margin: 3px 0 0; font-variant-numeric: tabular-nums; }
.com-lines { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; table-layout: auto; }
.com-lines th { text-align: left; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 8px 8px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.com-lines th:first-child, .com-lines td:first-child { padding-left: 0; }
.com-lines th:last-child, .com-lines td:last-child { padding-right: 0; }
.com-lines td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.com-lines .num { text-align: right; white-space: nowrap; }
.com-lines .c-date { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.com-lines .c-seller { white-space: nowrap; color: var(--muted); }
.com-lines .c-pct { color: var(--muted); font-size: .76rem; margin-right: 6px; }
.com-lines sup { color: var(--muted); margin-left: 2px; }
.com-lines tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--ink); padding-top: 10px; }
.com-split { justify-self: end; width: min(100%, 320px); display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.com-split-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.com-split-row .c-role { color: var(--muted); font-size: .76rem; margin-left: 6px; }
.com-split-row.total { border-top: 1px solid var(--ink); padding-top: 6px; margin-top: 2px; font-weight: 600; }
.c-note { margin: 0; color: var(--muted); font-size: .76rem; }
@media (max-width: 640px) {
  .com-statement { padding: 14px; }
  .com-facts { grid-template-columns: 1fr 1fr; }
  .com-lines thead { display: none; }
  .com-lines, .com-lines tbody, .com-lines tfoot { display: block; }
  .com-lines tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .com-lines td { padding: 0 !important; border: 0 !important; }
  .com-lines .c-label { grid-column: 1; grid-row: 1 / span 2; }
  .com-lines .c-amount { grid-column: 2; grid-row: 1; }
  .com-lines .c-seller { grid-column: 1; grid-row: 3; font-size: .78rem; }
  .com-lines tbody .c-com { grid-column: 2; font-size: .82rem; }
  .com-lines tbody .c-com:nth-of-type(4) { grid-row: 2; }
  .com-lines tbody .c-com:nth-of-type(5) { grid-row: 3; }
  .com-lines tbody .c-com:nth-of-type(4) .c-pct::before { content: 'vendeur '; }
  .com-lines tbody .c-com:nth-of-type(5) .c-pct::before { content: 'manager '; }
  .com-lines tbody .c-none { display: none; }
  .com-lines tfoot tr { border-bottom: 0; border-top: 1px solid var(--ink); }
  .com-lines tfoot td:nth-child(n+3) { display: none; }
  .com-split { justify-self: stretch; width: auto; }
}
/* commissions sur ordinateur : pleine largeur, total et personnes à gauche (fixes), détail à droite */
@media (min-width: 1024px) {
  .content:has(> #view-commissions:not([hidden])) { max-width: 1280px; }
  .com-tabs { max-width: 520px; }
  .com-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
  .com-side { position: sticky; top: 84px; display: grid; gap: 0; max-height: calc(100vh - 170px); overflow: auto; padding-bottom: 8px; }
  .com-side .com-people { grid-template-columns: 1fr; }
  .com-main .com-detail-head { margin-top: 0; }
  .com-main .com-sub:first-of-type { margin-top: 8px; }
  #view-commissions .com-cat { max-width: 980px; }
}
@media (min-width: 1440px) { .content:has(> #view-commissions:not([hidden])) { max-width: 1400px; } .com-layout { grid-template-columns: 380px minmax(0, 1fr); } }

/* ---------- commissions : palette propre, contraste renforcé (WCAG AA et plus), indépendante du thème crème ---------- */
body:has(#view-commissions:not([hidden])) { background: #EEF1F4; }
#view-commissions {
  --ink: #0B1220; --muted: #3F4A5A; --line: #D3D9E1; --card: #FFFFFF; --paper: #F7F9FB;
  --green: #0F2A44; --green-soft: #E3EAF3; --ok: #046C4E; --terra: #9A4A00; --gold-soft: #FFF4DC;
  color: var(--ink);
}
#view-commissions .muted { color: var(--muted); }
#view-commissions .section-title { color: #1F2937; font-weight: 700; letter-spacing: .08em; }
#view-commissions .com-tabs { background: #FFFFFF; border-color: var(--line); }
#view-commissions .com-tabs button { color: #334155; font-weight: 600; }
#view-commissions .com-tabs button.active { background: #0F2A44; color: #FFFFFF; }
#view-commissions .btn { border-color: #B8C2CF; color: #0B1220; background: #FFFFFF; }
#view-commissions .btn:hover { border-color: #0F2A44; }
#view-commissions .com-month strong { font-size: 1.15rem; color: #0B1220; }
#view-commissions .com-hero { background: #0F2A44; box-shadow: 0 6px 20px rgba(15, 42, 68, .25); }
#view-commissions .com-hero-label { opacity: 1; color: #C7D6E8; font-weight: 600; }
#view-commissions .com-hero-total { font-family: Inter, system-ui, sans-serif; font-weight: 800; font-size: 2.3rem; letter-spacing: -.01em; }
#view-commissions .com-hero-split { opacity: 1; color: #E6EEF7; }
#view-commissions .com-hero-wait { background: #FFE8B8; color: #5B3300; font-weight: 600; }
#view-commissions .com-person { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(11, 18, 32, .06); }
#view-commissions .com-person:hover { border-color: #0F2A44; }
#view-commissions .com-person.active { border-color: #1D4ED8; box-shadow: 0 0 0 2px #1D4ED8 inset; background: #F5F8FF; }
#view-commissions .com-avatar { background: #0F2A44; color: #FFFFFF; }
#view-commissions .com-person-name { font-weight: 700; }
#view-commissions .com-person-total { font-size: 1.45rem; font-weight: 800; color: #0B1220; }
#view-commissions .com-wait { color: #9A4A00; font-weight: 600; }
#view-commissions .badge.sync { background: #DCE7F7; color: #0F2A44; }
#view-commissions .com-detail-head h3 { font-size: 1.15rem; font-weight: 700; }
#view-commissions .com-sub { color: #1F2937; }
#view-commissions .com-stay { border-color: var(--line); box-shadow: 0 1px 2px rgba(11, 18, 32, .05); }
#view-commissions .com-stay[open] { border-color: #9AA8BA; }
#view-commissions .com-stay > summary strong { font-size: 1rem; }
#view-commissions .com-stay-sum strong { font-size: 1.1rem; font-weight: 800; color: #046C4E; }
#view-commissions .com-stay > summary::after { color: #334155; }
#view-commissions .com-facts dt { color: #475569; font-weight: 600; }
#view-commissions .com-facts dd { font-weight: 600; color: #0B1220; }
#view-commissions .com-lines { font-size: .92rem; }
#view-commissions .com-lines th { color: #334155; font-weight: 700; border-bottom: 2px solid #0B1220; }
#view-commissions .com-lines td { border-bottom-color: #E2E7EE; }
#view-commissions .com-lines .c-amount { font-weight: 600; }
#view-commissions .com-lines .c-com { font-weight: 700; color: #046C4E; }
#view-commissions .com-lines .c-com .c-pct { color: #475569; font-weight: 500; }
#view-commissions .com-lines .c-seller, #view-commissions .com-lines .c-date { color: #475569; }
#view-commissions .com-lines tfoot td { border-top: 2px solid #0B1220; font-weight: 800; }
#view-commissions .com-split-row .c-role { color: #475569; }
#view-commissions .com-split-row.total { border-top: 2px solid #0B1220; font-weight: 800; color: #046C4E; }
#view-commissions .com-help summary { color: #334155; }
#view-commissions .com-cat { border-color: var(--line); }
#view-commissions .com-bulk { background: #FFF4DC; }
#view-commissions .com-rates input[type=text], #view-commissions .com-bulk input { border-color: #9AA8BA; color: #0B1220; font-weight: 600; }
#view-commissions .com-saved.ok { color: #046C4E; }
#view-commissions .octo-state.err { background: #FDECEC; color: #8A1C1C; }
