/* Charte Tasty Perpi : orange, crème, brun, rouge — police Nunito très grasse */
:root {
  --or: #ee7a22;
  --or-hi: #f8a24a;
  --or-lo: #d9600f;
  --red: #d42f3a;
  --red-lo: #8f1620;
  --brown: #4a1e10;
  --brown-lo: #2a0f07;
  --cream: #fff1de;
  --cream-2: #ffe2bf;
  --green: #2f8a3a;

  --bg: var(--cream);
  --surface: #ffffff;
  --text: var(--brown);
  --muted: #7a5040;
  --border: #ecd6bb;
  --accent: var(--red);
  --accent-text: #ffffff;
  --ok: var(--green);
  --warn: #b45309;
  --danger: var(--red);
  --radius: 16px;
  --f: "Nunito", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 600 16px/1.45 var(--f);
  background: var(--bg);
  color: var(--text);
}
header.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--brown);
  color: var(--cream);
  box-shadow: 0 3px 0 var(--brown-lo);
}
header.top h1 { font-size: 1.2rem; font-weight: 900; margin: 0; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
main.wide { max-width: 1200px; }
h2 { font-size: 1rem; font-weight: 900; margin: 24px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.item .desc { color: var(--muted); font-size: .9rem; }
.price { font-weight: 900; white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty span { min-width: 1.5em; text-align: center; font-weight: 900; }
button, .btn {
  font: inherit; font-weight: 800; cursor: pointer;
  border: 2px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
  padding: 10px 14px; min-height: 44px;
}
button.round { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; font-size: 1.3rem; line-height: 1; }
button.primary {
  background: var(--red); color: #fff; border-color: var(--red); font-weight: 900;
  box-shadow: 0 4px 0 var(--red-lo);
}
button.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red-lo); }
button.danger { color: var(--danger); border-color: var(--danger); }
button.ok { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 900; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.full { width: 100%; }
label { display: block; font-weight: 900; margin: 12px 0 4px; }
input, textarea, select {
  font: inherit; width: 100%;
  padding: 10px 12px; min-height: 46px;
  border: 2px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 3px solid var(--or-hi); outline-offset: 1px; }
input.code { font-size: 1.8rem; font-weight: 900; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: .9rem; }
.error { color: var(--danger); font-weight: 900; min-height: 1.2em; }
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--brown); box-shadow: 0 -3px 0 var(--brown-lo);
}
.cartbar > div { max-width: 760px; margin: 0 auto; }
.cartbar button.primary { font-size: 1.1rem; min-height: 54px; }
.hidden { display: none !important; }
.banner { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; font-weight: 900; border: 2px solid currentColor; background: var(--surface); }
.banner.warn { color: var(--warn); }
.status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 900; border: 2px solid currentColor; }
.status.pending { color: var(--warn); }
.status.accepted { color: var(--or-lo); }
.status.ready, .status.completed { color: var(--ok); }
.status.refused { color: var(--danger); }
.lines { margin: 8px 0; padding: 0; list-style: none; }
.lines li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.lines li .opts { display: block; color: var(--muted); font-size: .85rem; font-weight: 700; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.big { font-size: 2.2rem; font-weight: 900; margin: 4px 0; }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.board h2 { margin-top: 0; }
.order-card.new { animation: pulse 1.2s ease-in-out 3; border-color: var(--red); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(212, 47, 58, .3); } }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button[aria-selected="true"] { background: var(--or); color: #fff; border-color: var(--or); }
header.top button { background: transparent; color: var(--cream); border-color: rgba(255, 241, 222, .35); }
.switch { display: flex; align-items: center; gap: 8px; font-weight: 900; margin: 0; }
.switch input { width: 22px; height: 22px; min-height: 0; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 2px solid var(--border); vertical-align: middle; }
td input { min-height: 38px; padding: 6px 8px; }
td .thumb { width: 44px; height: 44px; object-fit: contain; display: block; }
.menu-table-wrap { overflow-x: auto; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
header.top a.btn { background: var(--or); color: #fff; border-color: var(--or); }

/* ---------- Vitrine client (style « Mur TV ») ---------- */
body.tasty {
  background:
    repeating-conic-gradient(from 0deg at 50% 18%, rgba(255, 255, 255, .07) 0 6deg, transparent 6deg 15deg),
    radial-gradient(90% 60% at 50% 15%, var(--or-hi) 0%, var(--or) 55%, var(--or-lo) 100%) fixed;
  background-color: var(--or);
  color: var(--brown);
}
body.tasty main > .banner, body.tasty main > section > h2 { color: var(--brown); }
.logo-plate {
  display: inline-flex; flex-direction: column; line-height: .9;
  background: var(--red); color: #fff; padding: 4px 12px 6px; border-radius: 10px;
  transform: rotate(-3deg); box-shadow: 3px 3px 0 var(--red-lo);
}
.logo-plate small { font-style: italic; font-weight: 900; font-size: .7rem; letter-spacing: .14em; color: #ffd0d3; }
.logo-plate strong { font-weight: 900; font-size: 1.35rem; letter-spacing: .02em; }
.hero { text-align: center; padding: 14px 0 4px; color: #fff; }
.hero p { margin: 6px 0 0; font-weight: 800; text-shadow: 0 1px 2px rgba(74, 30, 16, .4); }
.cat-head { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; transform: rotate(-2deg); transform-origin: left center; }
.cat-head .nos {
  background: var(--brown); color: var(--cream); font-weight: 900; font-size: .9rem; line-height: 1;
  padding: 6px 10px 7px; border-radius: 8px; transform: rotate(-4deg);
}
.cat-head h2 {
  margin: 0; font-size: clamp(1.8rem, 7vw, 2.6rem); line-height: .95; font-weight: 900; color: #fff; letter-spacing: 0;
  text-shadow: 1px 1px 0 var(--brown), 2px 2px 0 var(--brown), 3px 3px 0 var(--brown), 4px 4px 0 var(--brown-lo), 5px 6px 8px rgba(0, 0, 0, .25);
}
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.product {
  position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center;
  background: var(--cream); border-radius: 22px; padding: 14px 14px 14px 10px;
  box-shadow: 5px 6px 0 var(--brown);
  background-image: radial-gradient(circle, rgba(238, 122, 34, .16) 0 1.5px, transparent 2px);
  background-size: 14px 14px;
}
.product .pic { position: relative; height: 104px; display: flex; align-items: center; justify-content: center; }
.product .pic img { max-width: 112px; max-height: 104px; object-fit: contain; filter: drop-shadow(0 8px 6px rgba(74, 30, 16, .35)); }
.product .pic .ph {
  width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: var(--or); color: #fff; font-weight: 900; font-size: 2rem; box-shadow: inset 0 -6px 0 var(--or-lo);
}
.product .plate {
  display: inline-flex; flex-direction: column; line-height: .95; background: var(--brown);
  padding: 4px 10px 6px; border-radius: 8px; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--brown-lo); margin-bottom: 6px;
}
.product .plate small { font-style: italic; font-weight: 900; font-size: .68rem; letter-spacing: .14em; color: var(--or-hi); }
.product .plate strong { font-weight: 900; font-size: 1.15rem; color: #fff; }
.product .desc { color: var(--muted); font-size: .88rem; font-weight: 700; line-height: 1.3; }
.product .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.sticker {
  position: absolute; right: -8px; top: -12px; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; line-height: .9;
  background: var(--red); color: #fff; border: 3px solid #fff; box-shadow: 3px 4px 0 var(--red-lo); transform: rotate(8deg);
}
.sticker small { display: block; font-size: .55rem; font-weight: 900; letter-spacing: .08em; color: #ffd0d3; }
.sticker b { font-size: .98rem; font-weight: 900; }
.menu-pill {
  font-size: .8rem; font-weight: 900; background: #fff; color: var(--brown); border-radius: 999px;
  padding: 3px 10px; box-shadow: 2px 2px 0 var(--brown); white-space: nowrap;
}
.menu-pill i { font-style: normal; color: var(--red); }
.in-cart { font-weight: 900; color: var(--green); font-size: .9rem; }
body.tasty .card { background: var(--cream); border: none; box-shadow: 5px 6px 0 var(--brown); }
body.tasty #step-details > h2, body.tasty #step-code > h2 { color: #fff; font-size: 1.6rem; text-shadow: 2px 2px 0 var(--brown), 3px 3px 0 var(--brown-lo); }
body.tasty #step-details > .hint { color: #fff; }
body.tasty form > label, body.tasty #step-details form > .hint { color: var(--brown); }
body.tasty #details-form { background: var(--cream); border-radius: 22px; padding: 4px 16px 16px; box-shadow: 5px 6px 0 var(--brown); }

/* Fenêtre de choix des options */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(42, 15, 7, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--cream); color: var(--brown); border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
}
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }
.sheet .top { display: flex; gap: 12px; align-items: center; }
.sheet .top img { width: 96px; height: 80px; object-fit: contain; filter: drop-shadow(0 6px 5px rgba(74, 30, 16, .3)); }
.sheet h3 { margin: 0; font-size: 1.4rem; font-weight: 900; }
.sheet fieldset { border: none; margin: 16px 0 0; padding: 0; }
.sheet legend { font-weight: 900; font-size: 1rem; margin-bottom: 6px; padding: 0; }
.sheet legend small { color: var(--muted); font-weight: 700; }
.choice {
  display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 10px 12px;
  background: #fff; border: 2px solid var(--border); border-radius: 14px; font-weight: 800; cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--or); background: #fff7ee; }
.choice input { width: 22px; height: 22px; min-height: 0; accent-color: var(--red); flex: none; }
.choice span { flex: 1; }
.choice em { font-style: normal; font-weight: 900; color: var(--red); }
.sheet .actions { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; margin-top: 16px; padding-top: 10px; background: var(--cream); }
.sheet .actions .primary { flex: 1; }

@media (prefers-reduced-motion: no-preference) {
  .product .pic img { animation: float 5.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
  .sticker { animation: wob 4.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
}
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes wob { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(3deg) scale(1.04); } }
.product .plate { margin-right: 44px; }

/* Manager : fiche produit */
.wide-sheet { max-width: 720px; }
.wide-sheet label > input, .wide-sheet label > textarea { margin-top: 4px; font-weight: 600; }
.photo-box { flex: 0 0 auto; width: 132px; height: 120px; display: grid; place-items: center; background: #fff; border: 2px dashed var(--border); border-radius: 14px; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 10px; max-height: 260px; overflow-y: auto; padding: 4px; background: #fff; border-radius: 12px; }
.library button { padding: 4px; min-height: 0; height: 76px; }
.library img { width: 100%; height: 100%; object-fit: contain; }
.opt-group { background: #fff; border: 2px solid var(--border); border-radius: 14px; padding: 10px; margin-top: 10px; display: grid; gap: 6px; }
.opt-choice > input { flex: 1 1 160px; }
.opt-choice .euro { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 900; }
.opt-choice .euro input { width: 80px; }
.opt-choice button.round { flex: 0 0 auto; }
.sheet .actions { flex-wrap: wrap; }

/* Manager : rôles */
body.role-staff .admin-only { display: none !important; }
header.top .status { background: var(--cream); border-color: currentColor; white-space: nowrap; }

/* Manager : réglages */
#tab-settings .card h3 { font-size: 1rem; margin: 18px 0 8px; }
.week { display: grid; gap: 6px; margin-top: 8px; }
.day-row { display: grid; grid-template-columns: 100px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.range { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 4px 6px; }
.range input { width: auto; min-height: 36px; padding: 4px 6px; border: none; }
.range .round { width: 32px; height: 32px; min-height: 32px; font-size: 1rem; }
.row > .chip, .chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 12px; font-weight: 800; }
.chip button { min-height: 0; padding: 2px 8px; border: none; }
.team-row.inactive { opacity: .55; }
@media (max-width: 520px) { .day-row { grid-template-columns: 1fr; } }

/* Manager : statistiques */
.stats-filters { margin-bottom: 12px; }
.stats-filters button { flex: 0 0 auto; }
.stats-filters button[aria-pressed="true"] { background: var(--brown); color: var(--cream); border-color: var(--brown); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-tile { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat-value { font-size: 1.9rem; font-weight: 900; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.delta { font-size: .85rem; font-weight: 800; color: var(--muted); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.chart { margin: 12px 0; }
.chart figcaption { font-weight: 900; margin-bottom: 10px; }
.cols-wrap { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.cols-axis { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: .75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.cols { display: flex; align-items: stretch; gap: 2px; height: 210px; border-bottom: 1px solid var(--border);
  background: linear-gradient(var(--border), var(--border)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--border), var(--border)) 0 90px / 100% 1px no-repeat; }
.col-slot { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.col { position: relative; height: 180px; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.col:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.col-bar { width: 100%; max-width: 24px; background: var(--or-lo); border-radius: 4px 4px 0 0; min-height: 0; }
.col:hover .col-bar, .col:focus .col-bar { background: var(--brown); }
.col-val { position: absolute; top: 0; left: 50%; transform: translate(-50%, -2px); font-size: .75rem; font-weight: 900; white-space: nowrap; color: var(--text); }
.col-x { font-size: .7rem; color: var(--muted); text-align: center; padding-top: 4px; white-space: nowrap; overflow: hidden; }
.chart-tip { position: absolute; z-index: 50; background: var(--brown); color: var(--cream); font-weight: 800; font-size: .85rem; padding: 6px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; }
.top-table th { font-size: .85rem; color: var(--muted); }
.top-table .r { text-align: right; white-space: nowrap; }
.inline-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.inline-bar span { display: block; height: 10px; background: var(--or-lo); border-radius: 0 4px 4px 0; }

/* Manager sur téléphone : l'en-tête passe sur plusieurs lignes au lieu de déborder */
@media (max-width: 760px) {
  header.top { flex-wrap: wrap; }
  header.top .tabs button, header.top .row button { padding: 8px 10px; min-height: 40px; }
  header.top > .row { flex: 1 1 100% !important; flex-wrap: wrap; justify-content: flex-start; }
  header.top .status { white-space: normal; }
}

/* ---------- Page d'accueil (adresse publique) ---------- */
.home { max-width: 560px; padding-bottom: 40px; }
.home-head { text-align: center; padding-top: 12px; }
.home-logo { width: min(220px, 60vw); filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff) drop-shadow(3px 5px 6px rgba(74, 30, 16, .4)); }
.home-status { display: inline-block; margin: 8px 0 0; padding: 6px 14px; border-radius: 999px; font-weight: 900; background: var(--cream); box-shadow: 3px 3px 0 var(--brown); }
.home-status.open { color: var(--green); }
.home-status.closed { color: var(--red); }
.home-hero { position: relative; height: 150px; margin: 6px 0 4px; }
.home-hero img { position: absolute; filter: drop-shadow(0 10px 8px rgba(74, 30, 16, .45)); }
.home-hero .h1 { left: 50%; top: 0; height: 150px; transform: translateX(-50%); z-index: 2; }
.home-hero .h2 { left: 4%; top: 30px; height: 110px; transform: rotate(-12deg); }
.home-hero .h3 { right: 4%; top: 40px; height: 100px; transform: rotate(10deg); }
.home-choices { display: grid; gap: 16px; }
.choice-card {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--brown);
  background: var(--cream); border-radius: 22px; padding: 18px 20px; box-shadow: 5px 6px 0 var(--brown);
  background-image: radial-gradient(circle, rgba(238, 122, 34, .16) 0 1.5px, transparent 2px); background-size: 14px 14px;
}
a.choice-card:active { transform: translate(2px, 3px); box-shadow: 3px 3px 0 var(--brown); }
a.choice-card:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
.choice-card.main { background-color: var(--red); background-image: none; color: #fff; box-shadow: 5px 6px 0 var(--red-lo); }
.choice-kicker { font-size: .75rem; font-weight: 900; letter-spacing: .14em; opacity: .75; }
.choice-title { font-size: 1.8rem; font-weight: 900; line-height: 1.05; }
.choice-text { font-weight: 700; }
.choice-info { font-size: .9rem; font-weight: 800; opacity: .9; }
.choice-info:empty { display: none; }
.choice-cta { align-self: flex-start; margin-top: 8px; font-weight: 900; background: var(--brown); color: var(--cream); padding: 8px 16px; border-radius: 999px; }
.choice-card.main .choice-cta { background: #fff; color: var(--red); }
.delivery-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.partner { flex: 1 1 140px; text-align: center; text-decoration: none; font-weight: 900; font-size: 1.1rem; padding: 12px 16px; border-radius: 14px; color: #fff; }
.partner.delicity { background: #e6007e; box-shadow: 3px 4px 0 #8a004c; }
.partner.ubereats { background: #06c167; box-shadow: 3px 4px 0 #047a41; color: #000; }
.partner[hidden] { display: none; }
.home-last { display: flex; justify-content: center; margin-top: 18px; }
.home-hours { text-align: center; color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(74, 30, 16, .4); }

/* Carte en consultation seule (/menu) */
body.view-only .product .foot .round, body.view-only #cartbar, body.view-only .in-cart { display: none !important; }
.menu-cta { position: sticky; bottom: 12px; display: flex; justify-content: center; margin-top: 20px; }
.menu-cta a { text-decoration: none; font-size: 1.1rem; }
.home-link { text-decoration: none; }
a.btn.primary { background: var(--red); color: #fff; border-color: var(--red); font-weight: 900; box-shadow: 0 4px 0 var(--red-lo); }
