

/* Dispatch (BO) — cards align like cuisine (COMMANDE + assign select on one row) */
.dispatch-cards-like-kitchen .dispatch-card-actions {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.dispatch-cards-like-kitchen .dispatch-actions-right {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.dispatch-cards-like-kitchen .dispatch-select {
  max-width: 260px;
}

@media (max-width: 520px) {
  .dispatch-cards-like-kitchen .dispatch-card-actions {
    flex-wrap: wrap;
  }
  .dispatch-cards-like-kitchen .dispatch-actions-right {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  .dispatch-cards-like-kitchen .dispatch-select {
    max-width: 100%;
    width: 100%;
  }
}


:root {
  --bg: #f5f5f5;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #ffffff;
  --header-bg: #ffffff;
  --border-subtle: #d4d4d4;

  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-strong: #1d4ed8;

  --text-main: #111827;
  --text-soft: #4b5563;
  --text-strong: #111827;

  --danger: #111827;
  --danger-soft: rgba(17, 24, 39, 0.04);

  --radius-xl: 1.25rem;

  /* Mobile foundations */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* Updated by JS (see assets/app.js) */
  --app-header-h: 0px;
  --menu-sections-sticky-h: 0px;
  --mobile-cartbar-h: 0px;
}
/* BO: fond blanc (au lieu de gris) */
.is-backoffice {
  --bg: #ffffff;
}
.is-backoffice .app-footer {
  background: #ffffff;
}

/* BO: fond blanc (force, même si la classe html n'est pas posée) */
body.is-staff-shell {
  --bg: #ffffff;
}
body.is-staff-shell .app-footer {
  background: #ffffff;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-main);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  /* iOS/Android: stable viewport unit driven by JS (visualViewport/innerHeight). */
  min-height: calc(var(--app-vh, 1vh) * 100);
  height: calc(var(--app-vh, 1vh) * 100);
  /* Pas de scroll du navigateur : le scroll commence sous le header via .app-scroll */
  overflow: hidden;
  overscroll-behavior: none;
}

@supports (height: 100dvh) {
  body {
    height: 100dvh;
    min-height: 100dvh;
  }
}

/* Zone scrollable sous le header */
.app-scroll {
  flex: 1;
  overflow-anchor: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
  padding-bottom: var(--safe-bottom);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-logo {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.18);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.15), transparent 55%),
              rgba(17, 24, 39, 0.08);
}

.app-env-pill {
  font-size: 0.8rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px dashed rgba(248, 250, 252, 0.25);
  color: var(--text-soft);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

/* Staff : le header peut contenir beaucoup d'onglets, on autorise le scroll horizontal */
#app-nav-staff {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  scrollbar-width: none;
}
#app-nav-staff::-webkit-scrollbar {
  display: none;
}
#app-nav-staff a {
  white-space: nowrap;
}

/* En mode staff, les onglets internes du backoffice (dans la page) deviennent redondants */
body.is-staff-shell .backoffice-tabs-row {
  display: none;
}

.app-nav a {
  color: var(--text-soft);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.app-nav a:hover {
  color: var(--text-main);
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(17, 24, 39, 0.08);
}

.app-nav a.active {
  color: var(--text-strong);
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
  position: relative;
}

.app-user-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-soft);
}

.app-main {
  flex: 1;
  /* Keep a single source of truth for padding so other components (e.g. full-bleed hero)
     can offset it precisely without magic numbers. */
  --app-main-pad: 1.5rem;
  padding: var(--app-main-pad);
  display: flex;
  justify-content: center;
}

#app-root {
  width: 100%;
  max-width: 1040px;
}

.app-footer {
  padding: 0.8rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-soft);
  background: #f5f5f5;
}

/* Cards & layout */

.view-card {
  border-radius: 1.5rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  padding: 1.5rem 1.4rem;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.06);
}

.view-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.view-title {
  font-size: 1.6rem;
  margin: 0.15rem 0 0.3rem 0;
  color: var(--text-strong);
}

.view-subtitle {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 0 0 1.1rem 0;
}

/* Restaurant Backoffice – portail de connexion (centré) */
html.is-bo-login .app-main {
  align-items: center;
}

#r-bo-card.bo-login-mode {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

#r-bo-card.bo-login-mode .bo-login-portal {
  width: 100%;
}

#r-bo-card.bo-login-mode .bo-login-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #94a3b8;
}

#r-bo-card.bo-login-mode .bo-login-title {
  font-size: 1.55rem;
  font-weight: 600;
  margin-top: 0.25rem;
  color: var(--text-strong);
}

#r-bo-card.bo-login-mode .bo-login-sub {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: var(--text-soft);
}

#r-bo-card.bo-login-mode .auth-input {
  width: 100%;
}

@media (max-width: 520px) {
  #r-bo-card.bo-login-mode {
    max-width: 100%;
  }
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 1.1rem;
  margin-bottom: 1.3rem;
}

.view-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.view-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  color: var(--text-soft);
}

.view-badge.tag-primary {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: #f5f5f5;
}

.view-badge.tag-soft {
  border-style: dashed;
}

/* Auth */

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 1rem;
}

.auth-card {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.2), transparent 55%),
              rgba(17, 24, 39, 0.08);
  padding: 1.1rem 1rem;
}

.auth-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}

.auth-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.auth-input {
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(17, 24, 39, 0.08);
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.auth-button {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.18);
  background: var(--accent-soft);
  color: #f5f5f5;
  cursor: pointer;
}

.auth-button.secondary {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.65);
  color: var(--text-soft);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-message {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.auth-message--success {
  color: #f5f5f5;
}

/* Backoffice users: inline create row */
.admin-create-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.admin-create-inline-row .auth-field {
  margin-bottom: 0;
}

.admin-create-inline-field {
  min-width: 170px;
  flex: 1 1 170px;
}

.admin-create-inline-courier {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.admin-create-inline-submit {
  align-self: flex-end;
  height: 34px;
  padding: 0.35rem 0.9rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .admin-create-inline-field {
    min-width: 100%;
  }
  .admin-create-inline-submit {
    width: 100%;
  }
}

.auth-message--error {
  color: var(--danger);
}

/* Client */

.client-section {
  margin-top: 1.1rem;
}

/* CTA Panier en bas de la page Menu */
.client-menu-bottom-cta {
  display: flex;
  justify-content: center;
  padding-top: 0.8rem;
  padding-bottom: 1.2rem;
}

.client-cart-open-btn {
  min-width: min(360px, 100%);
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

.client-menu-area {
  margin-top: 0.85rem;
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

/* Mobile cart bar (smartphone) */
.mobile-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  padding: 0.85rem 0.9rem calc(0.85rem + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(10px);
}

.mobile-cart-bar-btn {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 18px;
  padding: 0.85rem 0.95rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  cursor: pointer;
}

.mobile-cart-bar-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
}

.mobile-cart-bar-title {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-strong);
}

.mobile-cart-bar-sub {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.mobile-cart-bar-total {
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
}

@media (max-width: 720px) {
  /* Sur mobile, le CTA "Panier" en bas du menu devient redondant */
  .client-menu-bottom-cta {
    display: none !important;
  }

  /* Laisse la fin du contenu scrollable au-dessus de la barre panier */
  body.has-mobile-cartbar .app-main {
    padding: var(--app-main-pad);
    padding-bottom: calc(var(--app-main-pad) + var(--mobile-cartbar-h) + 12px);
  }

  body.has-mobile-cartbar .client-menu-area {
    padding-bottom: calc(var(--safe-bottom) + var(--mobile-cartbar-h) + 16px);
  }
}

/* Navigation vers les sections du menu (catégories) */
.client-menu-nav {
  /* Sticky container for the category tabs, placed under the hero (outside the menu items container). */
  position: sticky;
  top: 0; /* top of the internal scroller (.app-scroll) which starts under the header */
  z-index: 19;
  margin-top: 0;
  margin-bottom: 0.85rem;

  /* Visual: clean white bar */
  background: #fff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

/* Under-hero sections bar: full-bleed like the hero, while keeping content aligned with the main padding. */
.client-menu-nav--underhero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.client-menu-nav--underhero .menu-sections-nav {
  padding-left: calc(var(--app-main-pad-x, 1.5rem) + var(--safe-left));
  padding-right: calc(var(--app-main-pad-x, 1.5rem) + var(--safe-right));
}


.client-menu-hero {
  margin-top: 0;
}

/* Full-bleed hero under main tabs (Menu/Commandes/Livraison) */
.client-menu-hero--fullbleed {
  /* Cancel .app-main top padding so the hero sits directly under the main tabs */
  margin-top: calc(-1 * var(--app-main-pad, 2rem));
  margin-bottom: 0;
}

.client-menu-hero--fullbleed .menu-hero-frame {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  border-radius: 0;
  box-shadow: none;
}

.menu-hero-frame--placeholder {
  background: linear-gradient(90deg, rgba(31, 31, 31, 0.06), rgba(31, 31, 31, 0.12), rgba(31, 31, 31, 0.06));
  background-size: 200% 100%;
  animation: mayaHeroShimmer 1.25s ease-in-out infinite;
}

@keyframes mayaHeroShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.menu-hero-frame {
  position: relative;
  width: 100%;
  height: clamp(220px, 45vh, 520px);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.menu-hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 10, 0.12), rgba(7, 11, 10, 0.00) 45%, rgba(7, 11, 10, 0.18));
  pointer-events: none;
}

.menu-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  pointer-events: none;
}

@media (max-width: 520px) {
  .menu-hero-frame {
    /* Mobile: keep the hero present but not excessively tall (more menu visible). */
    height: clamp(170px, 26vh, 260px);
    border-radius: 16px;
  }
}
/* Very short viewports (small phones / landscape) */
@media (max-width: 520px) and (max-height: 700px) {
  .menu-hero-frame {
    height: clamp(150px, 24vh, 220px);
  }
}

.menu-sections-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

/* Desktop: center the menu category tabs when there is enough room.
   Keep horizontal scrolling available if the categories overflow. */
@media (min-width: 721px) {
  .menu-sections-nav {
    justify-content: center;
  }
}


.menu-sections-nav::-webkit-scrollbar {
  display: none;
}

.menu-sections-nav-btn {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text-main);
  padding: 0.75rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.menu-sections-nav-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px; /* touche le trait du bas */
  height: 8px; /* rectangle (pas une simple ligne) */
  background: transparent;
  border-radius: 3px 3px 0 0;
}

.menu-sections-nav-btn:hover {
  color: var(--accent-strong);
}

.menu-sections-nav-btn.is-active {
  color: rgba(17, 24, 39, 0.95);
}

.menu-sections-nav-btn.is-active::after {
  background: var(--accent-strong);
}

.menu-sections-nav-btn:focus-visible {
  outline: 2px solid rgba(17, 24, 39, 0.35);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .menu-sections-nav-btn {
    padding: 0.7rem 0.55rem;
    font-size: 0.86rem;
  }
}
.menu-category {
  /* Ensure category anchors are not hidden behind the sticky header + the sticky sections bar. */
  scroll-margin-top: calc(var(--menu-sections-sticky-h, 0px) + 18px);
}


.client-section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.client-message {
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.8rem;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-soft);
}

.client-message--error {
  border-color: rgba(248, 113, 113, 0.8);
  background: var(--danger-soft);
  color: #f5f5f5;
}

.client-message--hint {
  border-style: dashed;
}

/* Restaurants */

.client-restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
}

/* Page restaurant (/slug) : bandeau simple au-dessus du menu */
.client-restaurant-shell {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.client-restaurant-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--muted-foreground, rgba(255,255,255,0.7));
  text-decoration: none;
}

.client-restaurant-back:hover {
  text-decoration: underline;
}

.client-restaurant-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.client-restaurant-meta-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

/* Variante "segmented" : 2 restaurants -> expansion 80/20 quand sélectionné */
@media (min-width: 640px) {
  .client-restaurants-grid--segmented {
    display: flex;
    gap: 0;
  }

  .client-restaurants-grid--segmented .restaurant-card {
    flex: 1 1 0;
    flex-grow: 1;
    transition: flex-grow 220ms ease;
  }

  .client-restaurants-grid--segmented.has-selection .restaurant-card.selected {
    flex-grow: 4; /* ~80% */
  }

  .client-restaurants-grid--segmented.has-selection .restaurant-card:not(.selected) {
    flex-grow: 1; /* ~20% */
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .client-restaurants-grid--segmented.has-selection .restaurant-card:not(.selected) .restaurant-card-text {
    display: none;
  }

  .client-restaurants-grid--segmented.has-selection .restaurant-card:not(.selected) .restaurant-card-content {
    justify-content: center;
    align-items: center;
  }
}

@media (min-width: 640px) {
  .client-restaurants-grid {
    gap: 0;
  }

  /* évite une “double bordure” au centre quand les deux cartes se touchent */
  .client-restaurants-grid .restaurant-card + .restaurant-card {
    margin-left: -1px;
  }
}

.restaurant-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background-color: rgba(17, 24, 39, 0.22);
  padding: 0.85rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.restaurant-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(7, 11, 10, 0.55), rgba(7, 11, 10, 0.25));
  z-index: 1;
  pointer-events: none;
}

.restaurant-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transform: scale(1.02);
  z-index: 0;
}


@media (min-width: 640px) {
  /* Les 2 restaurants sont affichés comme un "segmented" : angles internes carrés */
  .restaurant-card--first {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .restaurant-card--last {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}

.restaurant-card:hover {
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}

.restaurant-card.selected {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.restaurant-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.restaurant-logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  /* Pas de "case" derrière le logo (SVG/PNG transparents) */
  border-radius: 0;
  background: transparent;
  border: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.restaurant-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
}

.restaurant-logo-placeholder {
  width: 100%;
  height: 100%;
  background: transparent;
}

.restaurant-card-text {
  flex: 1 1 auto;
  min-width: 0;
}

.restaurant-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.restaurant-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: #ffffff;
}

.restaurant-city {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
}

.restaurant-desc {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.74);
}

/* Menu – plats mis en avant (carousel sous la sélection restaurant) */

.featured-carousel {
  margin-top: 0;
}

.featured-carousel-viewport {
  overflow: hidden;
  /*
    Le carousel ne doit pas être dans un "encadré" gris englobant :
    seules les cartes (plats) sont grises claires.
  */
  border-radius: 0;
  border: none;
  background: transparent;
}

.featured-carousel-track {
  display: flex;
  gap: 0.55rem;
  padding: 0.55rem;
  transition: transform 0.45s ease;
  will-change: transform;
}

.featured-dish-card {
  flex: 0 0 calc((100% - 1.1rem) / 3);
  display: block;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.featured-dish-media {
  width: 100%;
  /* Carré, sans arrondi */
  aspect-ratio: 1 / 1;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  border: 1px solid var(--accent-strong);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-dish-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-dish-image--placeholder {
  width: 100%;
  height: 100%;
  background: rgba(17, 24, 39, 0.08);
}

/* Note: overlay/logo supprimés pour les images mises en avant (pas de lueur interne, pas de texte) */

@media (max-width: 860px) {
  .featured-dish-card {
    flex-basis: calc((100% - 0.55rem) / 2);
  }
}

@media (max-width: 540px) {
  .featured-dish-card {
    flex-basis: 100%;
  }
}

.restaurant-pill {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.75);
  color: var(--text-soft);
}

.restaurant-pill--open {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: #f5f5f5;
}

/* Contraste des tags sur les cartes hero (fond photo) */
.restaurant-card--hero .restaurant-pill {
  border-color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.88);
  color: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
}

.restaurant-card--hero .restaurant-pill--open {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: #f5f5f5;
}


