/* ==========================================================================
   MonDabali — Espace restaurateur
   Design system : mobile first (360 px), puis tablette (768 px) et ordinateur (1024 px).
   Palette officielle MonDabali. Aucune dépendance externe hors police Inter.
   ========================================================================== */

:root {
  /* Couleurs de marque */
  --color-primary: #087443;
  --color-primary-dark: #075B36;
  --color-primary-light: #E8F6EF;
  --color-accent: #FF8A00;
  --color-accent-dark: #E67A00;
  --color-accent-light: #FFF3E0;
  --color-accent-text: #8A4B00;

  /* Surfaces et textes */
  --color-background: #F5F7F6;
  --color-surface: #FFFFFF;
  --color-border: #E3E8E5;
  --color-border-strong: #CBD3CE;
  --color-text: #17221C;
  --color-text-muted: #66736B;

  /* États */
  --color-danger: #D92D20;
  --color-danger-light: #FDECEA;
  --color-info: #1D5FA8;
  --color-info-light: #EAF2FB;

  /* Espacements (grille de 4 px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Arrondis : moderne, sans effet "cartoon" */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Ombres très légères */
  --shadow-sm: 0 1px 2px rgba(23, 34, 28, 0.06);
  --shadow-md: 0 2px 8px rgba(23, 34, 28, 0.08);
  --shadow-lg: 0 8px 24px rgba(23, 34, 28, 0.12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-height: 64px;
  --sidebar-width: 248px;
  --focus-ring: 0 0 0 3px rgba(8, 116, 67, 0.28);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; line-height: 24px; font-weight: 600; }
h3 { font-size: 16px; line-height: 22px; font-weight: 600; }
.muted { color: var(--color-text-muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.icon { width: 22px; height: 22px; flex-shrink: 0; }
.icon-sm { width: 18px; height: 18px; flex-shrink: 0; }
p .icon-sm, .row-meta a .icon-sm { vertical-align: -4px; }
.row-meta a { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }

/* ---------- Structure : barre latérale (ordinateur) + barre d'onglets (mobile) ---------- */
.shell { min-height: 100vh; }
.main { min-width: 0; }

.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-3);
  height: 60px; padding: 0 var(--space-4);
  background: var(--color-primary-dark);
  color: #fff;
}
.topbar-brand { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex: 1; color: #fff; }
.topbar-brand:hover { text-decoration: none; }
.topbar-titles { min-width: 0; }
.topbar-app { font-size: 16px; font-weight: 700; line-height: 20px; letter-spacing: -0.01em; }
.topbar-resto {
  font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.78);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: var(--space-1); }
.topbar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: #fff; font-size: 13px; font-weight: 500;
}
.topbar-btn:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; }
.topbar-btn .label { display: none; }

.logo-mark { width: 32px; height: 32px; flex-shrink: 0; }

.content {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) calc(var(--tabbar-height) + var(--space-6));
}

