:root {
  --pink: #f272ac;
  --pink-soft: #fff0f7;
  --yellow: #ffec19;
  --yellow-soft: #fffbd2;
  --blue: #2fa9d5;
  --blue-soft: #eaf8fe;
  --green: #006b3c;
  --green-2: #008b51;
  --green-soft: #eaf7f0;
  --ink: #171816;
  --muted: #6b6f6a;
  --cream: #fff8f1;
  --paper: #ffffff;
  --line: #e9e0d7;
  --danger: #c43b35;
  --danger-soft: #fff0ef;
  --warning: #cc7a00;
  --warning-soft: #fff6df;
  --shadow-sm: 0 8px 24px rgba(30, 18, 8, 0.08);
  --shadow-md: 0 18px 48px rgba(30, 18, 8, 0.14);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% -10%, rgba(242, 114, 172, 0.23), transparent 35%),
    radial-gradient(circle at 94% -6%, rgba(255, 236, 25, 0.25), transparent 30%),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

#app { min-height: 100vh; }

.app-shell { min-height: 100vh; padding-bottom: calc(18px + var(--safe-bottom)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: calc(10px + var(--safe-top)) clamp(16px, 3vw, 38px) 10px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 107, 60, 0.12);
  backdrop-filter: blur(14px);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.12));
}
.brand-copy { min-width: 0; }
.brand-title { font-weight: 950; font-size: clamp(20px, 2.4vw, 29px); line-height: 1; letter-spacing: -0.04em; }
.brand-title .accent { color: var(--green); }
.brand-subtitle { color: var(--muted); font-weight: 700; font-size: 12px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.btn {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  line-height: 1;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, background .16s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }
.btn-primary { color: white; background: linear-gradient(135deg, var(--green), var(--green-2)); box-shadow: 0 10px 20px rgba(0, 107, 60, .2); }
.btn-primary:hover { box-shadow: 0 12px 25px rgba(0, 107, 60, .28); }
.btn-pink { color: var(--ink); background: var(--pink); box-shadow: 0 10px 20px rgba(242, 114, 172, .24); }
.btn-yellow { color: var(--ink); background: var(--yellow); box-shadow: 0 10px 20px rgba(204, 165, 0, .18); }
.btn-blue { color: white; background: var(--blue); }
.btn-danger { color: white; background: var(--danger); }
.btn-dark { color: white; background: var(--ink); }
.btn-ghost { color: var(--ink); background: white; border: 1px solid var(--line); }
.btn-soft { color: var(--green); background: var(--green-soft); }
.btn-small { min-height: 36px; padding: 8px 13px; font-size: 13px; }
.btn-square { width: 44px; min-width: 44px; padding: 0; border-radius: 14px; }
.btn-wide { width: 100%; }
.icon-button {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 13px; background: white;
  display: inline-grid; place-items: center; font-size: 18px; font-weight: 900;
}

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px;
  padding: 0 7px; border-radius: 999px; background: var(--pink); color: var(--ink); font-size: 12px; font-weight: 950;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 4px var(--green-soft); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 900; }
.price { font-weight: 950; color: var(--green); font-variant-numeric: tabular-nums; }