/* Menu */

.client-menu-header {
  margin-bottom: 0.6rem;
}

.client-menu-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-strong);
}

.client-menu-subtitle {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.menu-category {
  margin-top: 0.7rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
}

.menu-category-title {
  scroll-margin-top: calc(var(--menu-sections-sticky-h, 0px) + 10px);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-strong);
}

.menu-category-desc {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}

/* R8 – Perf mobile: reduce rendering work for long menus */
@supports (content-visibility: auto) {
  .menu-category {
    content-visibility: auto;
    contain-intrinsic-size: 800px;
  }

  .featured-carousel {
    content-visibility: auto;
    contain-intrinsic-size: 280px;
  }
}

.menu-item-card {
  contain: layout paint;
}

/* Client menu: grille des produits */
.client-menu-area .menu-items-list {
  margin-top: 0.4rem;
  display: grid;
  /* Desktop/tablette: 2 produits par ligne */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

/* Smartphone: 1 colonne (lisible + pouce-friendly) */
@media (max-width: 767px) {
  .client-menu-area .menu-items-list {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

/* Smartphone en paysage (hauteur faible) : garder 1 colonne même si la largeur dépasse 767px */
@media (max-height: 500px) and (orientation: landscape) {
  .client-menu-area .menu-items-list {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

.client-menu-area .menu-item-card {
  min-width: 0;
}

.menu-item-card {
  border-radius: 0.9rem;
  border: 1px solid rgba(37, 99, 235, 0.55);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.32), transparent 55%),
              rgba(17, 24, 39, 0.08);
  padding: 0.55rem 0.55rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-item-card--flash {
  animation: menuItemFlash 0.85s ease;
}

@keyframes menuItemFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.0);
  }
  35% {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.0);
  }
}

.menu-item-mainline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.menu-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-strong);
}

.menu-item-price {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: #e5e7eb;
}

.menu-item-desc {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.menu-item-tags {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.menu-item-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  color: var(--text-soft);
}

.menu-item-tag--variant {
  border-color: rgba(37, 99, 235, 0.9);
}

.menu-item-tag--options {
  border-color: rgba(37, 99, 235, 0.9);
}

.menu-item-footer {
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Desktop: keep the "Ajouter" CTA on the right side */
.menu-item-footer .menu-item-qty {
  order: 1;
}

.menu-item-footer .menu-item-add {
  order: 2;
  margin-left: auto;
}

.menu-item-add {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--accent-strong);
  background: var(--accent-soft);
  color: #f5f5f5;
  cursor: pointer;
}

.menu-item-add:hover {
  border-color: #f5f5f5;
}

.menu-item-qty {
  font-size: 0.75rem;
  color: var(--text-soft);
}

/* Mobile: make the add button full-width at the bottom */
@media (max-width: 720px) {
  .menu-item-card {
    padding: 0.65rem 0.65rem;
  }

  /* Limiter la hauteur des cartes sur smartphone (lisibilité + vitesse) */
  .menu-item-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .menu-item-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .menu-item-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .menu-item-footer .menu-item-qty {
    order: 1;
  }

  .menu-item-footer .menu-item-add {
    order: 2;
    width: 100%;
    border-radius: 0.85rem;
    padding: 0.6rem 0.95rem;
    min-height: 44px;
    font-size: 0.85rem;
  }
}

/* Cart */

.client-cart-card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.75);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.32), transparent 55%),
              rgba(17, 24, 39, 0.08);
  padding: 0.75rem 0.8rem;
}

.client-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.client-cart-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-strong);
}

.client-cart-meta {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 0.1rem;
}

.client-cart-total {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.client-cart-footer {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.client-cart-action {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent-strong);
  background: var(--accent-soft);
  color: #f5f5f5;
  cursor: pointer;
}

/* Permet d'utiliser .client-cart-action sur des liens (CTA) */
a.client-cart-action {
  display: inline-block;
  text-decoration: none;
}

.client-cart-cta-row {
  margin-top: 0.6rem;
}

.client-cart-action--cta {
  margin-top: 0;
  /* CTA discret : fin, petit, fond blanc (jamais rose) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.22rem 0.70rem;
  font-size: 0.70rem;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-radius: 0.25rem;
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
}

.client-cart-action--cta:hover {
  background: rgba(17, 24, 39, 0.03) !important;
}


/* Même dans un encart d'erreur (fond rouge), on garde un bouton blanc discret */
.client-message--error .client-cart-action--cta {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: var(--border-subtle) !important;
}


.client-cart-action:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Order history */

.client-orders-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.client-orders-page-header-right {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.client-orders-history-top-btn {
  padding: 0.52rem 1.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.client-order-running-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-soft);
  font-size: 0.7rem;
}

.client-order-row.is-selected {
  background: rgba(17, 24, 39, 0.14);
  outline: 2px solid rgba(148, 163, 184, 0.45);
}

@media (max-width: 720px) {
  .client-orders-page-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .client-orders-page-header-right {
    width: 100%;
    justify-content: stretch;
  }
  .client-orders-history-top-btn {
    width: 100%;
  }
}


.client-orders-list {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(17, 24, 39, 0.08);
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
}

.client-orders-empty {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.client-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.3rem;
  border-radius: 0.6rem;
  cursor: pointer;
}

.client-order-row:hover {
  background: rgba(17, 24, 39, 0.08);
}

.client-order-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.client-order-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.72rem;
  color: #94a3b8;
}

.client-order-meta {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.client-order-status {
  font-size: 0.75rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-soft);
}

.client-order-status--draft {
  border-color: rgba(37, 99, 235, 0.9);
  background: rgba(37, 99, 235, 0.06);
  color: #f5f5f5;
}

/* Order detail */

.client-order-detail-card {
  margin-top: 0.6rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(17, 24, 39, 0.08);
  padding: 0.7rem 0.7rem;
  font-size: 0.82rem;
}

.client-order-detail-items-box {
  margin-top: 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: #ffffff;
  padding: 0.55rem 0.6rem;
}

.client-order-detail-items-box .client-order-detail-items {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.client-order-detail-items-box .client-order-detail-totals {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
}

.client-order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.client-order-detail-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.client-order-history-btn {
  padding: 0.38rem 0.85rem;
  font-size: 0.78rem;
}

.client-order-detail-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.client-order-detail-items {
  margin-top: 0.4rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
  padding-top: 0.4rem;
}

.client-order-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.2rem 0;
}

.client-order-detail-item-main {
  display: flex;
  flex-direction: column;
}

.client-order-detail-item-name {
  font-size: 0.82rem;
  color: var(--text-strong);
}

.client-order-detail-item-meta {
  font-size: 0.76rem;
  color: var(--text-soft);
}

.client-order-detail-item-amount {
  font-size: 0.82rem;
  color: var(--text-strong);
}

/* Responsive */

@media (max-width: 820px) {
  .app-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .app-main {
    --app-main-pad: 1rem;
    padding: var(--app-main-pad);
  }

  .view-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Addresses */

.client-address-form {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 55%),
              rgba(17, 24, 39, 0.08);
  padding: 0.75rem 0.8rem;
  margin-bottom: 0.7rem;
}

.client-address-form-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

.client-address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.4rem 0.6rem;
}

.client-address-field {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.client-address-field--wide {
  grid-column: 1 / -1;
}


.client-address-field--house .client-address-input {
  max-width: 140px;
}


.client-address-label {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.client-address-input {
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(17, 24, 39, 0.08);
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-main);
}

.client-address-textarea {
  min-height: 4.8rem;
  resize: vertical;
  line-height: 1.35;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.client-address-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(148, 163, 184, 0.18);
}

.client-address-input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.client-address-actions-row {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

select.client-address-input {
  cursor: pointer;
}


.client-address-button {
  font-size: 0.78rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent-strong);
  background: var(--accent-soft);
  color: #f5f5f5;
  cursor: pointer;
}

.client-address-button.secondary {
  border-color: rgba(148, 163, 184, 0.7);
  background: transparent;
  color: var(--text-soft);
}

.client-address-button.tertiary {
  border-color: rgba(148, 163, 184, 0.4);
  background: transparent;
  color: #f5f5f5;
}

/* Modal : création d'adresse */
.client-address-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 110;
}

.client-address-modal-overlay.is-visible {
  display: flex;
}

.client-address-modal-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  color: var(--text-main);
}

.client-address-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.client-address-modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.client-address-modal-close {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-soft);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.client-address-form--modal {
  margin-bottom: 0;
}


/* R6 — Address modal mobile UX (bottom-sheet) + map preview */
.client-address-geoloc-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.client-address-geoloc-btn {
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.client-address-geoloc-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.client-address-geoloc-status {
  font-size: 0.75rem;
  color: var(--text-soft);
  min-height: 1.1em;
}

.client-address-map-wrap {
  margin-top: 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--bg-elevated);
}

.client-address-map {
  width: 100%;
  height: 170px;
}

@media (min-width: 900px) {
  .client-address-modal-card {
    max-width: 920px;
  }

  /* Desktop: make street+map span full width for a more comfortable map preview */
  .client-address-form--modal .client-address-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.85rem;
  }

  .client-address-form--modal .client-address-field--with-suggestions {
    grid-column: 1 / -1;
  }

  .client-address-form--modal .client-address-field--map {
    grid-column: 1 / -1;
  }

  .client-address-form--modal .client-address-map {
    height: 320px;
  }
}

@media (max-width: 720px) {
  .client-address-modal-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .client-address-modal-card {
    width: 100%;
    max-width: none;
    max-height: calc(var(--app-vh, 1vh) * 100);
    border-radius: 1rem 1rem 0 0;
    padding: 0;
    overflow: hidden;
  }

  .client-address-modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    padding: 1rem 1rem 0.75rem;
    margin: 0;
    border-bottom: 1px solid var(--border-subtle);
    z-index: 3;
  }

  .client-address-modal-body {
    padding: 0.9rem 1rem 1rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(var(--app-vh, 1vh) * 100 - 64px);
  }

  .client-address-actions-row {
    position: sticky;
    bottom: 0;
    background: var(--bg-elevated);
    padding: 0.8rem 0 calc(0.6rem + var(--safe-bottom));
    margin-top: 0.8rem;
    border-top: 1px solid var(--border-subtle);
    justify-content: stretch;
  }

  .client-address-actions-row .client-address-button {
    width: 100%;
  }

  .client-address-input {
    font-size: 16px;
    padding: 0.65rem 0.75rem;
  }

  .client-address-label {
    font-size: 0.85rem;
  }

  .client-address-map {
    height: 200px;
  }
}

.client-addresses-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.15rem 0;
  border: none;
  background: transparent;
}

@media (max-width: 1100px) {
  .client-addresses-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .client-addresses-list {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}


.client-address-card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.65rem 0.7rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 9.5rem;
}

.client-address-card:hover {
  border-color: rgba(148, 163, 184, 0.85);
  background: #f8fafc;
}


.client-address-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.client-address-label-main {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-strong);
}

.client-address-contact {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}


.client-address-lines {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.client-address-line + .client-address-line {
  margin-top: 0.05rem;
}

.client-address-badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.75);
  color: var(--text-soft);
}

.client-address-badge--default {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 600;
}

.client-address-actions {
  margin-top: auto;
  padding-top: 0.55rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.client-address-actions .client-address-button {
  padding: 0.32rem 0.6rem !important;
  font-size: 0.72rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
}

.client-address-actions .client-address-button.secondary,
.client-address-actions .client-address-button.tertiary {
  background: transparent !important;
  border: 1px solid rgba(148, 163, 184, 0.65) !important;
  color: var(--text-main) !important;
}

.client-address-actions .client-address-button.tertiary {
  border-color: rgba(148, 163, 184, 0.5) !important;
}

.client-address-actions .client-address-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.client-address-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}


.client-order-detail-address {
  margin: 0.4rem 0 0.3rem 0;
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.08);
  font-size: 0.78rem;
}

.client-order-detail-address-label {
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 0.15rem;
}

.client-order-detail-address-lines {
  color: var(--text-soft);
}


.client-cart-body {
  margin-top: 0.4rem;
}

.client-cart-address-block {
  padding: 0.35rem 0.45rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.08);
  font-size: 0.78rem;
}

/* Nouveau rendu (volet panier) : pas d'encart gris, uniquement label + select */
.client-cart-address-selector {
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.client-cart-address-label {
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 0.25rem;
}

.client-cart-address-select {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  color: var(--text-main);
}

.client-cart-address-select:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.client-cart-address-hint {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-soft);
}


.client-order-detail-totals {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.8rem;
}

.client-order-detail-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.15rem;
}

.client-order-detail-total-row span:first-child {
  color: var(--text-soft);
}

.client-order-detail-total-row span:last-child {
  color: var(--text-main);
}

.client-order-detail-total-row--strong span:first-child {
  font-weight: 500;
  color: var(--text-strong);
}

.client-order-detail-total-row--strong span:last-child {
  font-weight: 600;
}


.client-cart-rules-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-soft);
}


.client-stripe-banner {
  margin-bottom: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.08);
}

.client-stripe-banner--pending {
  border-color: rgba(37, 99, 235, 0.9);
}

.client-stripe-banner--success {
  border-color: rgba(37, 99, 235, 0.9);
}

.client-stripe-banner--error,
.client-stripe-banner--cancel {
  border-color: rgba(239, 68, 68, 0.9);
}

.client-order-detail-actions {
  margin-top: 0;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.5);
}

.client-order-pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--accent-strong);
  color: #111827;
}

.client-order-pay-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.client-order-pay-hint {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-soft);
}


.backoffice-section {
  margin-top: 1rem;
}


.backoffice-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.backoffice-section-title-row .backoffice-section-title {
  margin-bottom: 0;
}

.backoffice-section-title-row .kitchen-refresh-btn {
  flex: 0 0 auto;
}

.backoffice-section-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

.kitchen-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.kitchen-order-card {
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  padding: 0.7rem 0.8rem;
  background: rgba(17, 24, 39, 0.08);
}

.kitchen-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.kitchen-order-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-strong);
}

.kitchen-order-id {
  font-size: 0.72rem;
  color: var(--text-soft);
}

.kitchen-order-status {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: lowercase;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.kitchen-status--paid {
  border-color: rgba(37, 99, 235, 0.9);
}

.kitchen-status--in {
  border-color: rgba(245, 158, 11, 0.9);
}

.kitchen-status--ready {
  border-color: rgba(37, 99, 235, 0.9);
}

.kitchen-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.kitchen-order-meta span::before {
  content: "• ";
}

.kitchen-order-address {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--text-main);
}

.kitchen-order-actions {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kitchen-order-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--accent-strong);
  color: #111827;
}

.kitchen-order-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.kitchen-order-hint {
  font-size: 0.72rem;
  color: var(--text-soft);
}


.backoffice-tabs-row {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

.btn-tab {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: transparent;
  color: var(--text-soft);
}

.btn-tab--active {
  background: var(--accent-soft);
  color: var(--text-strong);
}

.admin-menus-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0;
}

.admin-menus-col {
  min-width: 0;
}

.admin-menus-block {
  /* Align with the "Zones livraison" light cards (clear background, subtle border). */
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1rem;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
}

.admin-menus-block-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-strong);
}

.admin-field {
  margin-bottom: 0.75rem;
}

.admin-field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}

.admin-input {
  width: 100%;
  border-radius: 0.55rem;
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.65rem;
  background: #fff;
  color: var(--text-main);
  font-size: 0.85rem;
}

.admin-color-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.admin-color-row .admin-input {
  flex: 1;
}

.admin-color-picker {
  width: 44px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
}