/* Barre d'onglets en bas (mobile / tablette) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 10px rgba(23, 34, 28, 0.05);
}
.tab {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 11px; font-weight: 500;
}
.tab:hover { text-decoration: none; color: var(--color-text); }
.tab .icon { width: 24px; height: 24px; }
.tab.active { color: var(--color-primary); font-weight: 600; }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--color-primary);
}
.tab-badge, .nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-accent); color: var(--color-text);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); }

/* ---------- En-tête de page ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.page-head p { margin-top: 2px; color: var(--color-text-muted); font-size: 14px; }
.page-head .btn { flex-shrink: 0; }

.section { margin-top: var(--space-5); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.section-title h2 { font-size: 16px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-5);
  border: 1px solid transparent; border-radius: 10px;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
/* Orange : texte sombre pour garder un contraste lisible (le blanc sur #FF8A00 est insuffisant). */
.btn-accent { background: var(--color-accent); color: var(--color-text); }
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-outline { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-border-strong); }
.btn-outline:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-background); color: var(--color-text); }
.btn-danger { background: var(--color-surface); color: var(--color-danger); border-color: #F3C3BE; }
.btn-danger:hover { background: var(--color-danger-light); }
.btn-whatsapp { background: #128C4B; color: #fff; }
.btn-whatsapp:hover { background: #0E7A40; }
.btn-sm { min-height: 40px; padding: 0 var(--space-4); font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--color-border); border-radius: 10px;
  background: var(--color-surface); color: var(--color-text-muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--color-primary); border-color: var(--color-primary); background: var(--color-primary-light); text-decoration: none; }
.icon-btn-danger:hover { color: var(--color-danger); border-color: var(--color-danger); background: var(--color-danger-light); }
.inline-form { display: inline; margin: 0; }

/* ---------- Cartes ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
}
.card + .card { margin-top: var(--space-3); }
.card-title { margin-bottom: var(--space-4); }

/* ---------- Indicateurs (KPI) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.kpi {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.kpi-label .icon-sm { color: var(--color-primary); }
.kpi-value { font-size: 21px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.kpi-note { font-size: 12px; color: var(--color-text-muted); }
.kpi-main { grid-column: 1 / -1; background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.kpi-main .kpi-label, .kpi-main .kpi-note, .kpi-main .kpi-value small { color: rgba(255, 255, 255, 0.8); }
.kpi-main .kpi-label .icon-sm { color: #fff; }
.kpi-main .kpi-value { font-size: 28px; line-height: 34px; }
.kpi-main.kpi-plain { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.kpi-main.kpi-plain .kpi-label, .kpi-main.kpi-plain .kpi-note, .kpi-main.kpi-plain .kpi-value small { color: var(--color-text-muted); }
.kpi-main.kpi-plain .kpi-label .icon-sm { color: var(--color-danger); }
.kpi-main.is-loss { background: var(--color-surface); border-color: #F3C3BE; color: var(--color-danger); }
.kpi-main.is-loss .kpi-label, .kpi-main.is-loss .kpi-note { color: var(--color-danger); }
.kpi-main.is-loss .kpi-label .icon-sm { color: var(--color-danger); }

/* ---------- Bandeau "à faire maintenant" ---------- */
.callout {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
a.callout:hover { text-decoration: none; border-color: var(--color-border-strong); }
.callout-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--radius-md);
}
.callout-body { flex: 1; min-width: 0; }
.callout-body strong { display: block; font-size: 15px; }
.callout-body span { font-size: 13px; color: var(--color-text-muted); }
.callout-go { color: var(--color-text-muted); }
.callout-urgent { background: var(--color-accent-light); border-color: #FFD9A8; }
.callout-urgent .callout-icon { background: var(--color-accent); color: var(--color-text); }
.callout-urgent .callout-body span { color: var(--color-accent-text); }
.callout-ok .callout-icon { background: var(--color-primary-light); color: var(--color-primary); }

/* ---------- Actions rapides ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.quick {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  min-height: 96px; padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text); font-size: 14px; font-weight: 600; line-height: 1.3;
  box-shadow: var(--shadow-sm);
}
.quick:hover { text-decoration: none; border-color: var(--color-primary); }
.quick-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--color-primary-light); color: var(--color-primary);
}

/* ---------- Étapes de démarrage ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--color-border); }
.step:first-child { border-top: 0; padding-top: 0; }
.step-num {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border-strong);
  font-size: 14px; font-weight: 700; color: var(--color-text-muted);
}
.step.done .step-num { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.step-body { flex: 1; min-width: 0; }
.step-body strong { display: block; font-size: 15px; }
.step.done .step-body strong { color: var(--color-text-muted); text-decoration: line-through; }
.step-body span { font-size: 13px; color: var(--color-text-muted); }

/* ---------- Partage du menu ---------- */
.share { display: flex; flex-direction: column; gap: var(--space-4); }
.share-link {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-background);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--color-text);
  overflow-wrap: anywhere;
}
.qr-box {
  display: flex; align-items: center; justify-content: center;
  width: 176px; height: 176px; margin: 0 auto;
  padding: var(--space-2);
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
.qr-box img, .qr-box canvas { width: 160px; height: 160px; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: var(--space-4); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 14px; font-weight: 600; color: var(--color-text); }
.field-hint { font-size: 13px; color: var(--color-text-muted); }
.optional { font-weight: 400; color: var(--color-text-muted); }
.input, .field input[type="text"], .field input[type="tel"], .field input[type="email"],
.field input[type="number"], .field input[type="password"], .field input[type="date"],
.field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit; font-size: 16px; /* 16 px : évite le zoom automatique sur Android/iOS */
}
.field textarea { min-height: 96px; padding: var(--space-3); resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none; border-color: var(--color-primary); box-shadow: var(--focus-ring);
}
.field input[type="file"] {
  width: 100%; padding: var(--space-3);
  border: 1px dashed var(--color-border-strong); border-radius: 10px;
  background: var(--color-background); font: inherit; font-size: 14px;
}
.field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.input-money { position: relative; }
.input-money input { padding-right: 64px; font-weight: 600; font-variant-numeric: tabular-nums; }
.input-money::after {
  content: "FCFA"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 600; color: var(--color-text-muted); pointer-events: none;
}

/* Interrupteur (oui / non) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 48px; cursor: pointer; }
.switch-text strong { display: block; font-size: 14px; font-weight: 600; }
.switch-text span { font-size: 13px; color: var(--color-text-muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui {
  position: relative; width: 48px; height: 28px; flex-shrink: 0;
  border-radius: var(--radius-full); background: var(--color-border-strong);
  transition: background-color 0.15s ease;
}
.switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-ui { background: var(--color-primary); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { box-shadow: var(--focus-ring); }

/* Choix entre deux options (Entrée / Sortie) */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: 10px;
  background: var(--color-surface);
  font-size: 15px; font-weight: 600; color: var(--color-text-muted);
  cursor: pointer;
}
.segmented input:checked + label { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary-dark); }
.segmented input.is-out:checked + label { border-color: var(--color-danger); background: var(--color-danger-light); color: var(--color-danger); }
.segmented input:focus-visible + label { box-shadow: var(--focus-ring); }

.current-image { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--color-border); }

/* Formulaire repliable : un gros bouton qui s'ouvre */
.drawer { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: var(--space-4); }
.drawer > summary {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 56px; padding: 0 var(--space-4);
  list-style: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--color-primary);
}
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary .chev { margin-left: auto; color: var(--color-text-muted); transition: transform 0.15s ease; }
.drawer[open] > summary { border-bottom: 1px solid var(--color-border); }
.drawer[open] > summary .chev { transform: rotate(90deg); }
.drawer-body { padding: var(--space-4); }
.drawer-plus {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--color-primary); color: #fff;
}