/* Client */
.client-main {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.6vw, 36px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(20px, 2.6vw, 36px);
  align-items: start;
}
.client-content { min-width: 0; }
.hero {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 50px);
  color: white;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--green) 96%, black), color-mix(in srgb, var(--green) 78%, transparent)),
    var(--hero-image, url('/assets/products/americain.jpg')) center/cover;
  box-shadow: var(--shadow-md);
}
.hero::before {
  content: "";
  position: absolute; width: 240px; height: 240px; border-radius: 50%; top: -110px; right: 7%;
  background: var(--yellow); opacity: .88;
}
.hero::after {
  content: "";
  position: absolute; width: 180px; height: 180px; border-radius: 50%; bottom: -105px; right: 22%;
  background: var(--pink); opacity: .88;
}
.hero > * { position: relative; z-index: 1; }
.hero-kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 950; color: var(--yellow); }
.hero h1 { margin: 10px 0 8px; max-width: 720px; font-size: clamp(28px, 4vw, 48px); letter-spacing: -.045em; line-height: 1.02; }
.hero p { margin: 0; max-width: 690px; color: rgba(255,255,255,.88); font-weight: 650; line-height: 1.55; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 28px 0 14px; }
.section-heading h2 { margin: 0; font-size: clamp(21px, 2.1vw, 29px); letter-spacing: -.03em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.category-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 12px;
}
.category-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 13px;
  background: white;
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.category-card:hover { transform: translateY(-2px); }
.category-card.active { border-color: var(--green); box-shadow: 0 12px 30px rgba(0,107,60,.17); }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.category-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.76)); }
.category-card span { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 12px; color: white; font-weight: 950; line-height: 1.07; text-shadow: 0 2px 5px rgba(0,0,0,.35); }
.category-card .count { top: 10px; right: 10px; left: auto; bottom: auto; width: auto; font-size: 11px; padding: 4px 7px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); text-shadow: none; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 18px; }
.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,107,60,.1);
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-image-wrap { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--green-soft); }
.product-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product-card:hover img { transform: scale(1.035); }
.product-card .price-pill { position: absolute; right: 12px; top: 12px; background: rgba(255,255,255,.94); border-radius: 999px; padding: 8px 11px; font-weight: 950; color: var(--green); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.product-card-body { padding: 17px; }
.product-card h3 { margin: 0; font-size: 18px; line-height: 1.15; }
.product-card p { margin: 8px 0 15px; min-height: 40px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-add { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--yellow); font-size: 24px; font-weight: 950; }
.empty-state { padding: 38px; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); background: rgba(255,255,255,.55); }
.empty-state .emoji { display: block; font-size: 42px; margin-bottom: 10px; }