.admin-input:focus {
  outline: none;
  border-color: var(--accent-strong);
}

.admin-field--inline {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.admin-field-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.admin-actions-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.admin-form {
  margin-top: 0.25rem;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.admin-form-actions--end {
  justify-content: flex-end;
}

.admin-rest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .admin-rest-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Restaurant (Restaurants & menus) – layout 3 colonnes :
   1) Image de fond  2) Logo (carré)  3) Infos + bouton enregistrer */
.admin-rest-grid3 {
  --admin-rest-drop-h: 190px;
  --admin-rest-col-h: calc(var(--admin-rest-drop-h) + 56px);
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) 220px minmax(280px, 1fr);
  gap: 1rem;
  align-items: start;
}

.admin-rest-col {
  min-width: 0;
}

.admin-rest-col--hero .admin-field,
.admin-rest-col--logo .admin-field {
  margin-bottom: 0;
}

.admin-rest-col--hero .admin-dropzone-inner {
  min-height: var(--admin-rest-drop-h);
}

.admin-rest-col--hero .admin-dropzone-img {
  height: var(--admin-rest-drop-h);
}

.admin-rest-col--logo {
  width: 220px;
}

/* Colonne logo : fond légèrement grisé (case) */
.admin-rest-col--logo .admin-dropzone {
  background: rgba(17, 24, 39, 0.02);
}

.admin-dropzone--logo-square .admin-dropzone-inner {
  min-height: var(--admin-rest-drop-h);
  /* Logo: fond gris très clair pour mieux voir les PNG transparents */
  background: rgba(17, 24, 39, 0.03);
}

.admin-dropzone--logo-square .admin-dropzone-img {
  height: var(--admin-rest-drop-h);
  object-fit: contain;
  background: transparent;
  padding: 10px;
}

.admin-rest-col--fields {
  height: var(--admin-rest-col-h);
}

.admin-rest-fields {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-rest-col--fields .admin-field {
  margin-bottom: 0.55rem;
}

.admin-rest-col--fields .admin-form-actions {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .admin-rest-grid3 {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
  .admin-rest-col--fields {
    grid-column: 1 / -1;
    height: auto;
  }
  .admin-rest-fields {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .admin-rest-grid3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-rest-col--logo {
    width: 100%;
  }
}

.admin-btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--accent);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-strong);
}

.admin-btn-save:hover {
  filter: brightness(0.98);
}

.admin-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


.admin-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.02);
  border: 1px solid var(--border-subtle);
  color: var(--text-strong);
}

.admin-btn-secondary:hover {
  border-color: var(--accent-strong);
}
.admin-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.admin-chip {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.75rem;
  background: rgba(17, 24, 39, 0.03);
  color: var(--text-soft);
  font-size: 0.75rem;
  cursor: pointer;
}

.admin-chip:hover {
  border-color: var(--accent-strong);
  color: var(--text-strong);
}

.admin-menu-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.35fr);
  gap: 1.25rem;
}

@media (max-width: 960px) {
  .admin-menu-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-menu-column {
  min-width: 0;
}


.admin-category-select-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-category-select-row .admin-input {
  flex: 1;
  min-width: 0;
}

/* Admin – Plat : 2 uploads sur une ligne (format carré) */
.admin-item-images-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.admin-item-image-cell {
  flex: 1 1 0;
  min-width: 0;
  max-width: 170px;
}

.admin-featured-toggle {
  margin-top: 0.35rem;
}

.admin-dropzone--square .admin-dropzone-inner {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.admin-dropzone--square .admin-dropzone-img {
  height: 100%;
}

.btn-icon {
  width: 2.5rem;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1200;
}

.admin-modal-overlay.is-visible {
  display: flex;
}

.admin-modal-card {
  width: min(520px, 100%);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-modal-title {
  font-weight: 600;
  color: var(--text-strong);
}

.admin-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.02);
  color: var(--text-strong);
  cursor: pointer;
}

.admin-modal-close:hover {
  border-color: var(--accent-strong);
}

.admin-modal-body {
  padding: 0.9rem 1rem 1rem;
}


.admin-form-block {
  margin-top: 0;
}

.admin-form-title {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-soft);
}

.admin-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* Afficher la liste complète du menu sans scroll interne.
     La page gère le scroll si besoin. */
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.admin-items-group {
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.7rem;
  background: #fff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.04);
}

.admin-items-group-title {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-strong);
}

.admin-items-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.6rem;
  background: #fff;
  cursor: pointer;
}

.admin-item-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-item-row-name {
  font-size: 0.8rem;
  color: var(--text-strong);
}

.admin-item-row-flags {
  font-size: 0.7rem;
  color: var(--text-soft);
}

.admin-item-row-price {
  font-size: 0.8rem;
  color: var(--text-strong);
}


/* Dispatch & courier cards */

.dispatch-list,
.courier-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0;
}

.dispatch-card,
.courier-card {
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #fff;
}

@media (min-width: 900px) {
  .dispatch-card,
  .courier-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
  }
}

.dispatch-card-main,
.courier-card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dispatch-card-actions,
.courier-card-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

@media (min-width: 900px) {
  .dispatch-card-actions,
  .courier-card-actions {
    margin-top: 0;
    margin-left: 1rem;
    align-items: flex-end;
  }
}

.dispatch-card-header,
.courier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dispatch-card-ticket,
.courier-card-ticket {
  flex: 0 0 auto;
  min-width: 56px;
  text-align: center;
  padding: 0.25rem 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 14px rgba(0,0,0,0.05);
  background: rgba(243, 199, 197, 0.30);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.dispatch-card-ticket--empty,
.courier-card-ticket--empty {
  opacity: 0.4;
}

.dispatch-chip,
.courier-chip {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid rgba(0,0,0,0.08);
}

.courier-chip--muted {
  opacity: 0.6;
}

.dispatch-id,
.courier-id {
  margin-left: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  opacity: 0.7;
}

.dispatch-card-amount,
.courier-card-amount {
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/*
  Les labels (RESTAURANTS/CLIENT/STATUT/...) sont des mots longs sans espace.
  En flex + largeur fixe ils pouvaient déborder et se superposer au contenu.
  On passe en grid pour un rendu robuste.
*/
.dispatch-card-row,
.courier-card-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
}

.dispatch-label,
.courier-label {
  width: auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.78;
  color: var(--text-soft);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dispatch-value,
.courier-value {
  font-size: 0.9rem;
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dispatch-address,
.courier-address {
  opacity: 0.8;
  font-size: 0.85rem;
}

.dispatch-driver-current {
  font-weight: 500;
}

.dispatch-driver-current--none {
  opacity: 0.6;
}

.dispatch-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.dispatch-select {
  width: 100%;
  min-width: 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-main);
  cursor: pointer;
}

.dispatch-select:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

/* Base button styles (admin + generic). Dispatch has more specific overrides. */
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-strong);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-main);
  border-color: rgba(0, 0, 0, 0.14);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.28);
  color: rgba(127, 29, 29, 0.95);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dispatch actions (assig. / réassig. / retirer) dans la charte */
.dispatch-card-actions .btn-primary,
.dispatch-card-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.dispatch-card-actions .btn-primary {
  background: var(--accent);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-strong);
}

.dispatch-card-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: var(--text-main);
}

.dispatch-card-actions .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
}

.dispatch-card-actions .btn-primary:disabled,
.dispatch-card-actions .btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dispatch (in columns): keep cards stacked to avoid overflow */
.dispatch-columns .dispatch-card {
  flex-direction: column;
  align-items: stretch;
}

.dispatch-columns .dispatch-card-actions {
  margin-left: 0;
  align-items: stretch;
}

.dispatch-columns .dispatch-select {
  width: 100%;
  min-width: 0;
}

.dispatch-columns .dispatch-card-actions .btn-primary,
.dispatch-columns .dispatch-card-actions .btn-secondary {
  width: 100%;
}

.dispatch-columns .dispatch-card-header {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem;
}

.dispatch-columns .dispatch-card-amount {
  margin-left: auto;
}

.dispatch-columns .dispatch-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-cart-delivery-info {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.client-cart-delivery-info--compact {
  margin-top: 0.35rem;
}

.client-cart-delivery-hint {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.client-cart-delivery-hint--warn {
  color: var(--danger);
}


.client-cart-delivery-line {
  margin-bottom: 0.15rem;
}

.client-cart-delivery-line--eta {
  font-weight: 500;
}

.kitchen-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.kitchen-filter-btn {
  border-radius: 999px;
  border: 1px solid #ddd;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  background: #f7f7f7;
  cursor: pointer;
}

.kitchen-filter-btn--active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.kitchen-order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.kitchen-order-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.kitchen-order-late-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #f7f7f7;
  border: 1px solid #f7f7f7;
}

.kitchen-order-card--late {
  border-color: #f7f7f7;
  box-shadow: 0 0 0 1px #f7f7f7;
}

.kitchen-order-eta {
  font-weight: 500;
}

/* Dispatch columns: responsive grid (avoid overflow on medium widths) */
.dispatch-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0;
}

.dispatch-column {
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 0.75rem 0.9rem;
  background: #fafafa;
}

.dispatch-column-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.5rem;
}

.dispatch-column-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.dispatch-column-subtitle {
  font-size: 0.8rem;
  opacity: 0.75;
}

.dispatch-column-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.client-orders-empty--small {
  font-size: 0.8rem;
  padding: 0.4rem 0;
}

@media (min-width: 900px) {
  .dispatch-columns {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
  }
}

/* Ensure grid children can shrink without overflowing */
.dispatch-column {
  min-width: 0;
}

.dispatch-card--late {
  border-color: #f7f7f7;
  box-shadow: 0 0 0 1px #f7f7f7;
}

.dispatch-late-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: #f7f7f7;
  border: 1px solid #f7f7f7;
}

.dispatch-eta {
  font-weight: 500;
  font-size: 0.8rem;
}

.dispatch-age {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Timeline "chemin" (client - suivi commande) */
.client-order-path {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
  margin: 0.6rem 0 0.8rem 0;
}

.client-order-path-segment {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.35rem 0.55rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-soft);
  background: transparent;
}

.client-order-path-segment:last-child {
  border-right: none;
}

.client-order-path-segment--done {
  background: var(--accent);
  color: #ffffff;
}

.client-order-path-segment--active {
  background: var(--accent-soft);
  color: var(--text-strong);
  font-weight: 600;
}

.client-order-path-segment--todo {
  background: transparent;
  color: var(--text-soft);
}

.client-order-path-segment--problem {
  background: #111827;
  color: #ffffff;
}

@media (max-width: 600px) {
  .client-order-path-segment {
    font-size: 0.72rem;
    padding: 0.32rem 0.45rem;
  }
}

.client-order-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 0.8rem 0;
}

.client-order-timeline-step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.client-order-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.8);
  background: #111827;
}

.client-order-timeline-label {
  white-space: nowrap;
}

.client-order-timeline-step--done .client-order-timeline-dot {
  border-color: #2563eb;
  background: #2563eb;
}

.client-order-timeline-step--active .client-order-timeline-dot {
  border-color: #2563eb;
  background: #111827;
}

.client-order-timeline-step--todo .client-order-timeline-dot {
  opacity: 0.5;
}

.client-order-timeline-step--problem .client-order-timeline-dot {
  border-color: #2563eb;
  background: #111827;
}

.client-order-timeline-step--active .client-order-timeline-label {
  color: #e5e7eb;
  font-weight: 500;
}

.client-order-status-message {
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-order-sse-hint {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  color: var(--text-soft);
}

.client-order-sse-hint--warning {
  color: #f5f5f5;
}

.client-order-refresh-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.08);
}

@media (max-width: 600px) {
  .client-order-timeline {
    gap: 0.35rem;
  }

  .client-order-timeline-step {
    font-size: 0.75rem;
  }
}

.client-cart-items {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.client-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.client-cart-item-main {
  flex: 1;
  min-width: 0;
}

.client-cart-item-name {
  font-weight: 500;
  color: var(--text-soft);
}

.client-cart-item-meta {
  font-size: 0.75rem;
  color: var(--text-soft);
  opacity: 0.8;
}

.client-cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.client-cart-item-btn {
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(17, 24, 39, 0.08);
}

.client-cart-item-qty-value {
  min-width: 1.2rem;
  text-align: center;
}

.client-cart-item-price {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
}

.client-cart-item-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.9);
}

.client-cart-item-remove:hover {
  color: #f5f5f5;
}

@media (max-width: 640px) {
  .client-cart-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-cart-item-price {
    align-self: flex-end;
  }
}

@media (max-width: 720px) {
  /* Cart actions: thumb-friendly */
  .client-cart-item-btn {
    min-width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.05rem;
  }

  .client-cart-item-qty {
    gap: 0.4rem;
  }

  .client-cart-item-qty-value {
    min-width: 2rem;
    font-size: 0.95rem;
  }

  .client-cart-item-remove {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
  }

  .client-cart-item-price {
    gap: 0.4rem;
  }

  .client-cart-item-edit {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(17, 24, 39, 0.04);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
  }
}


.client-cart-item-note-indicator {
  margin-top: 0.35rem;
  display: inline-block;
  font-size: 0.72rem;
  color: var(--text-soft);
  border: 1px dashed var(--border-subtle);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  background: rgba(17, 24, 39, 0.04);
}



.client-pill-tags {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.client-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(17, 24, 39, 0.06);
  color: var(--text-soft);
  max-width: 100%;
}

.client-pill-tag-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-pill-tag-price {
  font-weight: 700;
  opacity: 0.95;
  white-space: nowrap;
}

/* Panier – erreurs de cohérence (29.3) */
.client-cart-error {
  margin-bottom: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(248, 113, 113, 0.7);
  background: rgba(17, 24, 39, 0.55);
  font-size: 0.78rem;
  color: #f5f5f5;
}

.client-cart-item-flags {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.client-cart-item-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.68rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-soft);
}

.client-cart-item-badge--unavailable {
  border-color: rgba(248, 113, 113, 0.85);
  background: rgba(17, 24, 39, 0.75);
  color: #f5f5f5;
}

.client-cart-item-badge--closed {
  border-color: rgba(37, 99, 235, 0.85);
  background: rgba(17, 24, 39, 0.85);
  color: #e0f2fe;
}

.client-cart-item--disabled {
  opacity: 0.7;
}


.client-cart-clean-actions {
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.client-cart-clean-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.client-cart-clean-btn:hover {
  border-color: rgba(248, 250, 252, 0.9);
}


/* Edition d'une ligne de panier (29.5) */
.client-cart-edit-modal-overlay {
  position: fixed;
  inset: 0;
  /* Backdrop lisible au-dessus du drawer */
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* Le drawer panier est à z-index: 80 → la modale doit passer au-dessus */
  z-index: 110;
}

.client-cart-edit-modal-overlay.is-visible {
  display: flex;
}

.client-cart-edit-modal-card {
  /* Carte pleine (non transparente) */
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  color: var(--text-main);
}

.client-cart-edit-modal-header {
  margin-bottom: 0.5rem;
}

.client-cart-edit-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.client-cart-edit-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.client-cart-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-cart-edit-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.client-cart-edit-qty-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.client-cart-edit-qty-input {
  width: 4rem;
  text-align: center;
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  padding: 0.2rem 0.3rem;
  font-size: 0.85rem;
}

.client-cart-edit-qty-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.client-cart-edit-notes-input {
  width: 100%;
  min-height: 4rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  resize: vertical;
}

.client-cart-edit-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.client-cart-edit-btn {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.client-cart-edit-btn--secondary {
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: transparent;
  color: var(--text-soft);
}

.client-cart-edit-btn--primary {
  border: 1px solid transparent;
  background: var(--accent);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-strong);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}


/* 6.6.9.90 – Popup options à l'ajout (photo gauche, options droite) */
.client-add-item-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 110;
}