/* ---------- Alertes ---------- */
.alert {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
  margin-bottom: var(--space-4);
}
.alert .icon-sm { margin-top: 1px; }
.alert-success { background: var(--color-primary-light); border-color: #BFE3CF; color: var(--color-primary-dark); }
.alert-error { background: var(--color-danger-light); border-color: #F3C3BE; color: #A5241A; }
.alert-info { background: var(--color-info-light); border-color: #C9DCF2; color: var(--color-info); }
.alert-warning { background: var(--color-accent-light); border-color: #FFD9A8; color: var(--color-accent-text); }

/* ---------- Sous-onglets et filtres ---------- */
.subtabs {
  display: flex; gap: var(--space-1);
  padding: var(--space-1);
  margin-bottom: var(--space-4);
  background: #E9EEEB;
  border-radius: var(--radius-md);
}
.subtabs a {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 var(--space-3);
  border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--color-text-muted);
}
.subtabs a:hover { text-decoration: none; color: var(--color-text); }
.subtabs a.active { background: var(--color-surface); color: var(--color-primary-dark); box-shadow: var(--shadow-sm); }

.chips {
  display: flex; gap: var(--space-2);
  overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--space-4)) var(--space-4);
  padding: 0 var(--space-4) 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: 14px; font-weight: 500; color: var(--color-text);
  white-space: nowrap;
}
.chip:hover { text-decoration: none; border-color: var(--color-primary); }
.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.chip-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-background); color: var(--color-text-muted);
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.chip.active .chip-count { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* Navigation par jour */
.daynav {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.daynav .icon-btn { flex-shrink: 0; }
.daynav-center { flex: 1; position: relative; min-width: 0; }
.daynav-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 44px; border: 1px solid var(--color-border); border-radius: 10px;
  background: var(--color-surface); text-align: center;
}
.daynav-label strong { font-size: 14px; line-height: 18px; }
.daynav-label span { font-size: 12px; line-height: 16px; color: var(--color-text-muted); }
.daynav-center input[type="date"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: 0;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 24px; padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-on, .badge-payee { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-off, .badge-annulee { background: #EEF1EF; color: var(--color-text-muted); }
.badge-en_attente { background: var(--color-accent-light); color: var(--color-accent-text); }
.badge-en_preparation { background: var(--color-info-light); color: var(--color-info); }
.badge-servie { background: #F0ECFA; color: #5B3FA8; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Listes ---------- */
.list { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); min-height: 72px; }
.row + .row { border-top: 1px solid var(--color-border); }
.row-thumb {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--color-primary-light); color: var(--color-primary);
  overflow: hidden;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb.is-in { background: var(--color-primary-light); color: var(--color-primary); }
.row-thumb.is-out { background: var(--color-danger-light); color: var(--color-danger); }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; font-size: 13px; color: var(--color-text-muted); }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); flex-shrink: 0; }
.row-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.amount { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-in { color: var(--color-primary); }
.amount-out { color: var(--color-danger); }
.row.is-muted .row-title { color: var(--color-text-muted); }

/* ---------- Commandes ---------- */
.order {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
}
.order + .order { margin-top: var(--space-3); }
.order.st-en_attente { border-left-color: var(--color-accent); }
.order.st-en_preparation { border-left-color: var(--color-info); }
.order.st-servie { border-left-color: #5B3FA8; }
.order.st-payee { border-left-color: var(--color-primary); }
.order.st-annulee { opacity: 0.75; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.order-num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-time { font-size: 13px; color: var(--color-text-muted); }
.order-client { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: var(--space-3); font-size: 14px; }
.order-client span { display: inline-flex; align-items: center; gap: 6px; }
.order-client .icon-sm { color: var(--color-text-muted); }
.order-client a { color: var(--color-text); font-weight: 500; }
.order-items { margin-top: var(--space-3); padding: var(--space-3); background: var(--color-background); border-radius: var(--radius-sm); font-size: 14px; }
.order-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: var(--space-3); }
.order-total span { font-size: 13px; color: var(--color-text-muted); }
.order-total strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-actions { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-4); }
.order-actions .btn { width: 100%; }
.btn-cancel { min-height: 40px; background: transparent; border-color: transparent; color: var(--color-danger); font-size: 14px; font-weight: 500; }
.btn-cancel:hover { background: var(--color-danger-light); }
@media (min-width: 768px) {
  .order-actions { flex-direction: row; align-items: center; gap: var(--space-2); }
  .order-actions form:first-child { flex: 1; }
  .order-actions .btn-cancel { width: auto; min-height: 48px; padding: 0 var(--space-4); }
}

/* ---------- Rapport ---------- */
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.report-preview {
  margin: 0;
  padding: var(--space-4);
  background: #E7F7EE;
  border: 1px solid #C9E9D7;
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  font-family: var(--font); font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---------- État vide ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.empty-icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary);
}
.empty-icon .icon { width: 28px; height: 28px; }
.empty strong { font-size: 16px; }
.empty p { max-width: 320px; font-size: 14px; color: var(--color-text-muted); }

/* ---------- Connexion ---------- */
.auth-body { background: var(--color-background); }
.auth {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-5) var(--space-4);
}
.auth-card {
  width: 100%; max-width: 400px;
  padding: var(--space-6) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-bottom: var(--space-5); text-align: center; }