.cart-panel {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 126px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,107,60,.12);
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.cart-head { padding: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--pink-soft), var(--yellow-soft)); }
.cart-head h2 { margin: 0; font-size: 21px; }
.cart-items { overflow-y: auto; min-height: 130px; padding: 10px 18px; }
.cart-empty { display: grid; place-items: center; text-align: center; min-height: 210px; color: var(--muted); }
.cart-empty .emoji { font-size: 48px; }
.cart-line { padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line-top { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 11px; align-items: start; }
.cart-line-image { width: 54px; height: 54px; object-fit: cover; border-radius: 12px; background: var(--green-soft); }
.cart-line h4 { margin: 0 0 4px; font-size: 14px; line-height: 1.2; }
.cart-line-detail { color: var(--muted); font-size: 11px; line-height: 1.45; }
.cart-line-price { font-size: 13px; font-weight: 950; color: var(--green); white-space: nowrap; }
.cart-line-actions { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quantity-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.quantity-control button { width: 34px; height: 32px; border: 0; background: white; font-weight: 950; font-size: 18px; }
.quantity-control span { min-width: 31px; text-align: center; font-weight: 900; font-size: 13px; }
.remove-link { border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 850; }
.cart-summary { padding: 18px 20px 20px; border-top: 1px solid var(--line); background: #fffdf9; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary-row.total { font-size: 20px; font-weight: 950; margin-bottom: 15px; }
.mobile-cart-button { display: none; position: fixed; left: 14px; right: 14px; bottom: calc(12px + var(--safe-bottom)); z-index: 35; justify-content: space-between; border-radius: 18px; min-height: 58px; }

/* Modal and forms */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(10, 14, 11, .66);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}
.modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 28px);
  display: flex; flex-direction: column;
  border-radius: 26px;
  background: white;
  box-shadow: 0 30px 90px rgba(0,0,0,.34);
  overflow: hidden;
}
.modal-wide { width: min(1160px, 100%); }
.modal-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: white; }
.modal-head h2 { margin: 0; font-size: 21px; }
.modal-body { min-height: 0; overflow-y: auto; padding: 22px; }
.modal-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); background: #fffdf9; }
.product-modal-hero { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: center; margin-bottom: 22px; }
.product-modal-hero img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 20px; }
.product-modal-hero h2 { margin: 0 0 7px; font-size: 28px; letter-spacing: -.04em; }
.product-modal-hero p { color: var(--muted); line-height: 1.5; }
.live-price { display: inline-flex; margin-top: 12px; padding: 8px 13px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 18px; font-weight: 950; }
.option-group { margin: 20px 0; }
.option-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.option-group h3 { margin: 0; font-size: 16px; }
.required-mark { color: var(--danger); font-size: 12px; font-weight: 900; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.option-chip { position: relative; }
.option-chip input { position: absolute; opacity: 0; pointer-events: none; }
.option-chip label {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: white; font-size: 13px; font-weight: 800;
  transition: border-color .16s, background .16s, transform .16s;
}
.option-chip input:checked + label { border-color: var(--green); background: var(--green-soft); transform: translateY(-1px); }
.option-price { color: var(--green); white-space: nowrap; font-size: 12px; }
.field { display: grid; gap: 7px; }
.field label { color: #363a36; font-size: 12px; font-weight: 900; }
.field label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 45px; border: 1.5px solid var(--line); border-radius: 13px; background: white; color: var(--ink); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 94px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(0,107,60,.1); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.check-row input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--green); }
.inline-alert { padding: 12px 14px; border-radius: 13px; background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 800; }
.info-alert { background: var(--blue-soft); color: #12688b; }
.checkout-summary { border-radius: 18px; background: linear-gradient(135deg, var(--pink-soft), var(--yellow-soft)); padding: 16px; }
.checkout-summary .summary-row { padding: 5px 0; }

.confirmation {
  width: min(620px, 100%); padding: 34px; border-radius: 30px; background: white; text-align: center; box-shadow: var(--shadow-md);
}
.confirmation-icon { width: 84px; height: 84px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 42px; }
.confirmation h1 { margin: 0; font-size: 30px; }
.order-number { margin: 22px auto; padding: 14px 22px; display: inline-flex; border-radius: 18px; background: var(--yellow); font-size: 34px; font-weight: 950; letter-spacing: -.03em; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(360px, .9fr); }
.login-visual { position: relative; min-height: 420px; overflow: hidden; background: linear-gradient(135deg, rgba(0,107,60,.88), rgba(47,169,213,.72)), url('/assets/products/americain.jpg') center/cover; }
.login-visual::before { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: var(--pink); top: -140px; left: -100px; opacity: .9; }
.login-visual::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: var(--yellow); bottom: -150px; right: -80px; opacity: .92; }
.login-brand { position: relative; z-index: 1; height: 100%; min-height: 100vh; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: white; }
.login-brand img { width: 160px; filter: drop-shadow(0 10px 20px rgba(0,0,0,.25)); }
.login-brand h1 { max-width: 620px; margin: 0; font-size: clamp(38px, 5vw, 68px); line-height: .98; letter-spacing: -.06em; }
.login-brand p { max-width: 600px; color: rgba(255,255,255,.84); font-weight: 650; line-height: 1.6; }
.login-side { display: grid; place-items: center; padding: 30px; background: var(--cream); }
.login-card { width: min(460px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow-md); }
.login-card h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.login-card p { color: var(--muted); line-height: 1.5; }
.pin-input { height: 62px; font-size: 28px; letter-spacing: .25em; text-align: center; font-weight: 950; }