.client-add-item-modal-overlay.is-visible {
  display: flex;
}

.client-add-item-modal-card {
  --client-add-photo-size: 388px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  max-width: 860px;
  width: 100%;
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  color: var(--text-main);
}

.client-add-item-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.client-add-item-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.client-add-item-modal-title-text {
  display: inline;
}

.client-add-item-modal-title-price-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.06);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.client-add-item-modal-close {
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.client-add-item-modal-body {
  flex: 1 1 auto;
  min-height: 0;
}

.client-add-item-modal-grid {
  display: grid;
  grid-template-columns: var(--client-add-photo-size) minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 0.9rem;
  align-items: start;
}

.client-add-item-modal-photo {
  grid-column: 1;
  grid-row: 1;
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  align-self: start;
}

.client-add-item-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.client-add-item-modal-img-placeholder {
  width: 100%;
  height: 100%;
}

.client-add-item-modal-options {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  align-self: start;
}

.client-add-item-modal-recos {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

@media (min-width: 721px) {
  .client-add-item-modal-options {
    max-height: var(--client-add-photo-size);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.35rem;
  }

  .client-add-item-modal-options::-webkit-scrollbar {
    width: 8px;
  }

  .client-add-item-modal-options::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
  }

  .client-add-item-modal-options::-webkit-scrollbar-track {
    background: transparent;
  }
}

.client-add-item-modal-error {
  color: #b91c1c;
  font-size: 0.85rem;
  min-height: 1.2rem;
}

.client-add-item-modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.client-add-item-modal-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.client-add-item-modal-qty-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.client-add-item-modal-qty-input {
  width: 4rem;
  text-align: center;
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  padding: 0.2rem 0.3rem;
  font-size: 0.85rem;
}

.client-add-item-modal-qty-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.client-add-item-modal-block-title {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 600;
}

.client-add-item-modal-helper {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.client-add-item-modal-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.client-add-item-modal-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  cursor: pointer;
}

.client-add-item-modal-choice input {
  margin: 0;
}

.client-add-item-modal-choice-label {
  font-size: 0.85rem;
  color: var(--text-main);
}

.client-add-item-modal-choice-label--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
}

.client-add-item-supp-price {
  font-size: 0.82rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

.client-cart-edit-option-name--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
}

.client-cart-edit-supp-price {
  font-size: 0.82rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

.client-add-item-modal-footer {
  margin-top: 0.9rem;
}

.client-add-item-modal-recos {
  margin-bottom: 0;
}

.client-add-item-recos-title {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.client-add-item-recos-carousel {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.client-add-item-reco-card {
  flex: 0 0 auto;
  width: 150px;
  scroll-snap-align: start;
  border: 1px solid var(--border-subtle);
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.55rem;
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
}

.client-add-item-reco-img {
  width: 100%;
  /* Always square thumbnails for "accords recommandés" */
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 0.7rem;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.05);
  margin-bottom: 0.45rem;
  border: 1px solid var(--border-subtle);
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
  .client-add-item-reco-img {
    height: 0;
    padding-top: 100%;
  }
  .client-add-item-reco-img img {
    position: absolute;
    inset: 0;
  }
}

.client-add-item-reco-capsule {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
}

.client-add-item-reco-capsule.is-visible {
  display: inline-flex;
}

.client-add-item-reco-capsule-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
  line-height: 1;
  user-select: none;
}

.client-add-item-reco-capsule-btn:active {
  transform: scale(0.98);
}

.client-add-item-reco-capsule-qty {
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 1.1rem;
  text-align: center;
  color: var(--text-main);
}

.client-add-item-reco-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.client-add-item-reco-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.15rem;
}

.client-add-item-reco-price {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.client-add-item-modal-add {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid transparent;
  background: var(--accent);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-strong);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.8rem 1rem;
  cursor: pointer;
}



/* Bottom sheet (mobile) – handle + subtle entry animation */
.client-sheet-handle {
  display: none;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  margin: 0 auto 0.6rem;
}

@keyframes clientSheetUp {
  from { transform: translateY(16px); opacity: 0.85; }
  to { transform: translateY(0); opacity: 1; }
}

.client-add-item-modal-overlay.is-visible .client-add-item-modal-card,
.client-cart-edit-modal-overlay.is-visible .client-cart-edit-modal-card {
  animation: clientSheetUp 180ms ease-out;
}

@media (max-width: 720px) {
  .client-add-item-modal,
  .client-cart-edit-modal {
    width: 100%;
  }

  /* Bottom-sheet behavior (mobile) */
  .client-add-item-modal-overlay,
  .client-cart-edit-modal-overlay {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0;
  }

  .client-add-item-modal-card,
  .client-cart-edit-modal-card {
    width: 100%;
    max-width: none;
    border-radius: 1.2rem 1.2rem 0 0;
    max-height: calc(var(--app-vh, 100vh) - 10px);
    padding: 0.9rem 0.9rem calc(0.9rem + var(--safe-bottom, 0px));
    display: flex;
    flex-direction: column;
  }

  .client-sheet-handle {
    display: block;
  }

  .client-add-item-modal-body,
  .client-cart-edit-modal-body {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .client-add-item-modal-body {
    padding-right: 0.15rem;
  }

  .client-cart-edit-modal-body {
    padding-right: 0.15rem;
    margin-bottom: 0.5rem;
  }

  /* Layout inside add-item */
  .client-add-item-modal-grid {
    grid-template-columns: 1fr;
    row-gap: 0.8rem;
  }
  .client-add-item-modal-photo {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .client-add-item-modal-options {
    grid-column: auto;
    grid-row: auto;
    overflow: visible;
    max-height: none;
    padding-right: 0;
  }

  .client-add-item-modal-recos {
    grid-column: auto;
    grid-row: auto;
  }

  /* Thumb-friendly CTA */
  .client-add-item-modal-add {
    min-height: 48px;
  }
}


/* Variantes & options dans la modale d'édition (29.6) */
.client-cart-edit-variant-list,
.client-cart-edit-option-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-cart-edit-variant-option,
.client-cart-edit-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.client-cart-edit-variant-option input,
.client-cart-edit-option input {
  width: 1rem;
  height: 1rem;
}

.client-cart-edit-variant-name,
.client-cart-edit-option-name {
  color: var(--text-main);
}

.client-cart-edit-option-group {
  padding: 0.4rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.client-cart-edit-option-group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.client-cart-edit-helper {
  font-size: 0.7rem;
  color: var(--text-soft);
}


/* 30.2 – Bandeau d'erreur réseau globale */
.global-network-error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.2s ease-out;
  background: #111827;
  color: var(--text-strong);
  font-size: 0.85rem;
}

.global-network-error-banner.is-visible {
  transform: translateY(0);
}

.global-network-error-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
}

.global-network-error-text {
  flex: 1;
  line-height: 1.3;
}

.global-network-error-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
}


/* R7 – Toasts (non-blocking) */
.app-toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(0.75rem + var(--safe-bottom));
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.9rem;
  pointer-events: none;
}

.app-toast {
  width: min(520px, 100%);
  background: rgba(17, 24, 39, 0.92);
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.app-toast--error {
  background: rgba(127, 29, 29, 0.92);
  border-color: rgba(255, 255, 255, 0.18);
}

.app-toast--success {
  background: rgba(6, 78, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
}

.app-toast-msg {
  font-size: 0.88rem;
  line-height: 1.25;
  color: inherit;
  min-width: 0;
}

.app-toast-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.app-toast-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.app-toast-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
  opacity: 0.85;
}

/* R7 – Skeleton loaders */
.client-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.client-skeleton-line {
  height: 0.9rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.10);
  overflow: hidden;
  position: relative;
}

.client-skeleton-line.lg {
  height: 1.05rem;
}

.client-skeleton-line.sm {
  height: 0.7rem;
  width: 72%;
}

.client-skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

body {
  padding-top: 0; /* au cas où un padding existe déjà, on le garde à 0 pour l'instant */
}


/* 30.3 – Pastille de statut hors ligne */
.offline-status-pill {
  position: fixed;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: rgba(17, 24, 39, 0.08);
  color: #e5e7eb;
  border-radius: 9999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.offline-status-pill.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Incidents client (32.2) */
.client-incident-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.08);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.client-incident-modal-overlay.is-visible {
  display: flex;
}

.client-incident-modal-card {
  background: rgba(17, 24, 39, 0.08);
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 1rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.08);
}

.client-incident-modal-header {
  margin-bottom: 0.5rem;
}

.client-incident-modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.client-incident-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.client-incident-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-incident-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.client-incident-select,
.client-incident-textarea {
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-main);
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}

.client-incident-textarea {
  resize: vertical;
  min-height: 3.5rem;
}


.client-incident-file {
  border-radius: 0.6rem;
  border: 1px dashed var(--border-subtle);
  background: rgba(17, 24, 39, 0.06);
  color: var(--text-main);
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
}

.client-incident-photo-hint {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.client-incident-photo-preview {
  margin-top: 0.35rem;
}

.client-incident-photo-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.client-incident-view-photo {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.client-incident-view-photo-link {
  font-size: 0.8rem;
  color: var(--accent-main, #2563eb);
  text-decoration: underline;
}

.client-incident-view-photo-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.client-incident-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.client-incident-btn {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.client-incident-btn--secondary {
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: transparent;
  color: var(--text-soft);
}

.client-incident-btn--primary {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--accent);
  color: var(--text-strong);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.client-incident-btn--primary:hover {
  filter: brightness(0.98);
}

.client-incident-feedback {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.client-order-report-btn--reported {
  border: 1px solid rgba(34, 197, 94, 0.55) !important;
}

.client-incident-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.client-incident-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.client-incident-view-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.08);
  white-space: nowrap;
}

.client-incident-view-badge--open,
.client-incident-view-badge--in_progress {
  border-color: rgba(245, 158, 11, 0.55);
}

.client-incident-view-badge--resolved,
.client-incident-view-badge--closed {
  border-color: rgba(34, 197, 94, 0.55);
}

.client-incident-view-meta {
  flex: 1;
}

.client-incident-view-type {
  font-size: 0.9rem;
  font-weight: 600;
}

.client-incident-view-date {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}

.client-incident-view-section {
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 0.75rem;
  padding: 0.65rem;
  background: rgba(17, 24, 39, 0.06);
}

.client-incident-view-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.client-incident-view-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-main);
}

.client-incident-view-row span:first-child {
  color: var(--text-soft);
}

.client-incident-view-message {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.25rem;
}

.client-incident-view-message--muted {
  color: var(--text-soft);
}

.client-incident-view-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.25rem;
}

.client-incident-view-pending {
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* Backoffice incidents (32.3) */

.admin-incident-photo {
  margin-top: 0.5rem;
}

.admin-incident-photo-img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.admin-incident-photo-img--click {
  cursor: zoom-in;
}

.admin-incidents-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.admin-incidents-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
}

.admin-incidents-filter label {
  color: var(--text-soft);
}

.admin-incidents-filter select {
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
}

.admin-incidents-table-wrapper {
  margin-top: 0.5rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.admin-incidents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-incidents-table thead {
  background: rgba(17, 24, 39, 0.08);
}

.admin-incidents-table th,
.admin-incidents-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.admin-incidents-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.15);
  cursor: pointer;
}


.admin-incidents-table tbody tr.admin-incidents-pager-row:hover {
  background: transparent;
  cursor: default;
}

.admin-incidents-pager-row td {
  padding: 0.55rem 0.5rem;
  border-bottom: none;
}

.admin-incidents-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.admin-incidents-pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-strong);
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-incidents-pager-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.admin-incidents-pager-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.admin-incidents-pager-index {
  font-size: 0.85rem;
  color: var(--text-soft);
  background: rgba(17, 24, 39, 0.06);
  border: 1px solid rgba(17, 24, 39, 0.10);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.admin-incidents-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.admin-incidents-page-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

.admin-incidents-page-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}


/* Backoffice incident détail (32.4) */
.admin-incident-detail-card {
  margin-top: 1rem;
}

.admin-incident-headerbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.admin-incident-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Tags (chips) dans l'en-tête incident */
.admin-incident-tags {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.16);
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text-strong);
  font-weight: 600;
}


.admin-tag-k {
  color: var(--text-soft);
}

.admin-tag-v {
  font-weight: 600;
}

.admin-incident-card-subtitle {
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
}

.admin-incident-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-incident-order-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.83rem;
}

.admin-incident-order-meta-k {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.admin-incident-order-meta-v {
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.admin-incident-value--wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Lightbox photo */
.admin-lightbox-card {
  position: relative;
  width: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: min(92vw, 1100px);
}

.admin-lightbox-img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.35);
}

.admin-lightbox-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #fff;
}


.admin-incident-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.9rem;
}

@media (max-width: 860px) {
  .admin-incident-grid {
    grid-template-columns: 1fr;
  }
}

.admin-incident-card {
  /* Fond clair (pas gris) pour matcher le reste du BO */
  background: var(--bg-elevated);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.04);
}

.admin-incident-card--full {
  margin-top: 0.9rem;
}

.admin-incident-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
  color: var(--text-strong);
}

.admin-incident-section {
  margin-top: 1rem;
}

.admin-incident-section-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
}

.admin-incident-field {
  margin-bottom: 0.3rem;
}

.admin-incident-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-incident-label {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.1rem;
}

.admin-incident-value {
  font-size: 0.85rem;
  color: var(--text-strong);
}

.admin-incident-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.08rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.75rem;
}

.admin-incident-status-badge--closed {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.7);
  color: #f5f5f5;
}

.admin-incident-status-badge--high {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.7);
  color: #f5f5f5;
}

.admin-incident-status-badge--medium {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.7);
  color: #f5f5f5;
}

.admin-incident-status-badge--low {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.7);
  color: #dbeafe;
}

.admin-incident-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-incident-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
}

.admin-incident-item:last-child {
  border-bottom: none;
}

.admin-incident-item-name {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.admin-incident-item-restaurant {
  color: var(--text-soft);
}

.admin-incident-item-amount {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}


/* Receipt-style order lines (BO incidents detail) */
.admin-receipt {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-receipt-item {
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
}

.admin-receipt-item:last-child {
  border-bottom: none;
}

.admin-receipt-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.86rem;
}

.admin-receipt-left {
  flex: 1;
}

.admin-receipt-right {
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
}

.admin-receipt-subline {
  margin-top: 0.12rem;
  margin-left: 0.9rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.admin-receipt-subline--note {
  font-style: italic;
}

.admin-receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  font-weight: 600;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.admin-incident-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-incident-timeline-item {
  padding: 0.25rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
}

.admin-incident-timeline-item:last-child {
  border-bottom: none;
}

.admin-incident-timeline-main {
  font-size: 0.82rem;
}

.admin-incident-timeline-status {
  font-weight: 500;
}

.admin-incident-timeline-reason {
  margin-left: 0.3rem;
  color: var(--text-soft);
}

.admin-incident-timeline-meta {
  font-size: 0.7rem;
  color: var(--text-soft);
}

.admin-incident-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-strong);
  font-size: 0.8rem;
}

.admin-incident-textarea {
  resize: vertical;
  min-height: 3rem;
}

.admin-incident-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0;
}