.auth-brand .logo-mark { width: 52px; height: 52px; }
.auth-brand h1 { font-size: 22px; }
.auth-brand p { font-size: 14px; color: var(--color-text-muted); }
.auth-foot { margin-top: var(--space-5); text-align: center; font-size: 14px; color: var(--color-text-muted); }
.auth-foot a { font-weight: 600; }
.auth-tagline { margin-top: var(--space-5); font-size: 13px; color: var(--color-text-muted); text-align: center; }
.password { position: relative; }
.password input { padding-right: 52px !important; }
.password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--color-text-muted); cursor: pointer;
}
.password-toggle:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }
.password-toggle .icon-hide { display: none; }
.password-toggle.showing .icon-show { display: none; }
.password-toggle.showing .icon-hide { display: block; }

/* ---------- Utilitaires ---------- */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.center { text-align: center; }
.hide-mobile { display: none; }

/* ==========================================================================
   Tablette (768 px et plus)
   ========================================================================== */
@media (min-width: 768px) {
  h1 { font-size: 26px; line-height: 32px; }
  .content { padding: var(--space-5) var(--space-5) calc(var(--tabbar-height) + var(--space-6)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-main { grid-column: span 2; }
  .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-btn .label { display: inline; }
  .hide-mobile { display: initial; }
  .chips { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
  .share { flex-direction: row; align-items: center; }
  .share-main { flex: 1; min-width: 0; }
  .qr-box { margin: 0; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
  .two-col > .card + .card { margin-top: 0; }
}

/* ==========================================================================
   Ordinateur (1024 px et plus) : barre latérale verte, plus de barre d'onglets
   ========================================================================== */
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .tabbar { display: none; }
  .sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    padding: var(--space-5) var(--space-4);
    background: var(--color-primary-dark);
    color: #fff;
  }
  .sidebar-brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2) var(--space-5); color: #fff; }
  .sidebar-brand:hover { text-decoration: none; }
  .sidebar-brand strong { display: block; font-size: 18px; line-height: 22px; }
  .sidebar-brand span { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-item {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: 44px; padding: 0 var(--space-3);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82); font-size: 15px; font-weight: 500;
  }
  .nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
  .nav-item.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--color-accent); }
  .nav-item .nav-badge { margin-left: auto; }
  .sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: var(--space-4); border-top: 1px solid rgba(255, 255, 255, 0.12); }

  .topbar { background: var(--color-surface); color: var(--color-text); border-bottom: 1px solid var(--color-border); height: 64px; padding: 0 var(--space-6); }
  .topbar-brand { display: none; }
  .topbar-page { flex: 1; font-size: 15px; font-weight: 600; color: var(--color-text-muted); }
  .topbar-btn { color: var(--color-text-muted); }
  .topbar-btn:hover { background: var(--color-background); color: var(--color-text); }
  .content { padding: var(--space-6) var(--space-6) var(--space-7); max-width: 1040px; }
}
@media (max-width: 1023px) {
  .topbar-page { display: none; }
}

/* Listes d'argent (caisse, dépenses) : plus de place pour le libellé sur petit écran */
.list-compact .row { gap: 10px; padding: var(--space-3); }
.list-compact .row-thumb { width: 40px; height: 40px; border-radius: 10px; }
.list-compact .row-thumb .icon { width: 20px; height: 20px; }
.list-compact .icon-btn { width: 40px; height: 40px; }
.list-compact .row-title { font-size: 14px; }
@media (min-width: 768px) {
  .list-compact .row { gap: var(--space-3); padding: var(--space-3) var(--space-4); }
}