/* Kitchen */
.kitchen-shell { min-height: 100vh; background: #101511; color: white; }
.kitchen-shell .topbar { color: white; background: rgba(16,21,17,.94); border-color: rgba(255,255,255,.08); }
.kitchen-shell .brand-subtitle { color: rgba(255,255,255,.58); }
.kitchen-shell .btn-ghost { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.kitchen-main { width: min(1680px, 100%); margin: 0 auto; padding: 20px clamp(16px,2.3vw,34px) 36px; }
.kitchen-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 1px 16px; scrollbar-width: thin; }
.kitchen-tab { min-width: max-content; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 10px 15px; background: rgba(255,255,255,.05); color: rgba(255,255,255,.72); font-weight: 850; }
.kitchen-tab.active { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.kitchen-tab .count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 7px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.16); font-size: 12px; }
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; align-items: start; }
.order-card { border: 1px solid rgba(255,255,255,.1); border-radius: 22px; background: #1a211c; box-shadow: 0 14px 40px rgba(0,0,0,.24); overflow: hidden; }
.order-card.new { border-color: rgba(255,236,25,.7); box-shadow: 0 0 0 2px rgba(255,236,25,.12), 0 14px 40px rgba(0,0,0,.24); }
.order-card.ready { border-color: rgba(242,114,172,.72); }
.order-head { padding: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; border-bottom: 1px solid rgba(255,255,255,.09); }
.order-number-kitchen { font-size: 28px; font-weight: 950; color: var(--yellow); letter-spacing: -.04em; }
.order-time { color: rgba(255,255,255,.52); font-size: 12px; margin-top: 4px; }
.status-label { padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .05em; }
.status-new { color: #2b2800; background: var(--yellow); }
.status-accepted { color: #10334a; background: #bcecff; }
.status-preparing { color: #5a3000; background: #ffdca5; }
.status-ready { color: #4a0c29; background: #ffc4df; }
.status-completed { color: #0c4228; background: #bdebd1; }
.status-cancelled { color: #4d1410; background: #ffc9c5; }
.customer-block { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.035); }
.customer-name { font-weight: 950; }
.customer-phone { color: var(--blue); font-weight: 850; font-size: 13px; }
.order-lines { padding: 6px 18px; }
.kitchen-line { padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.kitchen-line:last-child { border-bottom: 0; }
.kitchen-line-title { display: flex; justify-content: space-between; gap: 12px; font-weight: 900; }
.kitchen-line-detail { margin: 7px 0 0 18px; color: rgba(255,255,255,.67); font-size: 12px; line-height: 1.55; }
.kitchen-remark { margin-top: 8px; padding: 9px 10px; border-radius: 10px; color: var(--yellow); background: rgba(255,236,25,.08); font-weight: 850; }
.order-total { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; font-size: 18px; font-weight: 950; border-top: 1px solid rgba(255,255,255,.1); }
.order-total strong { color: var(--yellow); font-size: 22px; }
.order-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 14px 18px 18px; }
.order-actions .btn { border-radius: 13px; min-height: 48px; }
.kitchen-empty { grid-column: 1 / -1; min-height: 380px; display: grid; place-items: center; text-align: center; color: rgba(255,255,255,.5); border: 2px dashed rgba(255,255,255,.1); border-radius: 24px; }
.kitchen-empty .emoji { font-size: 60px; }

/* Admin */
.admin-shell { min-height: 100vh; background: #f4f6f3; }
.admin-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; color: white; background: #0f1d15; overflow-y: auto; }
.admin-sidebar .brand-lockup { padding: 2px 8px 22px; }
.admin-sidebar .brand-logo { width: 54px; height: 54px; }
.admin-sidebar .brand-subtitle { color: rgba(255,255,255,.55); }
.admin-nav { display: grid; gap: 7px; }
.admin-nav button { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 0; border-radius: 13px; color: rgba(255,255,255,.7); background: transparent; font-weight: 850; text-align: left; }
.admin-nav button:hover { background: rgba(255,255,255,.07); color: white; }
.admin-nav button.active { color: var(--ink); background: var(--yellow); }
.admin-nav .nav-icon { width: 28px; font-size: 18px; text-align: center; }
.admin-side-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 9px; }
.admin-main { min-width: 0; }
.admin-topbar { min-height: 82px; padding: 16px clamp(18px, 2.8vw, 38px); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: white; border-bottom: 1px solid #dde4dc; }
.admin-topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.admin-topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.admin-content { padding: clamp(18px, 2.8vw, 38px); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-toolbar-left, .admin-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input { min-width: 250px; }
.panel { border: 1px solid #dde4dc; border-radius: 20px; background: white; box-shadow: 0 8px 26px rgba(21,46,30,.06); overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.data-table th { padding: 12px 14px; color: var(--muted); background: #f8faf8; border-bottom: 1px solid #e4e9e4; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid #edf0ed; vertical-align: middle; font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }
.table-product { display: flex; align-items: center; gap: 11px; min-width: 230px; }
.table-thumb { width: 58px; height: 45px; object-fit: cover; border-radius: 10px; background: var(--green-soft); }
.table-title { font-weight: 900; }
.table-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.switch { position: relative; width: 45px; height: 25px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfd5cf; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--green-2); }
.switch input:checked + span::after { transform: translateX(20px); }
.category-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 15px; }
.category-admin-card { padding: 15px; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; border: 1px solid #dde4dc; border-radius: 17px; background: white; }
.category-admin-card img { width: 76px; height: 68px; object-fit: cover; border-radius: 13px; }
.category-admin-card h3 { margin: 0 0 5px; }
.category-admin-card .actions { margin-top: 10px; display: flex; gap: 7px; }
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.55fr); gap: 20px; }
.settings-card { padding: 22px; }
.settings-card h2 { margin-top: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 14px; margin-bottom: 20px; }
.metric { padding: 18px; border: 1px solid #dde4dc; border-radius: 18px; background: white; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 800; }
.metric-value { margin-top: 7px; font-size: 27px; font-weight: 950; letter-spacing: -.04em; }

/* Editeur visuel type constructeur de site */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(540px, 1fr);
  gap: 22px;
  align-items: start;
}
.studio-inspector { overflow: visible; }
.studio-inspector-head { padding: 22px; border-bottom: 1px solid #e4e9e4; background: linear-gradient(135deg, var(--pink-soft), var(--yellow-soft)); }
.studio-inspector-head h2 { margin: 5px 0 7px; font-size: 24px; letter-spacing: -.035em; }
.studio-inspector-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.studio-eyebrow { color: var(--green); font-size: 10px; font-weight: 950; letter-spacing: .16em; }
.studio-section { border-bottom: 1px solid #e6ebe6; background: white; }
.studio-section:last-of-type { border-bottom: 0; }
.studio-section summary { position: relative; list-style: none; padding: 17px 22px; font-weight: 950; cursor: pointer; user-select: none; }
.studio-section summary::-webkit-details-marker { display: none; }
.studio-section summary::after { content: '⌄'; position: absolute; right: 22px; color: var(--muted); transition: transform .18s ease; }
.studio-section[open] summary::after { transform: rotate(180deg); }
.studio-section-body { display: grid; gap: 14px; padding: 0 22px 22px; }
.studio-logo-editor { display: grid; grid-template-columns: 90px 1fr; gap: 15px; align-items: center; padding: 13px; border: 1px dashed #cbd5cb; border-radius: 16px; background: #fbfdfb; }
.studio-logo-editor img { width: 90px; height: 90px; object-fit: contain; border-radius: 14px; background: white; }
.studio-logo-editor p { margin: 4px 0 10px; color: var(--muted); font-size: 11px; }
.studio-hero-editor { position: relative; overflow: hidden; min-height: 150px; border-radius: 16px; background: var(--green-soft); }
.studio-hero-editor img { width: 100%; height: 170px; object-fit: cover; }
.studio-hero-editor .btn { position: absolute; right: 12px; bottom: 12px; }
.studio-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.studio-color { min-height: 52px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #dfe6df; border-radius: 13px; background: #fbfdfb; font-size: 12px; font-weight: 800; cursor: pointer; }
.studio-color-chip { width: 30px; height: 30px; border-radius: 9px; border: 1px solid rgba(0,0,0,.1); }
.studio-color input { width: 34px; height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.studio-sort-list { display: grid; gap: 8px; }
.studio-sort-row { min-width: 0; display: grid; grid-template-columns: auto 48px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px; border: 1px solid #e1e7e1; border-radius: 13px; background: #fbfdfb; }
.studio-sort-row img { width: 48px; height: 42px; object-fit: cover; border-radius: 9px; }
.studio-sort-row > div:nth-child(3) { min-width: 0; display: grid; }
.studio-sort-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.studio-sort-row span:not(.drag-handle) { color: var(--muted); font-size: 10px; }
.drag-handle { color: #9ba79d; font-size: 18px; letter-spacing: -5px; }
.studio-sort-row .icon-button { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.icon-button:disabled { opacity: .3; cursor: not-allowed; }
.studio-publish { position: sticky; bottom: 0; z-index: 2; padding: 16px 22px calc(16px + var(--safe-bottom)); border-top: 1px solid #dfe6df; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.studio-publish span { display: block; margin-top: 8px; color: var(--muted); text-align: center; font-size: 10px; }
.studio-preview-panel { position: sticky; top: 104px; padding: 0; background: #172019; }
.studio-preview-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; color: white; background: #101711; }
.studio-preview-toolbar > div:first-child { display: grid; }
.studio-preview-toolbar span { color: rgba(255,255,255,.55); font-size: 10px; }
.device-switch { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.08); }
.device-switch button { width: 34px; height: 32px; border: 0; border-radius: 9px; color: rgba(255,255,255,.55); background: transparent; font-size: 17px; }
.device-switch button.active { color: var(--ink); background: var(--yellow); }
.studio-device { min-height: 620px; display: flex; justify-content: center; align-items: flex-start; padding: 18px; overflow: auto; background: radial-gradient(circle at top, #405146, #172019 70%); }
.studio-device iframe { width: 100%; height: 720px; border: 0; border-radius: 16px; background: var(--cream); box-shadow: 0 18px 55px rgba(0,0,0,.38); }
.studio-device.desktop iframe { max-width: 1180px; }
.studio-device.tablet iframe { max-width: 850px; }
.studio-device.mobile iframe { max-width: 390px; height: 760px; border-radius: 27px; }
.studio-quick-actions { display: flex; gap: 9px; flex-wrap: wrap; padding: 14px; background: #101711; }
.studio-quick-actions .btn { flex: 1 1 160px; }
.category-image-editor { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; margin-bottom: 17px; padding: 13px; border: 1px dashed #cbd5cb; border-radius: 16px; background: #fbfdfb; }
.category-image-editor img { width: 150px; height: 105px; object-fit: cover; border-radius: 12px; }
.preview-mode .topbar .hide-mobile { display: none !important; }
.preview-mode { min-height: 100%; }

/* Modifier editor */
.editor-layout { display: grid; grid-template-columns: minmax(0, .78fr) minmax(420px, 1.22fr); gap: 18px; }
.editor-section { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fffdf9; }
.editor-section h3 { margin: 0 0 14px; }
.image-editor { aspect-ratio: 16/10; position: relative; overflow: hidden; border-radius: 16px; background: var(--green-soft); border: 1px dashed #a7b8aa; }
.image-editor img { width: 100%; height: 100%; object-fit: cover; }
.image-editor-actions { display: flex; gap: 9px; margin-top: 10px; }
.modifier-list { display: grid; gap: 13px; }
.modifier-card { border: 1px solid #dce4dc; border-radius: 16px; background: white; overflow: hidden; }
.modifier-head { padding: 12px; display: grid; grid-template-columns: minmax(150px,1fr) 110px auto auto; gap: 9px; align-items: center; background: #f6f9f6; border-bottom: 1px solid #e5eae5; }
.modifier-options { padding: 10px 12px 12px; display: grid; gap: 8px; }
.modifier-option { display: grid; grid-template-columns: minmax(120px,1fr) 110px auto auto; gap: 8px; align-items: center; }
.modifier-adds { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mini-input { min-height: 38px; padding: 7px 9px; border-radius: 10px; }
.help-text { color: var(--muted); font-size: 11px; line-height: 1.45; }

.toast-root { position: fixed; z-index: 300; right: 16px; bottom: calc(18px + var(--safe-bottom)); display: grid; gap: 9px; width: min(390px, calc(100% - 32px)); }
.toast { padding: 13px 15px; border-radius: 14px; background: #15221a; color: white; box-shadow: var(--shadow-md); font-weight: 750; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.loading-page { min-height: 100vh; display: grid; place-items: center; text-align: center; color: var(--muted); }
.spinner { width: 46px; height: 46px; margin: 0 auto 14px; border: 4px solid rgba(0,107,60,.18); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1120px) {
  .studio-layout { grid-template-columns: 1fr; }
  .studio-preview-panel { position: static; }
  .client-main { grid-template-columns: minmax(0,1fr) 320px; }
  .admin-layout { grid-template-columns: 210px minmax(0,1fr); }
  .editor-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  body { padding-bottom: calc(76px + var(--safe-bottom)); }
  .topbar { min-height: 70px; }
  .brand-logo { width: 48px; height: 48px; }
  .client-main { display: block; padding: 16px; }
  .hero { min-height: 170px; }
  .cart-panel { display: none; }
  .mobile-cart-button { display: flex; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-side { min-height: 100vh; }
  .admin-layout { display: block; }
  .admin-sidebar { position: static; height: auto; padding: 12px; }
  .admin-sidebar .brand-lockup { padding: 3px 6px 10px; }
  .admin-nav { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .admin-nav button { width: auto; min-width: max-content; }
  .admin-side-bottom { display: none; }
  .admin-topbar { position: sticky; top: 0; z-index: 20; }
  .settings-grid { grid-template-columns: 1fr; }
  .studio-device { min-height: 520px; padding: 10px; }
  .studio-device iframe { height: 650px; }
  .product-modal-hero { grid-template-columns: 180px 1fr; }
}

@media (max-width: 650px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .brand-subtitle { display: none; }
  .topbar-actions .hide-mobile { display: none; }
  .hero { padding: 23px; border-radius: 22px; }
  .category-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { display: grid; grid-template-columns: 128px 1fr; }
  .product-image-wrap { aspect-ratio: auto; min-height: 150px; }
  .product-card p { min-height: 0; }
  .modal { max-height: calc(100vh - 14px); border-radius: 21px; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .product-modal-hero { grid-template-columns: 1fr; }
  .product-modal-hero img { max-height: 220px; }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .kitchen-grid { grid-template-columns: 1fr; }
  .order-actions { grid-template-columns: 1fr; }
  .admin-content { padding: 14px; }
  .admin-topbar { padding: 12px 14px; }
  .admin-topbar h1 { font-size: 20px; }
  .search-input { min-width: 100%; }
  .studio-colors { grid-template-columns: 1fr; }
  .studio-logo-editor { grid-template-columns: 70px 1fr; }
  .studio-logo-editor img { width: 70px; height: 70px; }
  .studio-preview-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .studio-sort-row { grid-template-columns: auto 42px minmax(0,1fr); }
  .studio-sort-row .row-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .category-image-editor { grid-template-columns: 1fr; }
  .category-image-editor img { width: 100%; height: 170px; }
  .editor-layout { display: block; }
  .editor-section + .editor-section { margin-top: 14px; }
  .modifier-head { grid-template-columns: 1fr 90px; }
  .modifier-head > :nth-child(3), .modifier-head > :nth-child(4) { grid-row: 2; }
  .modifier-option { grid-template-columns: minmax(100px,1fr) 90px auto; }
  .modifier-option > :last-child { grid-column: 3; }
  .login-card { padding: 24px; }
}

/* Glisser-déposer dans l'éditeur visuel */
.studio-sort-row[draggable="true"] { cursor: grab; transition: opacity .16s ease, transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.studio-sort-row[draggable="true"]:active { cursor: grabbing; }
.studio-sort-row.is-dragging { opacity: .48; transform: scale(.985); }
.studio-sort-row.drag-over { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.drag-handle { cursor: grab; user-select: none; touch-action: none; }

/* ===== O'CRUSH mobile/tablet checkout hotfix 2.1 ===== */
/* Keep checkout actions reachable when the Android keyboard reduces the viewport. */
#checkout-form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#checkout-form .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#checkout-form .modal-foot {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
}

@supports (height: 100dvh) {
  .modal-backdrop { min-height: 100dvh; }
  .modal { max-height: calc(100dvh - 28px); }
}

@media (max-width: 900px), (max-height: 700px) {
  .modal-backdrop {
    place-items: stretch center;
    padding-top: max(7px, env(safe-area-inset-top));
    padding-bottom: max(7px, env(safe-area-inset-bottom));
  }
  .modal {
    width: min(860px, 100%);
    max-height: calc(100vh - 14px);
    margin: auto 0;
  }
  @supports (height: 100dvh) {
    .modal { max-height: calc(100dvh - 14px); }
  }
  #checkout-form .modal-foot {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 22px rgba(16,21,17,.08);
  }
}

@media (max-width: 650px) {
  .modal-backdrop {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    align-items: end;
  }
  .modal {
    width: 100%;
    max-height: calc(100vh - max(7px, env(safe-area-inset-top)));
    margin: 0;
    border-radius: 21px 21px 0 0;
  }
  @supports (height: 100dvh) {
    .modal { max-height: calc(100dvh - max(7px, env(safe-area-inset-top))); }
  }
  .input, .select, .textarea {
    font-size: 16px; /* prevents Android/iOS form zoom and keeps layout stable */
  }
  #checkout-form .modal-body {
    padding-bottom: 20px;
  }
  #checkout-form .modal-foot {
    display: grid;
    grid-template-columns: minmax(0,.7fr) minmax(0,1.3fr);
    gap: 8px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }
  #checkout-form .modal-foot .btn {
    min-height: 52px;
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    white-space: normal;
    line-height: 1.15;
  }
  .check-row {
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  #checkout-form .modal-foot {
    grid-template-columns: 1fr;
  }
  #checkout-form .modal-foot .btn-ghost {
    min-height: 42px;
  }
}

/* Patch 2.2 - choix de l'heure de commande */
.timing-choice { margin-top: 4px; }
.timing-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.timing-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line, #ddd); border-radius: 14px; cursor: pointer; background: #fff; }
.timing-card input { width: 20px; height: 20px; flex: 0 0 auto; }
.timing-card span { display: grid; gap: 2px; }
.timing-card small { color: var(--muted, #666); font-size: 12px; }
.timing-select { display: none; margin-top: 10px; }
.timing-select.active { display: block; }
.kitchen-timing { margin: 10px 0; padding: 10px 12px; border-radius: 12px; font-weight: 700; }
.kitchen-timing.now { background: #fff4d6; }
.kitchen-timing.scheduled { background: #e8f5ff; }
@media (max-width: 680px) {
  .timing-options { grid-template-columns: 1fr; }
}

/* Patch 2.3 - écran Distribution / Retrait */
.distribution-shell { min-height: 100vh; background: var(--cream); }
.distribution-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 44px; }
.distribution-search-panel { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,1fr) auto; gap: 20px; align-items: center; padding: 22px; }
.distribution-eyebrow { display: inline-block; font-size: 12px; letter-spacing: .12em; font-weight: 900; color: var(--green); margin-bottom: 5px; }
.distribution-search-panel h1 { margin: 0 0 5px; font-size: clamp(24px, 3vw, 36px); }
.distribution-search-panel p { margin: 0; color: var(--muted); max-width: 650px; }
.distribution-search { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 4px 10px; }
.distribution-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.distribution-search .input { border: 0; box-shadow: none; min-height: 52px; font-size: 18px; }
.distribution-ready-count { min-width: 120px; padding: 12px 16px; border-radius: 16px; background: var(--green-soft); text-align: center; }
.distribution-ready-count strong { display: block; font-size: 34px; line-height: 1; color: var(--green); }
.distribution-ready-count span { display: block; font-size: 12px; margin-top: 5px; font-weight: 800; }
.distribution-section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 24px 2px 12px; }
.distribution-section-head h2, .distribution-section-head p { margin: 0; }
.distribution-section-head p { color: var(--muted); margin-top: 3px; }
.distribution-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.distribution-card { display: grid; grid-template-columns: 130px minmax(0,1fr); overflow: hidden; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.distribution-card-number { display: grid; place-items: center; min-height: 190px; padding: 18px; background: var(--ink); color: #fff; font-size: clamp(34px, 5vw, 54px); font-weight: 950; letter-spacing: -.03em; }
.distribution-card.ready .distribution-card-number { background: var(--green); }
.distribution-card.completed .distribution-card-number { background: #58645e; }
.distribution-card-body { padding: 18px; display: grid; gap: 14px; align-content: center; }
.distribution-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.distribution-card-head h2 { margin: 0; font-size: 24px; }
.distribution-card-head p { margin: 4px 0 0; color: var(--muted); }
.distribution-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 750; }
.distribution-remit { min-height: 58px; font-size: 17px; }
.distribution-info { background: var(--cream); border-radius: 12px; padding: 11px 13px; }
.distribution-empty { grid-column: 1 / -1; text-align: center; padding: 58px 20px; }
.distribution-empty .emoji { font-size: 48px; }
@media (max-width: 900px) {
  .distribution-search-panel { grid-template-columns: 1fr; }
  .distribution-ready-count { display: flex; align-items: center; justify-content: center; gap: 10px; }
  .distribution-ready-count strong { display: inline; }
  .distribution-ready-count span { display: inline; margin: 0; }
  .distribution-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .distribution-main { width: min(100% - 20px, 1180px); padding-top: 12px; }
  .distribution-search-panel { padding: 16px; gap: 14px; }
  .distribution-card { grid-template-columns: 96px minmax(0,1fr); border-radius: 18px; }
  .distribution-card-number { min-height: 165px; font-size: 34px; padding: 12px; }
  .distribution-card-body { padding: 14px; gap: 10px; }
  .distribution-card-head { display: grid; }
  .distribution-card-head h2 { font-size: 20px; }
  .distribution-section-head { align-items: start; flex-direction: column; }
}