.admin-incident-feedback {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.admin-incident-hint {
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.admin-incident-empty {
  font-size: 0.8rem;
  color: var(--text-soft);
}


/* --- Backoffice dashboard --- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0;
}

.bo-dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.bo-dashboard-range {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.bo-range-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
}

.bo-range-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.bo-range-btn.is-active {
  background: var(--accent);
  color: var(--text-strong);
}

.bo-dashboard-actions .btn-secondary {
  letter-spacing: 0.02em;
}

.dashboard-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.dashboard-period {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dashboard-kpi-card {
  padding: 0.75rem 0.8rem;
  border-radius: 0.75rem;
  background: rgba(17, 24, 39, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.dashboard-kpi-label {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}

.dashboard-kpi-value {
  font-size: 1.2rem;
  font-weight: 600;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 1.5rem;
}

/* --- Restaurant BO dashboard (R33) --- */
.bo-dashboard-row2 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.bo-dashboard-panel {
  padding: 0.9rem 0.9rem;
  border-radius: 0.9rem;
  background: rgba(17, 24, 39, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.3);
  overflow: hidden;
}


/* BO dashboard – fond blanc (cards & panels) */
.dashboard-kpi-card,
.bo-dashboard-panel {
  background: #ffffff;
}
.bo-dashboard-range {
  background: #ffffff;
}
.bo-dashboard-h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.bo-delivery-metric {
  position: relative;
  border-radius: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(17, 24, 39, 0.06);
  padding: 1.1rem 1rem 1.35rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bo-delivery-median {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.bo-delivery-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-soft);
}

.bo-delivery-sub {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.bo-delivery-q1,
.bo-delivery-q3 {
  position: absolute;
  bottom: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.bo-delivery-q1 { left: 0.75rem; }
.bo-delivery-q3 { right: 0.75rem; }

.dashboard-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Generic backoffice table styling */
.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.bo-table th,
.bo-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.bo-table thead th {
  font-size: 0.75rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bo-table tbody tr:hover {
  background: rgba(17, 24, 39, 0.08);
}

@media (max-width: 800px) {
  .dashboard-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .bo-dashboard-row2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Mapbox / Tracking --- */
.dispatch-map-wrapper {
  margin-top: 1.2rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
}

.dispatch-map-header {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(17, 24, 39, 0.03);
}

.dispatch-map-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.dispatch-map-subtitle {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.dispatch-map {
  width: 100%;
  height: clamp(260px, 42vh, 420px);
  background: #f1f5f9;
}

.dispatch-map-marker {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.16);
}

@media (max-width: 560px) {
  .dispatch-map {
    height: 260px;
  }
  .dispatch-map-marker {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

/* Dispatch couriers map modal */
.dispatch-map-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 125;
}

.dispatch-map-modal-overlay.is-visible {
  display: flex;
}

.dispatch-map-modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  max-width: 980px;
  width: 100%;
  max-height: 86vh;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  color: var(--text-main);
}

.dispatch-map-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.dispatch-map-modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-main);
}

.dispatch-map-modal-close {
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dispatch-map-modal-body {
  padding: 12px 12px 14px 12px;
}

.dispatch-map-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
  padding: 0 4px 10px 4px;
}

.dispatch-map.dispatch-map--modal {
  height: clamp(360px, 70vh, 720px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

@media (max-width: 560px) {
  .dispatch-map.dispatch-map--modal {
    height: 70vh;
  }
}


.client-order-map {
  width: 100%;
  height: 260px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
  margin-top: 0.5rem;
}

.client-order-map.is-hidden {
  display: none;
}

.client-map-courier-marker {
  font-size: 18px;
}

.client-order-tracking-text {
  font-size: 0.85rem;
  color: var(--text-soft);
}



.client-address-field--with-suggestions {
  position: relative;
}

.client-address-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.08);
  border-radius: 0.75rem;
  margin-top: 0.25rem;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  border: 1px solid rgba(148,163,184,0.35);
  max-height: 240px;
  overflow-y: auto;
  z-index: 30;
  display: none;
}

.client-address-suggestion {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.75rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.85rem;
  cursor: pointer;
}

.client-address-suggestion:hover {
  background: rgba(55,65,81,0.85);
}


/* ==========================================================
   38.6 – Thème “MayaBay” (style proche du site principal)
   Palette : vert olive #344131 · blush #f4c6c6 · fond #faf7f5
   Objectif : unifier le look du backoffice + client + courier.
   ========================================================== */

:root {
  --bg: #faf7f5;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #fffdfb;
  --border-subtle: rgba(52, 65, 49, 0.18);

  --accent: #f4c6c6;
  --accent-soft: rgba(244, 198, 198, 0.35);
  --accent-strong: #e9b1b1;

  --text-main: #1f1f1f;
  --text-soft: rgba(31, 31, 31, 0.62);
  --text-strong: #1f1f1f;

  --danger: #8a1f2b;
  --danger-soft: rgba(138, 31, 43, 0.08);

  --header-bg: #344131;
  --header-text: #faf7f5;
  --header-muted: rgba(250, 247, 245, 0.78);

  --radius-xl: 1.15rem;
  --font-sans: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  --font-display: "Cormorant Garamond", serif;
}

html,
body {
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
}

/* Header (inspiré du site principal) */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-bottom: none;
  background: var(--header-bg);
  backdrop-filter: none;
}

.app-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  /* Safe-area aware padding for iOS notch + PWA status bar */
  padding: calc(0.85rem + var(--safe-top)) calc(1.25rem + var(--safe-right)) 0.85rem calc(1.25rem + var(--safe-left));
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  justify-self: start;
}

.app-burger {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(250, 247, 245, 0.18);
  background: rgba(250, 247, 245, 0.04);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.app-burger span {
  display: block;
  width: 18px;
  height: 1px;
  background: rgba(250, 247, 245, 0.92);
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.app-burger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.app-burger.is-open span:nth-child(2) {
  opacity: 0;
}

.app-burger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.app-logo {
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.9rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--header-text);
  text-decoration: none;
}

/* Admin – Dropzone upload (commence par l'image de fond restaurant) */
.admin-file-input {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-dropzone {
  width: 100%;
  border: 1px dashed rgba(17, 24, 39, 0.22);
  border-radius: 0.95rem;
  background: #ffffff;
  padding: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: border-color 160ms ease, background 160ms ease;
}

.admin-dropzone.is-dragover {
  border-color: rgba(17, 24, 39, 0.5);
  background: rgba(17, 24, 39, 0.02);
}

.admin-dropzone-inner {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-dropzone-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: none;
}

.admin-dropzone--logo .admin-dropzone-inner {
  min-height: 90px;
}

.admin-dropzone--logo .admin-dropzone-img {
  height: 90px;
  object-fit: contain;
  background: #fff;
  padding: 8px;
}

.admin-dropzone--mark .admin-dropzone-inner {
  min-height: 90px;
}

.admin-dropzone--mark .admin-dropzone-img {
  height: 90px;
  object-fit: contain;
  background: transparent;
  padding: 8px;
}

.admin-dropzone.has-image .admin-dropzone-img {
  display: block;
}

.admin-dropzone-placeholder {
  text-align: center;
  color: rgba(17, 24, 39, 0.62);
  font-size: 0.9rem;
  line-height: 1.25;
  padding: 0.8rem;
}

.admin-dropzone-placeholder small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: rgba(17, 24, 39, 0.5);
}

.admin-dropzone.has-image .admin-dropzone-placeholder {
  display: none;
}

.admin-dropzone-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(17, 24, 39, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.admin-dropzone.can-delete .admin-dropzone-delete {
  display: inline-flex;
}

.admin-dropzone-delete:hover {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.35);
}

.app-env-pill {
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0.25rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(250, 247, 245, 0.18);
  color: var(--header-muted);
  background: rgba(250, 247, 245, 0.05);
  max-width: min(54vw, 620px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.app-header-mark {
  color: var(--header-text);
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Réserve toujours la place du mark dans le header, même si l'image n'est pas encore affichée.
     Cela évite les sauts de layout et rend le comportement déterministe. */
  height: var(--header-mark-height, 68px);
}

.app-logo-mark {
  display: block;
  height: var(--header-mark-height, 68px);
  width: auto;
  /* ZIP 6.6.9.36: affichage 100% déterministe.
     - L'image est masquée tant que 2 conditions ne sont pas vraies:
       (1) thème appliqué (taille connue)
       (2) image chargée/décodée
     - On utilise un data-attribute sur <html> (pas de logique CSS ambiguë).
  */
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease;
}

html[data-header-mark-ready="1"] .app-logo-mark {
  opacity: 1;
  visibility: visible;
}

.app-user-status {
  border: 1px solid rgba(250, 247, 245, 0.2);
  background: rgba(250, 247, 245, 0.05);
  color: var(--header-muted);
}

.app-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.05rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--accent);
  color: var(--text-strong);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.app-cta:hover {
  filter: brightness(0.98);
}

.app-menubar {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(250, 247, 245, 0.16);
  border-bottom: 1px solid var(--border-subtle);
}

/* Subbar used on the Menu page to keep the category tabs always visible */
.app-subbar {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.app-subbar-inner {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (max-width: 720px) {
  .app-subbar-inner {
    padding: 0 1rem;
  }
}

.app-nav {
  justify-content: center;
  gap: 1.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.7rem 1rem;
}

.app-nav a {
  color: var(--text-soft);
  border: none;
  border-radius: 0;
  padding: 0.1rem 0.15rem;
  background: transparent;
}

.app-nav a:hover {
  color: var(--text-main);
  border: none;
  background: transparent;
}

.app-nav a.active {
  color: var(--text-main);
  border: none;
  background: transparent;
  box-shadow: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--accent-strong);
}

/* Onglets visibles uniquement après connexion (affichés via JS quand connecté) */
.nav-auth-only {
  display: none;
}

/* Badges & statuts */

.view-badge,
.view-pill {
  border-color: rgba(52, 65, 49, 0.24) !important;
  color: var(--text-soft) !important;
}

.view-badge.tag-primary {
  border-color: var(--accent-strong) !important;
  background: var(--accent-soft) !important;
  color: var(--text-strong) !important;
}

.client-order-id {
  color: rgba(31, 31, 31, 0.45) !important;
}

.client-order-status--draft {
  border-color: var(--accent-strong) !important;
  background: var(--accent-soft) !important;
  color: var(--text-strong) !important;
}

/* Layout */

.app-main {
  /* Single source of truth for layout padding (used also by full-bleed hero offsets) */
  --app-main-pad: 2rem;       /* top/bottom */
  --app-main-pad-x: 1.5rem;   /* left/right */
  padding: var(--app-main-pad)
           calc(var(--app-main-pad-x) + var(--safe-right))
           calc(var(--app-main-pad) + var(--safe-bottom))
           calc(var(--app-main-pad-x) + var(--safe-left));
}

/* Responsive padding for theme (must be AFTER the theme .app-main rule to win) */
@media (max-width: 820px) {
  .app-main {
    --app-main-pad: 1rem;
    --app-main-pad-x: 1rem;
    padding: var(--app-main-pad)
             calc(var(--app-main-pad-x) + var(--safe-right))
             calc(var(--app-main-pad) + var(--safe-bottom))
             calc(var(--app-main-pad-x) + var(--safe-left));
  }
}

.app-footer {
  background: var(--bg);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

/* Titres */

.view-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 2rem;
}

.client-menu-title,
.client-cart-title,
.client-order-detail-title,
.client-address-form-title {
  font-family: var(--font-display);
  font-weight: 500;
}

/* Surfaces (cartes) */

.view-card {
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 20px 60px rgba(31, 31, 31, 0.06);
}

.auth-card,
.restaurant-card:not(.restaurant-card--hero),
.menu-item-card,
.client-cart-card,
.client-orders-list,
.client-order-detail-card,
.client-address-form,
.client-incident-modal-card,
.client-address-suggestions {
  border: 1px solid var(--border-subtle) !important;
  background: var(--bg-elevated) !important;
  box-shadow: 0 18px 45px rgba(31, 31, 31, 0.05);
}

.restaurant-card:not(.restaurant-card--hero):hover,
.menu-item-card:hover {
  border-color: var(--accent-strong) !important;
}

.restaurant-card:not(.restaurant-card--hero) .restaurant-name,
.menu-item-name,
.client-cart-title,
.client-order-detail-item-name {
  color: var(--text-strong) !important;
}

.restaurant-card:not(.restaurant-card--hero) .restaurant-desc,
.menu-item-desc,
.client-cart-meta,
.client-order-meta,
.client-order-detail-item-meta {
  color: var(--text-soft) !important;
}

.restaurant-card:not(.restaurant-card--hero) .restaurant-pill {
  border-color: rgba(52, 65, 49, 0.24) !important;
  color: var(--text-soft) !important;
}

.restaurant-card:not(.restaurant-card--hero) .restaurant-pill--open {
  border-color: var(--accent-strong) !important;
  background: var(--accent-soft) !important;
  color: var(--text-strong) !important;
}

.menu-item-tag--variant,
.menu-item-tag--options {
  border-color: var(--accent-strong) !important;
}

/* Prix / montants */

.menu-item-price,
.client-cart-total,
.client-order-detail-item-amount {
  color: var(--text-strong) !important;
}

/* Inputs */

.auth-input,
.client-address-input,
.client-incident-select,
.client-incident-textarea {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-main) !important;
}

.auth-input:focus,
.client-address-input:focus,
.client-incident-select:focus,
.client-incident-textarea:focus {
  outline: none;
  border-color: var(--accent-strong) !important;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Boutons */

.auth-button,
.menu-item-add,
.client-cart-action:not(.client-cart-action--cta),
.client-address-button,
.client-cart-edit-btn--primary,
.offline-button {
  border-radius: 0.25rem !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: var(--accent) !important;
  color: var(--text-strong) !important;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.6rem 1rem !important;
}

.auth-button:hover,
.menu-item-add:hover,
.client-cart-action:not(.client-cart-action--cta):hover,
.client-address-button:hover,
.client-cart-edit-btn--primary:hover,
.offline-button:hover {
  filter: brightness(0.985);
}

.menu-item-add:hover,
.client-cart-action:not(.client-cart-action--cta):hover,
.client-address-button:hover,
.auth-button:hover,
.offline-button:hover,
.client-cart-edit-btn--primary:hover,
.app-cta:hover {
  filter: brightness(0.98);
}

.auth-button.secondary,
.client-address-button.secondary,
.client-cart-edit-btn--secondary {
  border: 1px solid var(--border-subtle) !important;
  background: transparent !important;
  color: var(--text-soft) !important;
}

.client-cart-edit-btn {
  border-radius: 0.25rem;
}

.client-message {
  background: var(--bg-elevated-2) !important;
  border: 1px dashed rgba(52, 65, 49, 0.22) !important;
  color: var(--text-soft) !important;
}

.client-message--error {
  border: 1px solid rgba(138, 31, 43, 0.22) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.client-message--warn {
  border: 1px solid rgba(186, 146, 156, 0.35) !important;
  background: rgba(186, 146, 156, 0.12) !important;
  color: var(--text-main) !important;
}

.client-message--success {
  border: 1px solid rgba(52, 65, 49, 0.22) !important;
  background: rgba(52, 65, 49, 0.08) !important;
  color: var(--text-main) !important;
}

.auth-message--success {
  color: rgba(52, 65, 49, 0.92) !important;
}

.auth-message--error {
  color: var(--danger) !important;
}

/* Suggestions d'adresse */

.client-address-suggestion {
  color: var(--text-main) !important;
}

.client-address-suggestion:hover {
  background: var(--accent-soft) !important;
}

/* Bannières / offline pills */

.global-network-error-banner {
  background: var(--header-bg);
  color: var(--header-text);
}

.offline-status-pill {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

/* Offline page */

.offline-body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
}

.offline-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.offline-card {
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 20px 60px rgba(31, 31, 31, 0.06);
  padding: 1.6rem 1.4rem;
  text-align: center;
}

.offline-logo {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.offline-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0.2rem 0 0.6rem 0;
}

.offline-text {
  color: var(--text-soft);
  margin: 0 0 1.1rem 0;
  line-height: 1.5;
}

/* Responsive header menu */

@media (max-width: 820px) {
  .app-env-pill {
    display: none;
  }

  /* Plus de burger : la nav reste visible en mobile */
  .app-menubar {
    display: block;
  }

  .app-nav {
    flex-wrap: wrap;
    gap: 0.9rem;
    padding: 0.65rem 0.8rem;
    font-size: 0.72rem;
  }
}

/* Smartphone: compact header so more content is visible below (without breaking safe-area). */
@media (max-width: 520px) {
  :root { --header-mark-height: 46px; }

  .app-topbar {
    grid-template-columns: auto 1fr auto;
    gap: 0.6rem;
    padding: calc(0.6rem + var(--safe-top)) calc(0.9rem + var(--safe-right)) 0.6rem calc(0.9rem + var(--safe-left));
  }

  .app-logo {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
  }

  .app-header-right {
    gap: 0.55rem;
  }

  .app-nav {
    gap: 1.05rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.7rem;
  }
}


/* 38.7 – Menu items avec photo */

.menu-item-card.has-photo {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.menu-item-photo {
  width: 88px;
  height: 88px;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(31, 31, 31, 0.04);
  flex: 0 0 auto;
}

.menu-item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-item-body {
  flex: 1;
  min-width: 0;
}

@media (max-width: 520px) {
  .menu-item-photo {
    width: 76px;
    height: 76px;
  }
}

/* 38.7 – Admin preview photo plat */

.admin-image-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.admin-image-preview {
  width: 84px;
  height: 84px;
  border-radius: 0.85rem;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
  display: none;
}

.admin-image-preview.is-visible {
  display: block;
}

/* Logo restaurant : pas de fond, pas de bordure (SVG/PNG transparents) */
.admin-image-preview--logo {
  object-fit: contain;
  border: none;
  border-radius: 0;
  background: transparent;
}

.admin-image-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* 38.8 – Auth dans le header + modal */

.app-auth-actions,
.app-user-menu {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* 38.12 – Menu Compte (popover dans le header) */

.account-popover {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  z-index: 85;
  display: none;
  width: min(340px, 92vw);
}

.account-popover.is-open {
  display: block;
}

.account-popover-panel {
  border-radius: 1.1rem;
  border: 1px solid rgba(31, 31, 31, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.account-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(31, 31, 31, 0.08);
}

.account-popover-title {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.account-popover-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(31, 31, 31, 0.12);
  background: rgba(31, 31, 31, 0.03);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.account-popover-close:hover {
  background: rgba(31, 31, 31, 0.06);
}

.account-popover-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem;
}

/* Boutons & contenu dans le popover */
.account-popover-panel .app-auth-actions,
.account-popover-panel .app-user-menu {
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}

.account-popover-panel .app-user-status {
  width: 100%;
  border-radius: 0.85rem;
  padding: 0.55rem 0.75rem;
  background: rgba(31, 31, 31, 0.03);
  border: 1px solid rgba(31, 31, 31, 0.10);
  color: var(--text-main);
  text-transform: none;
  letter-spacing: 0.02em;
}

.account-popover-panel .app-cta--ghost {
  border-color: rgba(31, 31, 31, 0.12);
  color: var(--text-main);
  background: transparent;
}

.account-popover-panel .app-cta--ghost:hover {
  background: rgba(31, 31, 31, 0.05);
  filter: none;
}


html.is-backoffice #app-root .app-cta--ghost {
  border-color: rgba(0, 0, 0, 0.12);
  background: var(--accent);
  color: var(--text-strong);
}

html.is-backoffice #app-root .app-cta--ghost:hover {
  background: var(--accent);
  filter: brightness(0.98);
}
.app-cta--ghost {
  background: transparent;
  border-color: rgba(250, 247, 245, 0.35);
  color: var(--header-text);
}

.app-cta--ghost:hover {
  background: rgba(250, 247, 245, 0.08);
  filter: none;
}


/* -------------------------------------------------------------------------- */
/* Cuisine : modale détails commande ("COMMANDE")                              */
/* -------------------------------------------------------------------------- */

.kitchen-order-details-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 120;
}

.kitchen-order-details-modal-overlay.is-visible {
  display: flex;
}

.kitchen-order-details-modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 82vh;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  color: var(--text-main);
}

.kitchen-order-details-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.kitchen-order-details-modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
}

.kitchen-order-details-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.kitchen-order-details-modal-print {
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
}

.kitchen-order-details-modal-print:hover {
  background: rgba(148, 163, 184, 0.12);
}

.kitchen-order-details-modal-close {
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kitchen-order-details-modal-body {
  padding: 14px 16px 16px 16px;
  overflow: auto;
}

.kitchen-order-details-loading {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.kitchen-order-details-item {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.kitchen-order-details-item:last-child {
  border-bottom: none;
}

.kitchen-order-details-item-title {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-weight: 900;
  color: var(--text-main);
}

.kitchen-order-details-price {
  margin-left: auto;
  font-weight: 900;
  color: var(--text-main);
}

.kitchen-order-details-subtitle {
  margin-top: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.kitchen-order-details-options {
  margin: 6px 0 0 16px;
  padding: 0;
}

.kitchen-order-details-options li {
  margin: 2px 0;
  color: var(--text-main);
}

.kitchen-order-details-notes {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  background: #faf7f5;
  border-radius: 12px;
}

.kitchen-order-details-notes-text {
  margin-top: 6px;
  white-space: pre-wrap;
  color: var(--text-main);
}

body.no-scroll {
  overflow: hidden;
}

/* Quand on verrouille le scroll (modal/drawer), la vraie zone scrollable est .app-scroll */
body.no-scroll .app-scroll,
body.cart-drawer-open .app-scroll,
body.orders-drawer-open .app-scroll {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 100;
}

.auth-modal.is-open {
  display: flex;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(2px);
}

.auth-modal-panel {
  position: relative;
  width: min(520px, 94vw);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 1.25rem 1.25rem 1.1rem;
}

.auth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.auth-modal-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.auth-modal-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.auth-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-close:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.auth-modal-tabs {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 0.45rem 0.2rem;
}

.auth-tab.is-active {
  color: var(--text-main);
  border-bottom: 2px solid var(--accent);
}

.auth-modal-body {
  padding-top: 0.95rem;
}

.auth-modal .auth-card {
  background: transparent;
  border: none;
  padding: 0;
}

.auth-modal .auth-input {
  border-radius: 0.65rem;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  padding: 0.55rem 0.65rem;
}

.auth-modal .auth-button {
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--accent);
  color: var(--text-strong);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.65rem 1.05rem;
}

.auth-modal .auth-button.secondary {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-soft);
}

.auth-modal .auth-oauth-wrap {
  margin-bottom: 0.9rem;
}

.auth-modal .auth-oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border-subtle);
  background: #fff;
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.auth-modal .auth-oauth-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

.auth-modal .auth-oauth-btn:active {
  transform: translateY(1px);
}

.auth-modal .auth-oauth-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.auth-modal .auth-oauth-icon svg {
  display: block;
}

.auth-modal .auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.9rem 0 0.25rem;
  color: var(--text-soft);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-modal .auth-divider::before,
.auth-modal .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-modal .auth-divider span {
  flex: 0 0 auto;
}

.auth-modal .auth-message {
  margin-top: 0;
  min-height: 1.1rem;
}


.auth-forgot-row {
  margin-top: 0.4rem;
  display: flex;
  justify-content: flex-end;
}

/* Login modal: forgot (left) + submit (right) on the same row */
.auth-bottom-row {
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.auth-bottom-row .auth-button {
  margin-left: auto;
}

.auth-link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-link:hover {
  color: var(--text-main);
}

.auth-helper {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.auth-actions--split {
  justify-content: space-between;
  gap: 0.6rem;
}


/* ==========================================================
   38.9 – Panier en volet latéral (drawer)
   ========================================================== */

.app-cta--icon {
  position: relative;
  padding: 0.65rem 0.78rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  line-height: 1;
}

.app-cta--icon .cart-icon {
  display: block;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-strong);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  align-items: center;
  justify-content: center;
}

.app-cta--icon.is-active {
  outline: 2px solid rgba(250, 247, 245, 0.45);
  outline-offset: 2px;
}

/* Drawer shell */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cart-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 31, 31, 0.36);
}

.cart-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 92vw);
  background: var(--bg-elevated-2);
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.is-open .cart-drawer-panel {
  transform: translateX(0);
}

.cart-drawer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-subtle);
}

.cart-drawer-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}