/* ---------- Tables et QR codes ---------- */
.inline-row { display: flex; gap: var(--space-2); align-items: center; }
.inline-row .input { flex: 1; min-width: 0; }
.qr-general-body { display: flex; align-items: center; gap: var(--space-4); }
.qr-general-body .qr-box { width: 120px; height: 120px; margin: 0; flex-shrink: 0; }
.qr-general-body .qr-box svg { width: 104px; height: 104px; }
.qr-box svg { display: block; width: 160px; height: 160px; }
.qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.qr-card {
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.qr-poster { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-3) var(--space-3); text-align: center; }
.qr-poster-resto { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-primary); }
.qr-poster h3 { font-size: 18px; line-height: 22px; overflow-wrap: anywhere; }
.qr-poster .qr-box { width: 100%; max-width: 160px; height: auto; aspect-ratio: 1; padding: 6px; border: 0; }
.qr-poster .qr-box svg { width: 100%; height: auto; }
.qr-poster-call { font-size: 12px; color: var(--color-text-muted); }
.qr-poster-code { display: none; }
.qr-card-actions { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--color-border); background: var(--color-background); }
.qr-card-actions .btn { flex: 1; padding: 0 var(--space-2); }
.qr-card-actions .btn .icon-sm { display: none; }
@media (min-width: 768px) {
  .qr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qr-card-actions .btn .icon-sm { display: inline; }
}
@media (min-width: 1024px) {
  .qr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Impression : une affiche par table, en grand */
@media print {
  @page { size: A5 portrait; margin: 12mm; }
  body { background: #fff; }
  .sidebar, .topbar, .tabbar, .no-print, .alert { display: none !important; }
  .shell { display: block; }
  .content { max-width: none; padding: 0; }
  .section { margin: 0; }
  .qr-grid { display: block; }
  .qr-card { border: 0; box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; }
  .qr-card:last-child { break-after: auto; page-break-after: auto; }
  .qr-poster { min-height: 170mm; justify-content: center; gap: 6mm; padding: 0; }
  .qr-poster-resto { font-size: 16pt; }
  .qr-poster h3 { font-size: 30pt; line-height: 1.1; }
  .qr-poster .qr-box { max-width: 95mm; padding: 0; }
  .qr-poster-call { font-size: 15pt; color: #17221C; font-weight: 600; }
  .qr-poster-code { display: block; font-size: 9pt; color: #66736B; }
}

/* Petits écrans : 3 sous-onglets sur une ligne, actions des cartes QR sur deux lignes */
.subtabs a { white-space: nowrap; }
@media (max-width: 419px) {
  .subtabs a { padding: 0 var(--space-2); font-size: 13px; }
  .subtabs a .icon-sm { display: none; }
}
.qr-card-actions { flex-wrap: wrap; }
.qr-card-actions .btn { flex: 1 1 100%; }
.qr-card-actions > .icon-btn, .qr-card-actions > form { flex: 1 1 0; }
.qr-card-actions > form .icon-btn { width: 100%; }
@media (min-width: 768px) {
  .qr-card-actions { flex-wrap: nowrap; }
  .qr-card-actions .btn { flex: 1 1 auto; }
  .qr-card-actions > .icon-btn, .qr-card-actions > form { flex: 0 0 auto; }
  .qr-card-actions > form .icon-btn { width: 44px; }
}
@media (min-width: 768px) {
  .qr-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

/* ---------- Logo officiel (symbole) ---------- */
/* Tuile blanche : le symbole reste lisible sur le vert de la barre (la fourchette est dessinée par le blanc). */
.logo-tile {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  padding: 3px;
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
/* Pages de connexion et d'inscription : symbole seul, sur fond blanc */
.auth-logo { display: block; width: 72px; height: 72px; object-fit: contain; margin: 0 auto; }
@media (min-width: 1024px) {
  /* Le symbole s'aligne sur la colonne des icônes du menu (même retrait de 12 px) */
  .sidebar-brand { padding: 0 var(--space-3) var(--space-5); }
  .sidebar .logo-tile { width: 40px; height: 40px; }
}
/* Barre du haut (téléphone, tablette) : même marge gauche/droite que le contenu, pour que le logo tombe sur la même ligne */
@media (min-width: 768px) and (max-width: 1023px) {
  .topbar {
    padding-left: max(var(--space-5), calc((100% - 960px) / 2 + var(--space-5)));
    padding-right: max(var(--space-5), calc((100% - 960px) / 2 + var(--space-5)));
  }
}

/* ---------- Rapport : aperçu du message WhatsApp ---------- */
.wa-card { padding: var(--space-3); }
.wa-chat {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #EEF3F0;
}
.wa-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary-dark); color: #fff;
}
.wa-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0; padding: 3px;
  border-radius: 50%; background: #fff;
}
.wa-avatar img { width: 100%; height: 100%; object-fit: contain; }
.wa-contact { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.wa-contact strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-contact span { font-size: 12px; color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-body {
  padding: var(--space-4) var(--space-3) var(--space-5);
  /* Fond discret, comme une conversation, dans les verts du site */
  background-color: #EEF3F0;
  background-image: radial-gradient(rgba(8, 116, 67, 0.07) 1px, transparent 1px);
  background-size: 14px 14px;
}
.wa-bubble {
  position: relative;
  max-width: 440px; margin-left: auto;
  padding: var(--space-3) var(--space-3) var(--space-2) var(--space-4);
  border-radius: 12px 0 12px 12px;
  background: #DCF5E7;
  box-shadow: 0 1px 1px rgba(23, 34, 28, 0.12);
}
.wa-bubble::after {
  content: ""; position: absolute; top: 0; right: -8px;
  border-width: 0 0 10px 8px; border-style: solid;
  border-color: transparent transparent transparent #DCF5E7;
}
.wa-text {
  font-size: 14.5px; line-height: 1.55; color: var(--color-text);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.wa-text strong { font-weight: 700; }
.wa-text em { font-style: italic; color: var(--color-text-muted); }
.wa-meta { display: block; margin-top: 2px; text-align: right; font-size: 11px; color: var(--color-text-muted); }
.wa-ticks { color: #2A9D63; letter-spacing: -3px; margin-left: 2px; }
@media (min-width: 768px) {
  .wa-card { padding: var(--space-4); }
  .wa-body { padding: var(--space-5) var(--space-5) var(--space-6); }
}
/* Boutons du rapport : l'un sous l'autre sur téléphone, côte à côte sur grand écran */
.wa-card .btn-row .btn { flex: 1 1 100%; white-space: nowrap; }
@media (min-width: 560px) {
  .wa-card .btn-row .btn { flex: 1 1 200px; }
}
/* Bloc à chasse fixe (``` dans WhatsApp) : colonnes de chiffres alignées */
.wa-mono {
  display: block;
  margin: 6px 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px; line-height: 1.6;
  white-space: pre; overflow-x: auto;
  color: var(--color-text);
}

/* ---------- Rapport : journée à terminer + grille des chiffres ---------- */
.callout-stack { flex-wrap: wrap; }
.callout-stack .callout-body { flex: 1 1 0; }
.callout-stack .btn { flex: 1 1 100%; }
.report-grid .kpi-main,
.report-grid .kpi-wide { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .callout-stack { flex-wrap: nowrap; }
  .callout-stack .btn { flex: 0 0 auto; }
  .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-grid .kpi-wide { grid-column: auto; }
}
/* Filtre « À terminer » de la page Commandes */
.filter-note {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4);
  border: 1px solid #FFD9A8; border-radius: var(--radius-md);
  background: var(--color-accent-light); color: var(--color-accent-text);
  font-size: 14px;
}
.filter-note strong { color: var(--color-text); }

/* ---------- Comptes des restaurants (propriétaire) ---------- */
.nav-sep {
  display: block; margin: var(--space-4) 0 var(--space-1); padding: 0 var(--space-3);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.topbar-btn.is-active { background: rgba(255, 255, 255, 0.16); }
.kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid-3 .kpi-value { font-size: 24px; }
@media (min-width: 768px) { .kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.compte-recherche { margin: var(--space-4) 0 0; }
.compte-recherche input { width: 100%; }
.compte-liste { display: grid; gap: var(--space-3); }
@media (min-width: 1024px) { .compte-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.compte { padding: var(--space-4); }
.compte.is-blocked { background: #FAFBFA; }
.compte-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.compte-titre { min-width: 0; }
.compte-titre h2 { margin: 0; font-size: 17px; line-height: 24px; overflow-wrap: anywhere; }
.compte-titre span { font-size: 13px; color: var(--color-text-muted); }
.compte-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex-shrink: 0; }
.badge-bloque { background: var(--color-danger-light); color: #A5241A; }
.badge-vous { background: var(--color-primary-dark); color: #fff; }
.compte-infos { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.compte-infos li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.compte-infos li > span, .compte-infos li > a { min-width: 0; overflow-wrap: anywhere; }
.compte-infos .icon-sm { color: var(--color-text-muted); }
.compte-note { margin: var(--space-3) 0 0; }
.compte-actions { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.zone-danger { margin-top: var(--space-3); border-top: 1px solid var(--color-border); padding-top: var(--space-2); }
.zone-danger summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none;
  color: var(--color-danger); font-size: 14px; font-weight: 600;
}
.zone-danger summary::-webkit-details-marker { display: none; }
.zone-danger summary .chev { margin-left: auto; color: var(--color-text-muted); transition: transform .15s; }
.zone-danger[open] summary .chev { transform: rotate(90deg); }
.zone-danger-body {
  display: grid; gap: var(--space-3); margin-top: var(--space-2); padding: var(--space-3);
  border: 1px solid #F3C3BE; border-radius: var(--radius-md); background: var(--color-danger-light);
}
.zone-danger-body p { margin: 0; font-size: 14px; color: #7A1D15; }
.zone-danger-body .field { margin: 0; }
.zone-danger-body .btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.zone-danger-body .btn-danger:hover { background: #B42318; }
.zone-danger-body .btn-danger:disabled { background: #E9C6C2; border-color: #E9C6C2; color: #fff; cursor: not-allowed; }


/* ---------- Ma fiche restaurant (aperçu de la carte vue par les clients) ---------- */
.fiche-grid { display: grid; gap: var(--space-5); }
@media (min-width: 1024px) { .fiche-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.fiche-apercu { display: flex; flex-direction: column; gap: var(--space-3); }
.section-title-sm { margin: 0; font-size: 15px; font-weight: 600; color: var(--color-text-muted); }
.fiche-carte h3 { margin: 0; }
.fiche-carte p { margin: 0; }
/* Cartes restaurant */
.resto-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.resto-card[hidden] { display: none; }
.resto-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }
.resto-card:focus-within { box-shadow: var(--focus-ring); }
.resto-cover { position: relative; aspect-ratio: 16 / 7; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.resto-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.resto-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px); background-size: 12px 12px;
}
.resto-cover:has(img)::after { display: none; }
.teinte-0 { background: linear-gradient(135deg, #075B36, #0B8A50); }
.teinte-1 { background: linear-gradient(135deg, #0B5E4A, #12866A); }
.teinte-2 { background: linear-gradient(135deg, #24503F, #3A7A5E); }
.teinte-3 { background: linear-gradient(135deg, #6E3F0A, #B8650A); }
.resto-initiales {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff; font-size: 24px; font-weight: 700; letter-spacing: 0.02em;
}
.resto-badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  padding: 4px 10px; border-radius: var(--radius-full);
  background: #fff; color: var(--color-primary-dark);
  font-size: 12px; font-weight: 700; line-height: 1.3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.resto-badge.is-hot { background: var(--color-accent); color: var(--color-text); }
.resto-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: var(--space-4); }
.resto-nom { font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.resto-lien { color: var(--color-text); }
.resto-lien:hover { text-decoration: none; }
.resto-lien::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.resto-lien:focus-visible { outline: none; }
.resto-lieu { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--color-text-muted); min-width: 0; }
.resto-lieu .icon-sm { color: var(--color-primary); }
.resto-lieu span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resto-tags { font-size: 14px; font-weight: 500; color: var(--color-text); }
.resto-prix { font-size: 14px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.resto-prix strong { color: var(--color-text); font-weight: 600; }
.resto-repere { font-size: 13px; color: var(--color-text-muted); }
.resto-actions { display: flex; gap: var(--space-2); margin-top: auto; padding-top: var(--space-3); }
.resto-cta { flex: 1; min-width: 0; padding: 0 var(--space-3); }
.resto-appel { position: relative; z-index: 2; padding: 0 var(--space-3); }


/* ---------- Commandes : sur place, à emporter, livraison ---------- */
.order-mode {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px;
  border-radius: var(--radius-full); background: #EEF1EF; color: var(--color-text);
  font-size: 13px; font-weight: 600;
}
.order-mode .icon-sm { width: 16px; height: 16px; }
.order-mode.mode-emporter { background: var(--color-info-light); color: var(--color-info); }
.order-mode.mode-livraison { background: var(--color-accent-light); color: var(--color-accent-text); }
.order-livraison {
  display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-md);
  border: 1px solid #FFD9A8; background: var(--color-accent-light);
}
.order-livraison span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--color-accent-text); }
.order-livraison strong { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
/* Ma fiche : façons de servir */
.fiche-services { margin: 0; padding: var(--space-4) 0 0; border: 0; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.fiche-services legend { float: left; width: 100%; padding: 0; margin-bottom: var(--space-2); font-size: 15px; font-weight: 700; }
.fiche-services .field { margin-top: var(--space-2); }
.fiche-services .field[hidden] { display: none; }
.check-ligne { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; }
.check-ligne:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-light); }
.check-ligne.is-fixe { cursor: default; opacity: .85; }
.check-ligne input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--color-primary); }
.check-texte { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.check-texte > .icon-sm { margin-top: 2px; color: var(--color-primary); flex-shrink: 0; }
.check-texte strong { display: block; font-size: 15px; }
.check-texte small { display: block; font-size: 13px; color: var(--color-text-muted); }
/* Fiche dans l'admin : étiquettes Livraison / À emporter */
.resto-services { display: flex; flex-wrap: wrap; gap: 6px; }
.resto-service { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-full); background: var(--color-primary-light); color: var(--color-primary-dark); font-size: 12px; font-weight: 600; line-height: 1.4; }
.resto-service .icon-sm { width: 14px; height: 14px; }
.order-client .order-mode .icon-sm { color: currentColor; }

/* ---------- Logo du restaurant (inscription et Ma fiche) ---------- */
.field-label { font-size: 14px; font-weight: 600; }
.logo-envoi {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius-md);
  background: var(--color-background); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.logo-envoi:hover, input:focus-visible + .logo-envoi, .logo-envoi:focus-within { border-color: var(--color-primary); background: var(--color-primary-light); }
.logo-envoi-apercu {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 64px; height: 64px; border-radius: 16px; overflow: hidden;
  background: #fff; border: 1px solid var(--color-border); color: var(--color-primary);
}
.logo-envoi-apercu img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo-envoi-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.logo-envoi-texte strong { font-size: 15px; font-weight: 600; color: var(--color-primary-dark); }
.logo-envoi-texte small { font-size: 13px; font-weight: 400; color: var(--color-text-muted); line-height: 1.4; }
.logo-retirer { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--color-danger); cursor: pointer; }
.logo-retirer input { width: 18px; height: 18px; accent-color: var(--color-danger); }

/* Logo du restaurant sur les fiches de « Trouver un restaurant » */
.resto-initiales.is-logo { width: 76px; height: 76px; padding: 8px; background: #fff; border: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); overflow: hidden; }
.resto-initiales.is-logo img { position: static; width: 100%; height: 100%; object-fit: contain; }
.resto-logo-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 1;
  width: 44px; height: 44px; padding: 4px; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.resto-logo-badge img { position: static; width: 100%; height: 100%; object-fit: contain; }
.resto-card.is-compact .resto-initiales.is-logo { width: 60px; height: 60px; }
.field input[type="file"].sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; }
.field:has(> input[type="file"].sr-only) { position: relative; }

/* ---------- Mot de passe oublié ---------- */
.label-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.lien-oubli { font-size: 14px; font-weight: 600; white-space: nowrap; }
.reset-question { margin: 0 0 var(--space-1); font-size: 15px; font-weight: 600; }
.reset-choix {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 64px;
  padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text); font: inherit; text-align: left; cursor: pointer;
}
.reset-choix:hover, .reset-choix:focus-visible { border-color: var(--color-primary); background: var(--color-primary-light); }
.reset-choix > .icon-sm { margin-left: auto; color: var(--color-text-muted); }
.reset-choix-icone { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--color-primary-light); color: var(--color-primary); flex-shrink: 0; }
.reset-choix-texte { display: flex; flex-direction: column; min-width: 0; }
.reset-choix-texte strong { font-size: 15px; }
.reset-choix-texte small { font-size: 13px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.reset-info {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--color-primary-light); color: var(--color-primary-dark); font-size: 14px; line-height: 1.5;
}
.reset-info .icon-sm { margin-top: 2px; flex-shrink: 0; }
.field input.input-code {
  font-size: 26px; font-weight: 700; letter-spacing: .35em; text-align: center;
  font-variant-numeric: tabular-nums; padding-left: .35em;
}
.reset-renvoi { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: var(--space-4); font-size: 14px; color: var(--color-text-muted); }
.lien-bouton { padding: 6px 2px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--color-primary); cursor: pointer; }
.lien-bouton:disabled { color: var(--color-text-muted); cursor: default; }
.auth-foot a { display: inline-flex; align-items: center; gap: 4px; }
/* Comptes : demandes de mot de passe */
.demandes-mdp .section-title h2 { display: flex; align-items: center; gap: 8px; }
.demandes-mdp .section-title .icon-sm { color: var(--color-accent); }
.demande-mdp { flex-wrap: wrap; }
.demande-envoyee { color: var(--color-primary-dark); font-weight: 600; }
.label-ligne > label { font-size: 14px; font-weight: 600; color: var(--color-text); }

/* ---------- Type d'établissement (inscription et Ma fiche) ---------- */
/* Tuiles : icône en haut, nom en dessous, toujours sur une seule ligne.
   2 colonnes sur téléphone, 3 dès que la place le permet (mesurée sur le formulaire, pas sur l'écran). */
.type-choix { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); container-type: inline-size; }
.type-choix legend { float: left; width: 100%; padding: 0; font-size: 14px; font-weight: 600; color: var(--color-text); }
.type-choix-aide { margin: -4px 0 0; }
.type-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.type-tuile { position: relative; display: block; min-width: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.type-tuile input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.type-tuile-corps {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 92px; height: 100%; padding: 14px 6px 12px; text-align: center;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.type-tuile-icone {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px; background: var(--color-primary-light); color: var(--color-primary);
  transition: background-color .15s ease, color .15s ease;
}
.type-tuile-icone .icon { width: 22px; height: 22px; }
.type-tuile-nom { display: block; max-width: 100%; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--color-text); white-space: nowrap; letter-spacing: -0.005em; }
.type-tuile:hover .type-tuile-corps { border-color: var(--color-border-strong); }
.type-tuile input:focus-visible + .type-tuile-corps { box-shadow: var(--focus-ring); }
.type-tuile input:checked + .type-tuile-corps { border-color: var(--color-primary); background: var(--color-primary-light); }
.type-tuile input:checked + .type-tuile-corps .type-tuile-icone { background: var(--color-primary); color: #fff; }
.type-tuile input:checked + .type-tuile-corps .type-tuile-nom { color: var(--color-primary-dark); }
.type-precision { margin-top: var(--space-1); }
.type-precision[hidden] { display: none; }
@container (min-width: 430px) {
  .type-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (max-width: 250px) {
  .type-tuile-nom { font-size: 13px; letter-spacing: -0.01em; }
  .type-tuile-corps { padding-left: 4px; padding-right: 4px; }
}
/* Type affiché sur la fiche (aperçu dans Ma fiche) */
.resto-type { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-primary); }
.resto-type .icon-sm { width: 14px; height: 14px; flex-shrink: 0; }
.resto-type span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Application installable (PWA) ---------- */
.app-install {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-4); margin-bottom: var(--space-4);
  border-radius: var(--radius-lg); border: 1px solid var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary-light), #fff 70%);
}
.app-install[hidden] { display: none; }
.app-install-icone { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; box-shadow: var(--shadow-sm); background: #fff; }
.app-install-texte { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.app-install-texte strong { font-size: 15px; color: var(--color-primary-dark); }
.app-install-texte span { font-size: 13px; color: var(--color-text-muted); line-height: 1.45; }
.app-install-ios { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: #fff; border: 1px dashed var(--color-primary); color: var(--color-text) !important; }
.app-install-ios[hidden] { display: none; }
.app-install-actions { display: flex; gap: var(--space-2); }
.app-install.is-auth { width: 100%; max-width: 400px; margin: var(--space-4) auto 0; }
@media (max-width: 520px) {
  .app-install-actions { width: 100%; }
  .app-install-actions .btn-primary { flex: 1; }
}
/* Dans l'application installée : rien à installer */
.is-app [data-pwa-install] { display: none !important; }
/* Connexion : « Mot de passe oublié ? » juste sous le champ, aligné à droite */
.lien-oubli-bas { align-self: flex-end; display: inline-flex; align-items: center; min-height: 32px; margin-top: 2px; }

/* ---------- Inscription : textes sur une seule ligne ---------- */
.une-ligne { display: block; white-space: nowrap; overflow: hidden; max-width: 100%; }
.une-ligne.peut-revenir { white-space: normal; overflow: visible; text-wrap: balance; }
.auth-brand p.auth-sous { display: flex; flex-direction: column; align-items: center; width: 100%; font-size: 14px; line-height: 1.5; }
.auth-sous .une-ligne { width: 100%; text-align: center; }
.champs-obligatoires { margin: calc(-1 * var(--space-3)) 0 var(--space-4); text-align: center; font-size: 13px; color: var(--color-text-muted); }
/* Astérisque des champs obligatoires : une seule couleur partout */
.requis { color: var(--color-danger); font-weight: 700; }
.mdp-etat.is-ok { color: var(--color-primary); font-weight: 600; }
.mdp-etat.is-ko { color: var(--color-danger); font-weight: 600; }
@media (max-width: 440px) {
  .auth { padding-left: 10px; padding-right: 10px; }
  .auth-card { padding-left: 14px; padding-right: 14px; }
}
.auth-card.is-large { max-width: 480px; }