.cart-drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-drawer-panel-body {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

/* Évite le scroll arrière-plan quand le drawer est ouvert */
body.cart-drawer-open {
  overflow: hidden;
}

/* Ajustements de la carte panier dans le drawer */
.cart-drawer-panel-body .client-cart-card {
  margin: 0;
}

@media (max-width: 720px) {
  .app-topbar {
    padding: 0.75rem 1rem;
  }

  /* Drawer -> bottom-sheet on mobile */
  .cart-drawer-panel {
    top: auto;
    right: auto;
    left: 0;
    bottom: 0;
    width: 100%;
    height: calc(var(--app-vh, 1vh) * 100 - var(--safe-top));
    max-height: calc(var(--app-vh, 1vh) * 100 - var(--safe-top));
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }

  .cart-drawer.is-open .cart-drawer-panel {
    transform: translateY(0);
  }

  .cart-drawer-panel-body {
    padding: 0.85rem;
    padding-bottom: calc(0.85rem + var(--safe-bottom));
  }
}



/* Drawer shell – Historique commandes (gauche) */
.orders-drawer {
  position: fixed;
  inset: 0;
  z-index: 75;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.orders-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.orders-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 31, 31, 0.36);
}

.orders-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: min(440px, 92vw);
  background: var(--bg-elevated-2);
  border-right: 1px solid var(--border-subtle);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}

.orders-drawer.is-open .orders-drawer-panel {
  transform: translateX(0);
}

.orders-drawer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-subtle);
}

.orders-drawer-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.orders-drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.orders-drawer-panel-body {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

/* Évite le scroll arrière-plan quand le drawer est ouvert */
body.orders-drawer-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .orders-drawer-panel-body {
    padding: 0.85rem;
  }
}


/* 38.10.2 – Volet Historique : étiquettes avec bord fin gris clair */
#orders-history-drawer .client-order-status,
#orders-history-drawer .client-order-running-badge {
  border-color: rgba(31, 31, 31, 0.18) !important;
}

#orders-history-drawer .client-order-status {
  border-width: 1px !important;
  background: rgba(31, 31, 31, 0.02) !important;
  color: var(--text-soft) !important;
}

#orders-history-drawer .client-order-status--draft {
  border-color: var(--accent-strong) !important;
  background: var(--accent-soft) !important;
  color: var(--text-strong) !important;
}

/* 38.10.3 – Volet Historique : cartes toujours légèrement grisées + layout 2 lignes */
#orders-history-drawer .client-order-row {
  background: rgba(31, 31, 31, 0.03) !important;
  border: 1px solid rgba(31, 31, 31, 0.10) !important;
  padding: 0.6rem 0.65rem !important;
  margin-bottom: 0.55rem;
}

#orders-history-drawer .client-order-row:hover {
  background: rgba(31, 31, 31, 0.05) !important;
}

#orders-history-drawer .client-order-row.is-selected {
  background: rgba(31, 31, 31, 0.055) !important;
  outline: none !important;
  border-color: var(--accent-strong) !important;
}

#orders-history-drawer .client-order-row-main {
  flex: 1;
  min-width: 0;
  gap: 0.35rem;
}

#orders-history-drawer .client-order-row-line1,
#orders-history-drawer .client-order-row-line2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#orders-history-drawer .client-order-row-restaurants {
  font-weight: 600;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

#orders-history-drawer .client-order-row-total {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

#orders-history-drawer .client-order-row-whenwhere {
  color: var(--text-soft);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

#orders-history-drawer .client-order-status {
  flex-shrink: 0;
}

/* 38.9.4 – Panier : checkout en 2 étapes (Panier -> Livraison & paiement) */

.client-cart-steps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.1rem 0.25rem;
}

.client-cart-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.client-cart-step.is-active {
  color: var(--text-main);
  font-weight: 500;
}

.client-cart-step-num {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.client-cart-step.is-active .client-cart-step-num {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--text-strong);
}

.client-cart-step-sep {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
  opacity: 0.9;
}

.client-cart-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


/* R7 – Mobile checkout footer: CTA always reachable */
@media (max-width: 720px) {
  .cart-drawer-panel-body .client-cart-footer {
    position: sticky;
    bottom: 0;
    margin-top: 0.6rem;
    padding-top: 0.75rem;
    padding-bottom: calc(0.75rem + var(--safe-bottom));
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(10px);
    border-radius: 0 0 1rem 1rem;
  }

  .cart-drawer-panel-body .client-cart-action:not(.client-cart-action--cta) {
    min-height: 48px;
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
  }

  .client-cart-footer-actions--stack {
    flex-direction: column;
    align-items: stretch;
  }

  .client-cart-footer-actions--stack .client-cart-action.secondary {
    width: 100%;
  }
}

.client-cart-footer-actions .client-cart-action.secondary {
  flex: 0 0 auto;
}

.client-cart-footer-actions .client-cart-action:not(.secondary) {
  flex: 1;
}

.client-cart-action.secondary {
  border: 1px solid var(--border-subtle) !important;
  background: transparent !important;
  color: var(--text-soft) !important;
}

.client-cart-payment-hint {
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}


/* R7 – Loading spinner inside actions */
.client-cart-action.is-loading,
.client-order-pay-btn.is-loading {
  opacity: 0.92;
  cursor: progress;
}

.client-cart-action.is-loading::after,
.client-order-pay-btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-right-color: transparent;
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

.client-cart-action.secondary.is-loading::after,
.client-cart-action--cta.is-loading::after {
  border: 2px solid rgba(17, 24, 39, 0.45);
  border-right-color: transparent;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.client-cart-checkout {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.client-cart-checkout-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 0.35rem;
}

.client-cart-checkout-hint {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 0.25rem;
}

.client-cart-items--readonly .client-cart-item {
  padding: 0.25rem 0.1rem;
}

.client-cart-item--readonly .client-cart-item-price {
  font-variant-numeric: tabular-nums;
}

.client-cart-item-qty-inline {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-left: 0.35rem;
}




/* 38.11 – Admin zones de livraison (polygones Mapbox) */
.admin-zones-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 980px) {
  .admin-zones-layout {
    grid-template-columns: 1fr;
  }
}

/* Nouvelle mise en page : 1 colonne (adresse restaurant + zones) */
.admin-zones-stack {
  display: block;
}

.admin-rest-address-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  background: rgba(17, 24, 39, 0.02);
}

.admin-rest-address-restaurant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.admin-rest-address-address-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.admin-rest-address-validity {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
}

.admin-rest-address-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}



.admin-rest-address-line2-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.admin-rest-address-line2-row .admin-rest-address-line2 {
  margin-top: 0;
}

.admin-rest-address-line2-row .admin-rest-address-actions {
  margin-top: 0;
}

.admin-block.admin-block--rest-address {
  margin-bottom: 1.5rem;
}

.admin-zone-actions {
  justify-content: flex-end;
  align-items: center;
}
.admin-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.admin-block-header .admin-block-title {
  margin-bottom: 0;
}


.admin-rest-address-summary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.admin-rest-address-restaurant-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  min-width: 0;
}

.admin-rest-address-summary-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.admin-rest-address-summary-main {
  min-width: 0;
}

.admin-rest-address-line1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
}

.admin-rest-address-line2 {
  margin-top: 0.25rem;
  font-size: 0.86rem;
  color: var(--text-soft);
}

@media (max-width: 680px) {
  #admin-rest-address-open {
    width: 100%;
  }
}

/* Modal édition adresse restaurant */
.rest-address-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
}
.rest-address-overlay.is-visible {
  display: flex;
}
.rest-address-backdrop {
  position: absolute;
  inset: 0;
}
.rest-address-card {
  position: relative;
  width: min(680px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}
.rest-address-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
}
.rest-address-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.rest-address-subtitle {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}
.rest-address-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}
.rest-address-body {
  padding: 1rem;
  overflow: auto;
}

/* Modal création zone */
.zone-create-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
}
.zone-create-overlay.is-visible {
  display: flex;
}
.zone-create-backdrop {
  position: absolute;
  inset: 0;
}
.zone-create-card {
  position: relative;
  width: min(680px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}
.zone-create-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
}
.zone-create-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.zone-create-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}
.zone-create-body {
  padding: 1rem;
  overflow: auto;
}
}

.admin-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1rem;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  margin-bottom: 0;
}

.admin-block-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.admin-select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: #fff;
}

.admin-note {
  margin-top: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
  background: rgba(17, 24, 39, 0.03);
  padding: 0.6rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.admin-zones-hint {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.admin-zone-card {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 0.9rem;
  background: #fff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  margin-bottom: 0.9rem;
}

.admin-zone-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}


.admin-zone-card-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0.9rem;
  align-items: stretch;
}

@media (max-width: 980px) {
  .admin-zone-card-split {
    grid-template-columns: 1fr;
  }
}

.admin-zone-card-left {
  min-width: 0;
}

.admin-zone-card-right {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.02);
  min-height: 220px;
}

.admin-zone-map-preview {
  width: 100%;
  height: 220px;
}

@media (max-width: 980px) {
  .admin-zone-card-right,
  .admin-zone-map-preview {
    height: 200px;
    min-height: 200px;
  }
}

.admin-zone-map-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.72rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
}


.admin-zone-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-zone-active {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.admin-zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 980px) {
  .admin-zone-grid {
    grid-template-columns: 1fr;
  }
}

.admin-zone-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
}

.admin-zone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.03);
  font-size: 0.74rem;
  color: var(--text-soft);
}

.admin-zone-chip--ok {
  background: rgba(100, 200, 150, 0.14);
  border-color: rgba(100, 200, 150, 0.28);
  color: rgba(24, 90, 54, 0.95);
}

.admin-zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

/* Polygone modal */
.zone-poly-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}

.zone-poly-overlay.is-visible {
  display: block;
}

.zone-poly-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.zone-poly-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 2rem));
  height: min(720px, calc(100vh - 2rem));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.zone-poly-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
}

.zone-poly-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.zone-poly-subtitle {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.zone-poly-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}

.zone-poly-toolbar {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.02);
}

.zone-poly-map {
  flex: 1;
  min-height: 420px;
}

.zone-poly-help {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  border-top: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.02);
}


/* Restaurant: next opening message (when closed) */
.restaurant-next-open {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #ffffff;
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Admin: opening hours editor */
.admin-opening-panel {
  margin-top: 0.4rem;
}

.admin-opening-mode-wrap {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
}

.admin-opening-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-opening-mode-title {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.admin-opening-mode-pills {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.10);
  padding: 0.22rem;
  border-radius: 999px;
}

.admin-opening-mode-pill {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.admin-opening-mode-pill.is-active {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
}

.admin-opening-mode-hint {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.62);
}

.admin-opening-mode-select {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-opening-grid--cards {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 760px) {
  .admin-opening-grid--cards {
    grid-template-columns: 1fr;
  }
}

/* Excel-like opening hours grid (7 jours × 48 slots de 30 min) */
.admin-opening-grid--excel {
  margin-top: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 18px;
  overflow: hidden;
}

.admin-opening-grid--excel.is-disabled {
  opacity: 0.60;
  filter: grayscale(0.25);
}

.admin-opening-grid--excel.is-disabled .admin-opening-cell {
  pointer-events: none;
  cursor: default;
}

.admin-opening-excel-wrap {
  overflow: auto;
  max-height: 560px;
}

.admin-opening-excel {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

.admin-opening-excel-th,
.admin-opening-excel-time {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
  font-size: 0.86rem;
  font-weight: 650;
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
  text-align: center;
  letter-spacing: 0.01em;
}

.admin-opening-excel-time {
  left: 0;
  z-index: 4;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(0, 0, 0, 0.55);
  width: 88px;
  min-width: 88px;
  border-right: 1px solid rgba(0, 0, 0, 0.10);
}

.admin-opening-excel-time--head {
  color: rgba(0, 0, 0, 0.75);
}

.admin-opening-excel-td {
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-opening-cell {
  display: block;
  width: 100%;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.admin-opening-cell.is-on {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.admin-opening-cell:hover {
  background: rgba(0, 0, 0, 0.05);
}

.admin-opening-cell.is-on:hover {
  background: rgba(41, 153, 163, 0.20);
}

.admin-opening-cell:focus-visible {
  outline: 2px solid rgba(41, 153, 163, 0.55);
  outline-offset: -2px;
}

.admin-opening-excel-legend {
  padding: 0.65rem 0.8rem;
  font-size: 0.88rem;
  color: rgba(0, 0, 0, 0.60);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 760px) {
  .admin-opening-excel {
    min-width: 640px;
  }
  .admin-opening-excel-wrap {
    max-height: 520px;
  }
  .admin-opening-cell {
    height: 20px;
  }
}

.admin-opening-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 18px;
  padding: 0.85rem 0.9rem;
}

.admin-opening-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-opening-day {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.admin-opening-state {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.10);
  padding: 0.22rem;
  border-radius: 999px;
}

.admin-opening-state-pill {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0.33rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.admin-opening-state-pill.is-active {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
}

.admin-opening-closed-input {
  position: absolute;
  left: -9999px;
}

.admin-opening-times {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.admin-opening-time {
  width: 8.5rem;
  max-width: 100%;
}

.admin-opening-sep {
  opacity: 0.65;
}

.admin-opening-row.is-closed .admin-opening-day {
  opacity: 0.75;
}


/* Carousel global (avant sélection d'un restaurant) */
.client-global-featured {
  margin-top: 1rem;
}



/* -------------------------------------------------------------------------- */
/* Native dialogs (replacement for browser alert/confirm/prompt)               */
/* -------------------------------------------------------------------------- */

body.has-native-dialog {
  overflow: hidden;
}

.native-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.native-dialog-overlay.is-visible {
  display: flex;
}

.native-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(6px);
}

.native-dialog-card {
  position: relative;
  width: min(520px, calc(100vw - 2rem));
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: var(--bg-elevated);
  box-shadow: 0 30px 90px rgba(17, 24, 39, 0.22);
  overflow: hidden;
  z-index: 1;
}

.native-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.6rem 1.1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.native-dialog-title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-strong);
}

.native-dialog-close {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(17, 24, 39, 0.06);
  color: var(--text-main);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.native-dialog-close:hover {
  background: rgba(17, 24, 39, 0.1);
}

.native-dialog-body {
  padding: 0.9rem 1.1rem 0.2rem 1.1rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.native-dialog-line {
  line-height: 1.4;
  margin: 0.25rem 0;
}

.native-dialog-spacer {
  height: 0.6rem;
}

.native-dialog-input-row {
  display: none;
  padding: 0.3rem 1.1rem 0.2rem 1.1rem;
}

.native-dialog-input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(17, 24, 39, 0.03);
  outline: none;
  font-size: 0.95rem;
}

.native-dialog-input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.native-dialog-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding: 0.9rem 1.1rem 1.05rem 1.1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.native-dialog-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: rgba(17, 24, 39, 0.05);
  color: var(--text-main);
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.native-dialog-btn:hover {
  background: rgba(17, 24, 39, 0.08);
}

.native-dialog-btn.is-ghost {
  background: transparent;
}

.native-dialog-btn.is-primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.native-dialog-btn.is-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.native-dialog-btn.is-danger {
  border-color: rgba(17, 24, 39, 0.9);
  background: rgba(17, 24, 39, 0.9);
  color: #ffffff;
}

.native-dialog-btn.is-danger:hover {
  background: rgba(17, 24, 39, 0.8);
}

.native-dialog-overlay[data-kind="danger"] .native-dialog-card {
  border-color: rgba(17, 24, 39, 0.7);
}



/* 39.1 – Popup photo plat (lightbox) */
body.has-dish-photo-lightbox.no-scroll {
  overflow: hidden;
}

.dish-photo-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.dish-photo-lightbox.is-open {
  display: flex;
}

.dish-photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.dish-photo-lightbox-card {
  position: relative;
  max-width: min(92vw, 980px);
  max-height: 88vh;
  width: auto;
  border-radius: 1.25rem;
  background: rgba(17, 24, 39, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 1;
  backdrop-filter: blur(10px);
}

.dish-photo-lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.25);
}

.dish-photo-lightbox-img {
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  cursor: zoom-out;
}

.dish-photo-lightbox-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(17, 24, 39, 0.35);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.dish-photo-lightbox-close:hover {
  background: rgba(17, 24, 39, 0.5);
}

.dish-photo-lightbox-caption {
  padding: 0.65rem 0.95rem 0.85rem 0.95rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.2);
}

.dish-photo-lightbox.is-loading .dish-photo-lightbox-card {
  opacity: 0.98;
}

@media (max-width: 520px) {
  .dish-photo-lightbox-card {
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 1rem;
  }
  .dish-photo-lightbox-img {
    max-width: 96vw;
    max-height: 82vh;
  }
  .dish-photo-lightbox-close {
    top: 0.45rem;
    right: 0.45rem;
  }
}


/* -------------------------------------------------------------------------- */
/* COMING SOON (Stripe not connected)                                          */
/* -------------------------------------------------------------------------- */

html.coming-soon-active,
html.coming-soon-active body {
  overflow: hidden !important;
}

.coming-soon-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.coming-soon-overlay[hidden] {
  display: none !important;
}

.coming-soon-card {
  width: min(420px, calc(100vw - 48px));
  padding: 28px 22px;
  border-radius: 18px;
  text-align: center;
}

.coming-soon-logo {
  display: block;
  margin: 0 auto;
  max-width: 220px;
  max-height: 140px;
  width: auto;
  height: auto;
}

.coming-soon-title {
  margin-top: 18px;
  font-family: var(--font-display, var(--font-sans, system-ui, sans-serif));
  font-size: 22px;
  letter-spacing: 0.22em;
  color: #fff;
}

.coming-soon-sub {
  margin-top: 10px;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 14px;
  color: rgba(255,255,255,0.78);
}


/* Admin Zones: cards (read-only) */
.admin-zone-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
}
@media (max-width: 980px) {
  .admin-zone-info-grid {
    grid-template-columns: 1fr;
  }
}
.admin-zone-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.02);
  font-size: 0.86rem;
  color: var(--text-soft);
}
.admin-zone-info strong {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Modal édition zone (infos + polygone) */
.zone-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
}
.zone-edit-overlay.is-visible {
  display: flex;
}
.zone-edit-backdrop {
  position: absolute;
  inset: 0;
}
.zone-edit-card {
  position: relative;
  width: min(980px, calc(100vw - 2rem));
  max-height: min(820px, calc(100vh - 2rem));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}
.zone-edit-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
}
.zone-edit-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.zone-edit-subtitle {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}
.zone-edit-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}
.zone-edit-body {
  padding: 1rem;
  overflow: auto;
}
.zone-edit-section {
  margin-top: 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.02);
}
.zone-edit-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  background: #fff;
}
.zone-edit-section-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.zone-edit-map {
  height: 360px;
  background: #f7f7f7;
}
@media (max-width: 680px) {
  .zone-edit-map {
    height: 300px;
  }
}
.zone-edit-help {
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  border-top: 1px solid var(--border-subtle);
  background: rgba(17, 24, 39, 0.02);
}
.zone-edit-footer {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

/* Modal édition utilisateur (BO) */
.user-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(31, 31, 31, 0.42);
  backdrop-filter: blur(2px);
}
.user-edit-overlay.is-visible {
  display: flex;
}
.user-edit-backdrop {
  position: absolute;
  inset: 0;
}
.user-edit-card {
  position: relative;
  width: min(820px, calc(100vw - 2rem));
  max-height: min(820px, calc(100vh - 2rem));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}
.user-edit-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
}
.user-edit-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.user-edit-subtitle {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}
.user-edit-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}
.user-edit-body {
  padding: 1rem;
  overflow: auto;
}

.user-edit-section {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.02);
}
.user-edit-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  background: #fff;
}
.user-edit-section-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-edit-section .admin-zone-grid {
  padding: 0 0.9rem 0.9rem;
}

.user-edit-password-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem 0.9rem 0;
}
.user-edit-password-row .admin-input {
  flex: 1;
}

.user-edit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
}
.user-edit-footer-actions {
  display: flex;
  gap: 0.6rem;
}

@media (max-width: 680px) {
  .user-edit-password-row {
    flex-direction: column;
    align-items: stretch;
  }
  .user-edit-password-row button {
    width: 100%;
  }
  .user-edit-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .user-edit-footer button {
    width: 100%;
  }
  .user-edit-footer-actions {
    flex-direction: column;
  }
}


/* --- Cuisine cards: items preview + "Client" button --- */
.kitchen-card-items-block {
  margin-top: 0;
}

.kitchen-card-items-count {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  opacity: 0.78;
  letter-spacing: 0.02em;
}

.kitchen-card-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kitchen-card-item {
  min-width: 0;
  background: rgba(17, 24, 39, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
}

.kitchen-card-item-main {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.kitchen-card-item-qty,
.kitchen-card-item-mult {
  font-variant-numeric: tabular-nums;
  opacity: 0.82;
}

.kitchen-card-item-name {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kitchen-card-item-meta {
  margin-left: 1.35rem;
  margin-top: 0.1rem;
  opacity: 0.78;
  font-size: 0.82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.kitchen-card-items-empty {
  opacity: 0.7;
  font-size: 0.88rem;
}

.kitchen-card-items-more {
  margin-top: 0.35rem;
  opacity: 0.7;
  font-size: 0.8rem;
}

/* Bouton action CLIENT (ouvre la modale client) */
.dispatch-card-actions .btn-client {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  padding: 0.7rem 0.9rem;
}

/* Dispatch: champs client dans le corps (bullets compactes) */
.dispatch-client-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.dispatch-client-bullets li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.15;
  opacity: 0.95;
}

.dispatch-client-bullets li::before {
  content: "•";
  opacity: 0.6;
  margin-right: 0.25rem;
}

.dispatch-bullet-label {
  font-weight: 650;
  white-space: nowrap;
}

.dispatch-bullet-sep {
  opacity: 0.65;
  white-space: nowrap;
}

.dispatch-bullet-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Modale CLIENT (Restaurants / Livraison / Statut) */
.kitchen-client-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kitchen-client-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
}

.kitchen-client-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kitchen-client-value {
  font-size: 0.95rem;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.kitchen-kanban .dispatch-card-main {
  cursor: pointer;
}


/* Kitchen (BO) — align CLIENT and action button on one row */
.kitchen-kanban .dispatch-card-actions {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 900px) {
  .kitchen-kanban .dispatch-card-actions {
    align-items: center;
  }
}

/* Admin menu — Suppléments (chips) */
.admin-supplements {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-supplements-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.admin-supplements-input-row .admin-input {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-supplements-input-row .admin-input.admin-input--price {
  flex: 0 0 110px;
}

.admin-supplements-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-supp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.admin-supp-chip-text {
  font-size: 0.92rem;
  color: var(--text-main);
}

.admin-supp-chip-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  color: var(--text-soft);
}

.admin-supplements-empty {
  font-size: 0.92rem;
  color: var(--text-soft);
}


/* Admin menu — Suggestions (accords recommandés) */
.admin-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-suggestions-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.admin-suggestions-count {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.admin-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-sugg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.admin-sugg-modal-search {
  margin-bottom: 0.75rem;
}

.admin-sugg-modal-list {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 0.8rem;
  background: rgba(0, 0, 0, 0.02);
}

.admin-sugg-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.admin-sugg-row:last-child {
  border-bottom: none;
}

.admin-sugg-row input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
}

.admin-sugg-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.admin-sugg-row-name {
  font-size: 0.92rem;
  color: var(--text-main);
}

.admin-sugg-row-meta {
  font-size: 0.78rem;
  color: var(--text-soft);
}


/* Extra breathing room after the menu items (helps on mobile with browser/tab bars). */
.client-menu-area #client-menu {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
}

/* iOS Safari: prevent automatic zoom on form fields (requires >=16px font-size). */
@media (max-width: 520px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px;
  }
}


/* R6 — Cart / address selector mobile helpers */
.client-cart-cta-row--stack {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .client-cart-address-select {
    font-size: 16px;
    padding: 0.65rem 0.75rem;
  }
  .client-cart-address-selector {
    font-size: 0.95rem;
  }
}

/* -------------------------------------------------------------------------- */
/* R9 – Polish mobile (A11y + touch UX)                                       */
/* -------------------------------------------------------------------------- */

/* Touch & click: remove 300ms delays / improve responsiveness */
:where(button, a, .btn-primary, .btn-secondary, .btn-danger, .auth-button, .menu-item-add, .client-cart-action, .client-address-button, .client-cart-edit-btn, .app-cta, .menu-sections-nav-btn) {
  touch-action: manipulation;
}

/* Keyboard focus ring (only when relevant) */
:where(a, button, .btn-primary, .btn-secondary, .btn-danger, .auth-button, .menu-item-add, .client-cart-action, .client-address-button, .client-cart-edit-btn, .app-cta, .menu-sections-nav-btn, .btn-icon):focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Prefer not to show focus outlines when it is not keyboard-driven */
:where(a, button, .btn-primary, .btn-secondary, .btn-danger, .auth-button, .menu-item-add, .client-cart-action, .client-address-button, .client-cart-edit-btn, .app-cta, .menu-sections-nav-btn, .btn-icon):focus:not(:focus-visible) {
  outline: none;
}

/* Prevent sticky hover states on touch devices (iOS Safari) */
@media (hover: none) and (pointer: coarse) {
  .auth-button:hover,
  .menu-item-add:hover,
  .client-cart-action:hover,
  .client-cart-action--cta:hover,
  .client-address-button:hover,
  .client-cart-edit-btn--primary:hover,
  .offline-button:hover,
  .app-cta:hover,
  .btn-secondary:hover,
  .btn-danger:hover {
    filter: none !important;
  }

  .restaurant-card:not(.restaurant-card--hero):hover,
  .menu-item-card:hover {
    border-color: var(--border-subtle) !important;
  }

  .menu-sections-nav-btn:hover {
    background: transparent !important;
  }

  .app-nav a:hover {
    background: transparent !important;
  }
}

/* Pressed feedback on touch */
@media (pointer: coarse) {
  .auth-button:active,
  .menu-item-add:active,
  .client-cart-action:active,
  .client-cart-action--cta:active,
  .client-address-button:active,
  .client-cart-edit-btn:active,
  .app-cta:active,
  .btn-primary:active,
  .btn-secondary:active,
  .btn-danger:active,
  .menu-sections-nav-btn:active {
    transform: translateY(1px);
    filter: brightness(0.97);
  }
}

/* Reduce motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ZIP R31 — BO Settings redesign (grid cards, dropzones, single save button) */
.bo-settings-note{
  color:var(--text-soft);
  margin-top:.25rem;
}

.bo-settings-wrap{
  background: var(--bg-elevated, #fff);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  padding: 1rem;
}

.bo-settings-block-title{
  font-weight: 650;
  letter-spacing: .01em;
}

.bo-settings-subnote{
  margin-top:.55rem;
  color:var(--text-soft);
  font-size:.95rem;
}

.bo-settings-grid{
  display:grid;
  gap: 12px;
}

.bo-settings-grid--colors{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bo-settings-grid--fonts{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bo-settings-grid--branding{ grid-template-columns: repeat(4, minmax(0, 1fr)); }

.bo-settings-restaurant-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bo-settings-lang-col{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  padding:14px;
  min-width:0;
}

.bo-settings-lang-title{
  font-size:.78rem;
  color:var(--text-soft);
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:10px;
}

.bo-settings-restaurant-meta{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.bo-settings-lang-toggle-row{
  display:flex;
  flex-wrap:wrap;
  gap: 1rem;
}

@media (max-width: 980px){
  .bo-settings-grid--colors{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bo-settings-grid--branding{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bo-settings-restaurant-grid,
  .bo-settings-restaurant-meta{ grid-template-columns: 1fr; }
}

@media (max-width: 640px){
  .bo-settings-grid--colors,
  .bo-settings-grid--fonts,
  .bo-settings-grid--branding,
  .bo-settings-restaurant-grid,
  .bo-settings-restaurant-meta{ grid-template-columns: 1fr; }
}

.bo-settings-card{
  background:#fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

.bo-settings-card-title{
  font-size: .78rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.bo-color-swatch{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.bo-color-text{
  width: 100%;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  padding: .55rem .65rem;
  font-size: .95rem;
  background: #fff;
}

.bo-font-preview{
  height: 86px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.02);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 10px;
  font-size: 22px;
  line-height: 1.15;
}

.bo-font-select{
  width: 100%;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  padding: .55rem .65rem;
  font-size: .95rem;
  background: #fff;
}

.bo-hidden-file{ display:none; }

.bo-dropzone{
  height: 96px;
  border-radius: 14px;
  border: 1px dashed rgba(0,0,0,.20);
  background: rgba(0,0,0,.015);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  cursor:pointer;
}

.bo-dropzone.is-drag{
  border-color: var(--accent);
  background: rgba(0,0,0,.03);
}

.bo-dropzone[aria-disabled="true"]{
  opacity: .6;
  cursor: not-allowed;
}

.bo-dropzone-img{ width: 100%; height: 100%; object-fit: cover; }
.bo-dropzone-img--contain{ object-fit: contain; background:#fff; padding: 8px; }

.bo-dropzone-placeholder{
  color: var(--text-soft);
  font-size: .9rem;
}

.bo-card-hint{
  margin-top: 8px;
  color: var(--text-soft);
  font-size: .85rem;
}

.bo-settings-footer{
  margin-top: 1rem;
  display:flex;
  justify-content:flex-end;
}



/* BO Paiements – cartes Stripe */
.bo-payments-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
}

.bo-payments-status{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap:wrap;
}

.bo-payments-actions{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap:wrap;
}

.bo-payments-grid{
  display:grid;
  gap: 12px;
  /* Desktop: 2 colonnes sur 2 lignes (4 cartes) */
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 980px){
  .bo-payments-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .bo-payments-grid{ grid-template-columns: 1fr; }
}

.bo-pay-card{
  background:#fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  min-height: 92px;
}

.bo-pay-card-title{
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.bo-pay-card-main{
  margin-top: 10px;
  font-size: 1.05rem;
  color: var(--text-strong);
  font-weight: 600;
  word-break: break-word;
}

.bo-pay-card-sub{
  margin-top: 6px;
  font-size: .9rem;
  color: var(--text-soft);
  line-height: 1.25;
}

.bo-pay-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: .22rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  color: var(--text-strong);
  font-weight: 600;
  font-size: .9rem;
}

.bo-pay-pill--success{
  background: rgba(16,185,129,.16);
  border-color: rgba(16,185,129,.35);
}

.bo-pay-pill--error{
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.35);
}

.bo-pay-chip{
  display:inline-flex;
  align-items:center;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  color: var(--text-soft);
  font-weight: 600;
  font-size: .82rem;
}

.bo-pay-muted{
  color: var(--text-soft);
  font-size: .92rem;
}

.bo-pay-kv{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.bo-pay-kv-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
  font-size: .95rem;
  color: var(--text-soft);
}

.bo-pay-ok{
  color: var(--text-strong);
  font-weight: 700;
}

.bo-pay-no{
  color: var(--text-soft);
}


.admin-menu-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-menu-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-menu-shell-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-items-container--full {
  gap: 1rem;
}
.admin-menu-section-card {
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: #fff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.04);
  padding: 0.85rem 0.95rem;
}
.admin-menu-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-menu-section-meta { min-width: 0; }
.admin-menu-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
}
.admin-menu-section-description {
  margin-top: 0.2rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}
.admin-menu-section-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-item-row--static { cursor: default; }
.admin-item-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.admin-modal-card--wide { width: min(760px, 100%); }
.admin-modal-card--xl { width: min(1080px, 100%); }
.admin-i18n-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
}
.admin-i18n-column {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.9rem;
  background: rgba(17, 24, 39, 0.02);
}
.admin-i18n-column-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.65rem;
}
.admin-item-modal-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}
@media (max-width: 960px) {
  .admin-i18n-columns,
  .admin-item-modal-intro {
    grid-template-columns: minmax(0, 1fr);
  }
}


#admin-category-modal-overlay .admin-modal-card,
#admin-item-modal-overlay .admin-modal-card {
  width: 86vw;
  max-width: 86vw;
  height: 86vh;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

#admin-category-modal-overlay .admin-modal-body,
#admin-item-modal-overlay .admin-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#admin-item-supplements-modal-overlay .admin-modal-card,
#admin-item-variants-modal-overlay .admin-modal-card,
#admin-item-option-groups-modal-overlay .admin-modal-card,
#admin-item-suggestions-modal-overlay .admin-modal-card {
  width: min(840px, 100%);
  max-width: min(840px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

#admin-item-supplements-modal-overlay .admin-modal-body,
#admin-item-variants-modal-overlay .admin-modal-body,
#admin-item-option-groups-modal-overlay .admin-modal-body,
#admin-item-suggestions-modal-overlay .admin-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 960px) {
  #admin-category-modal-overlay .admin-modal-card,
  #admin-item-modal-overlay .admin-modal-card {
    width: min(92vw, 92vw);
    max-width: 92vw;
    height: min(92vh, 92vh);
    max-height: 92vh;
  }
}


.admin-item-modal-form--v2 {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.admin-item-form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.admin-item-form-main,
.admin-item-form-side {
  min-width: 0;
}

.admin-item-form-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-item-form-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0;
}

.admin-item-form-section {
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.02);
}

.admin-item-form-section--side {
  background: rgba(255,255,255,0.78);
}

.admin-item-form-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.admin-item-form-section-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  margin-bottom: 0.18rem;
}

.admin-item-form-section-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--text-strong);
}

.admin-item-form-section-hint {
  max-width: 280px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-soft);
  text-align: right;
}

.admin-item-form-subsection {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
}

.admin-item-form-subsection:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.admin-item-form-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.admin-item-form-subtitle {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.65rem;
}

.admin-item-form-subsection-head .admin-item-form-subtitle {
  margin-bottom: 0;
}

.admin-item-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
}

.admin-item-metrics-grid--compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.7rem;
}

.admin-item-metrics-grid--compact .admin-field-label {
  font-size: 0.73rem;
}

.admin-item-form-grid {
  display: grid;
  gap: 0.9rem;
}

.admin-item-form-grid--duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-item-form-grid--cards {
  gap: 0.8rem;
}

.admin-item-summary-card {
  min-height: 132px;
}

.admin-item-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.admin-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-size: 0.9rem;
  color: var(--text-main);
}

.admin-summary-chip--muted {
  color: var(--text-soft);
}

.admin-item-side-fields {
  display: grid;
  gap: 0.75rem;
}

.admin-item-side-fields--compact {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.admin-item-side-fields--compact .admin-field-note {
  grid-column: 1 / -1;
}

.admin-field-note {
  font-size: 12px;
  opacity: .75;
  margin-top: 6px;
}

.admin-item-toggle-stack {
  display: grid;
  gap: 0.65rem;
}

.admin-item-toggle-stack--inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-field-checkbox--card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  background: rgba(17, 24, 39, 0.02);
  font-size: 0.82rem;
  color: var(--text-strong);
}

.admin-field-checkbox--compact {
  min-height: 48px;
  justify-content: center;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.25;
}

.admin-field-checkbox--compact input {
  flex: 0 0 auto;
}

.admin-item-form-subsection--card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  padding: 0.9rem;
  margin-top: 0;
  background: rgba(255,255,255,0.74);
}

.admin-item-form-subsection--tight {
  padding-top: 0.9rem;
}

.admin-item-images-row--sidebar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-item-images-row--sidebar .admin-item-image-cell {
  max-width: none;
}

.admin-supplements-input-row--wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px auto;
  gap: 0.5rem;
  align-items: center;
}

.admin-form-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-top: 1rem;
  padding: 0.9rem 0 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.92) 24%, rgba(255,255,255,0.98) 100%);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-form-actions--spread {
  justify-content: space-between;
  align-items: center;
}

.admin-form-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .admin-item-form-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-item-form-side {
    position: static;
  }
}

@media (max-width: 960px) {
  .admin-item-metrics-grid,
  .admin-item-metrics-grid--compact,
  .admin-item-images-row--sidebar,
  .admin-supplements-input-row--wide,
  .admin-item-form-grid--duo,
  .admin-item-side-fields--compact,
  .admin-item-toggle-stack--inline {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-item-form-section-header {
    flex-direction: column;
  }

  .admin-item-form-section-hint {
    max-width: none;
    text-align: left;
  }

  .admin-form-actions--spread {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .admin-form-actions-group {
    width: 100%;
  }

  .admin-form-actions-group .btn-primary,
  .admin-form-actions-group .btn-secondary {
    flex: 1 1 0;
  }
}


/* R98: simplify item modal section headers */
.admin-item-modal-form .admin-item-form-section-kicker,
.admin-item-modal-form .admin-item-form-section-hint {
  display: none;
}

.admin-item-modal-form .admin-item-form-section-header {
  margin-bottom: 0.65rem;
}


/* R99: item modal tabs */
.admin-item-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.admin-item-modal-tab {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(17, 24, 39, 0.03);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.admin-item-modal-tab:hover {
  border-color: rgba(15, 23, 42, 0.16);
  color: var(--text-main);
}

.admin-item-modal-tab.is-active {
  background: rgba(226, 188, 190, 0.28);
  border-color: rgba(201, 153, 156, 0.55);
  color: var(--text-strong);
}

.admin-item-modal-panels {
  min-height: 0;
}

.admin-item-tab-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.02);
}

.admin-item-tab-panel[hidden] {
  display: none !important;
}

.admin-item-tab-panel .admin-item-form-subsection--card:first-child,
.admin-item-tab-panel .admin-item-form-subsection:first-child {
  margin-top: 0;
}

@media (max-width: 960px) {
  .admin-item-modal-tabs {
    gap: 0.45rem;
  }

  .admin-item-modal-tab {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
