/* Kit « le passe » (Duriau Design) — commun à tous les sites. Les couleurs et polices du site sont dans passe-marque.css. */

:root {
  --ok: #3FB56B; --bientot: #FF9F1C; --retard: #E5383B;
  --ligne: rgb(255 255 255 / .1);
  --r: 18px; --r-s: 12px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --top-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; background: var(--fond); }
body { margin: 0; min-height: 100dvh; font: 400 16px/1.45 var(--f-texte); color: var(--texte); background: var(--fond); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; border: 0; background: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
a { color: inherit; }

/* ——— Connexion ——— */
.kd-login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.kd-login__box { width: min(400px, 100%); display: grid; gap: 10px; padding: 28px 24px; background: var(--fond-2); border-radius: 24px; box-shadow: 0 0 0 1px var(--ligne), 0 30px 60px -30px rgb(0 0 0 / .6); }
.kd-brand { justify-self: start; padding: 7px 12px 6px; background: var(--bon); color: var(--bon-encre); font: 15px/1 var(--f-titre); letter-spacing: .04em; border-radius: 6px; }
.kd-brand--s { font-size: 13px; padding: 6px 10px 5px; }
.kd-login__h { margin-top: 10px; font: 32px/1.1 var(--f-titre); letter-spacing: -.01em; }
.kd-login__p { color: var(--texte-doux); margin-bottom: 8px; }
.kd-label { font-weight: 600; font-size: 15px; }
.kd-input { min-height: 56px; padding: 0 16px; border-radius: var(--r-s); border: 1px solid rgb(255 255 255 / .18); background: rgb(0 0 0 / .25); font-size: 20px; letter-spacing: .15em; }
.kd-input[aria-invalid="true"] { border-color: var(--retard); }
.kd-err { min-height: 20px; color: #FFB4B5; font-size: 15px; }
.kd-go { min-height: 60px; border-radius: 16px; background: var(--action); color: var(--action-encre); font-weight: 700; font-size: 18px; transition: transform 120ms var(--ease); }
.kd-go:active { transform: scale(.97); }

/* ——— En-tête ——— */
.kd-app { min-height: 100dvh; display: flex; flex-direction: column; }
.kd-top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  min-height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--fond) 88%, transparent); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: 0 1px 0 var(--ligne); }
.kd-top__id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kd-live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-doux); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kd-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--texte-doux); }
.kd-live.is-live i { background: var(--ok); box-shadow: 0 0 0 4px rgb(63 181 107 / .2); }
.kd-live.is-error { color: #FFB4B5; } .kd-live.is-error i { background: var(--retard); }
.kd-day { display: flex; align-items: center; gap: 2px; }
.kd-day__h { font: 600 17px/1.2 var(--f-texte); text-align: center; min-width: 9ch; padding: 0 4px; white-space: nowrap; }
.kd-day__h::first-letter { text-transform: uppercase; }
.kd-top__end { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.kd-clock { font: 26px/1 var(--f-titre); font-variant-numeric: tabular-nums; margin-right: 6px; letter-spacing: .01em; }
.kd-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; line-height: 1; color: var(--texte); transition: transform 120ms var(--ease), background-color 120ms; }
.kd-ico:active { transform: scale(.94); background: rgb(255 255 255 / .1); }
.kd-ico svg { width: 22px; height: 22px; }
.kd-ico[aria-pressed="false"] { color: var(--texte-doux); opacity: .7; }
@media (hover: hover) and (pointer: fine) { .kd-ico:hover { background: rgb(255 255 255 / .08); } }

.kd-banner { margin: 10px 12px 0; padding: 10px 14px; border-radius: var(--r-s); background: rgb(229 56 59 / .18); color: #FFD6D6; font-weight: 600; text-align: center; }

/* ——— Onglets (téléphone) ——— */
.kd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 12px 0; padding: 4px; border-radius: 16px; background: var(--fond-2); }
.kd-tab { min-height: 48px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--texte-doux); display: flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.1; transition: background-color 160ms var(--ease), color 160ms; }
.kd-tab b { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; background: rgb(255 255 255 / .1); font-size: 14px; font-variant-numeric: tabular-nums; }
.kd-tab[aria-pressed="true"] { background: var(--bon); color: var(--bon-encre); }
.kd-tab[aria-pressed="true"] b { background: var(--bon-encre); color: var(--bon); }
.kd-tab[data-tab="nouvelle"].has-new b { background: var(--accent); color: #fff; }

/* ——— Tableau ——— */
.kd-board { flex: 1; display: grid; gap: 12px; padding: 12px max(12px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.kd-col { display: none; flex-direction: column; min-width: 0; }
.kd-board[data-show="nouvelle"] [data-col="nouvelle"], .kd-board[data-show="prep"] [data-col="prep"], .kd-board[data-show="prete"] [data-col="prete"] { display: flex; }
.kd-col__h { display: none; }
.kd-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.kd-dot--n { background: var(--accent); } .kd-dot--p { background: var(--bientot); } .kd-dot--r { background: var(--ok); }
.kd-list { list-style: none; display: grid; gap: 12px; align-content: start; }

@media (min-width: 900px) {
  .kd-tabs { display: none; }
  .kd-board { grid-template-columns: repeat(3, minmax(0, 1fr)); height: calc(100dvh - var(--top-h) - env(safe-area-inset-top)); padding-top: 12px; overflow: hidden; }
  .kd-banner + .kd-tabs + .kd-board { height: calc(100dvh - var(--top-h) - env(safe-area-inset-top) - 52px); }
  .kd-col { display: flex !important; background: var(--fond-2); border-radius: 22px; overflow: hidden; }
  .kd-col__h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; font: 600 20px/1.2 var(--f-texte); }
  .kd-col__h b { margin-left: auto; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 99px; display: inline-grid; place-items: center; background: rgb(255 255 255 / .1); font-size: 18px; font-variant-numeric: tabular-nums; }
  .kd-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 16px; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .2) transparent; }
  .kd-done { margin: 0 12px 12px; }
}

/* ——— Le ticket ——— */
.kd-card { position: relative; background: var(--bon); color: var(--bon-encre); border-radius: var(--r); padding: 16px 16px 14px; display: grid; gap: 12px;
  box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 12px 24px -16px rgb(0 0 0 / .7); }
/* bord perforé en haut : le bon de commande */
.kd-card::before { content: ""; position: absolute; left: 14px; right: 14px; top: -5px; height: 10px;
  background: radial-gradient(circle at 5px 5px, var(--fond-2) 4px, transparent 4.5px) 0 0 / 14px 10px repeat-x; }
@media (max-width: 899px) { .kd-card::before { background-image: radial-gradient(circle at 5px 5px, var(--fond) 4px, transparent 4.5px); } }
.kd-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kd-card__time { font: 40px/1 var(--f-titre); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kd-card__time small { display: block; margin-bottom: 6px; font: 600 12px/1 var(--f-texte); letter-spacing: .08em; text-transform: uppercase; color: var(--bon-doux); }
.kd-timer { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; font-weight: 700; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: rgb(63 181 107 / .14); color: #1D6B3A; transition: background-color 300ms, color 300ms; }
.kd-timer i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.kd-timer[data-niveau="bientot"] { background: var(--bientot); color: #3A1D00; }
.kd-timer[data-niveau="retard"] { background: var(--retard); color: #fff; }
.kd-timer[data-niveau="attente"] { background: color-mix(in srgb, var(--bon-encre) 8%, transparent); color: var(--bon-doux); }
.kd-card[data-niveau="retard"] { box-shadow: 0 0 0 3px var(--retard), 0 12px 24px -16px rgb(0 0 0 / .7); }
.kd-card[data-niveau="bientot"] { box-shadow: 0 0 0 3px var(--bientot), 0 12px 24px -16px rgb(0 0 0 / .7); }

.kd-card__who { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kd-card__name { font-weight: 700; font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; }
.kd-card__tel { font-size: 15px; color: var(--bon-doux); text-decoration: none; font-variant-numeric: tabular-nums; padding: 4px 0; }
.kd-items { list-style: none; display: grid; gap: 6px; padding: 12px 0; border-block: 1px dashed var(--bon-ligne); }
.kd-items li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; font-size: 21px; line-height: 1.25; font-weight: 600; }
.kd-items .q { min-width: 38px; height: 32px; padding: 0 8px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--bon-encre); color: var(--bon); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kd-items .opt { display: block; font-size: 16px; font-weight: 500; color: var(--bon-doux); }
.kd-items .note { grid-column: 1 / -1; font-size: 16px; font-weight: 500; color: var(--bon-doux); white-space: pre-line; }
.kd-card__pay { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.kd-pay { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 8px; font-weight: 700; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.kd-pay--du { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--bon-encre); }
.kd-pay--ok { background: rgb(63 181 107 / .16); color: #1D6B3A; }
.kd-total { font: 22px/1 var(--f-titre); font-variant-numeric: tabular-nums; }
.kd-card__code { font-size: 13px; color: var(--bon-doux); letter-spacing: .04em; }

.kd-act { min-height: 68px; width: 100%; border-radius: 16px; background: var(--action); color: var(--action-encre); font-weight: 700; font-size: 21px; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 -2px 0 rgb(0 0 0 / .12) inset; transition: transform 120ms var(--ease), filter 120ms; }
.kd-act:active { transform: scale(.97); filter: brightness(.95); }
.kd-act[data-vers="retiree"] { background: var(--bon-encre); color: var(--bon); }
.kd-act:disabled { opacity: .5; }
.kd-card__more { display: flex; justify-content: space-between; gap: 8px; margin-top: -4px; }
.kd-small { min-height: 44px; padding: 0 10px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--bon-doux); }
.kd-small:active { background: var(--bon-ligne); }
.kd-small.is-armed { background: var(--retard); color: #fff; }

/* nouvelle commande : arrive et s'allume 3 fois */
.kd-card.is-new { animation: kd-in 420ms var(--ease) both, kd-flash 1.2s 420ms ease-out 3; }
@keyframes kd-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
@keyframes kd-flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 90%, transparent), 0 12px 24px -16px rgb(0 0 0 / .7); } 100% { box-shadow: 0 0 0 16px transparent, 0 12px 24px -16px rgb(0 0 0 / .7); } }
.kd-new-tag { display: inline-block; margin-left: 8px; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #fff; font: 700 12px/1.2 var(--f-texte); letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }

.kd-empty { padding: 40px 16px; text-align: center; color: var(--texte-doux); font-size: 17px; border: 2px dashed var(--ligne); border-radius: var(--r); }

/* retirées / annulées */
.kd-done { margin-top: 16px; border-radius: 16px; background: rgb(0 0 0 / .18); }
.kd-done summary { min-height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--texte-doux); list-style: none; }
.kd-done summary::-webkit-details-marker { display: none; }
.kd-done summary::after { content: "›"; margin-left: auto; font-size: 22px; transition: transform 160ms var(--ease); }
.kd-done[open] summary::after { transform: rotate(90deg); }
.kd-mini { list-style: none; padding: 0 8px 8px; display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; }
.kd-mini li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; font-size: 15px; font-variant-numeric: tabular-nums; }
.kd-mini li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte-doux); }
.kd-mini li.is-annulee span { text-decoration: line-through; }
.kd-mini .kd-small { color: var(--texte); min-height: 40px; }

/* ——— Réglages (feuille) ——— */
.kd-sheet { position: fixed; inset: 0; z-index: 40; display: grid; align-items: end; justify-items: center; }
.kd-sheet__bg { position: absolute; inset: 0; background: rgb(0 0 0 / .5); opacity: 0; transition: opacity 220ms var(--ease); }
.kd-sheet__panel { position: relative; width: min(520px, 100%); max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); background: var(--fond-2); border-radius: 24px 24px 0 0; box-shadow: 0 0 0 1px var(--ligne); transform: translateY(100%); transition: transform 320ms var(--ease); }
.kd-sheet.is-open .kd-sheet__bg { opacity: 1; } .kd-sheet.is-open .kd-sheet__panel { transform: none; }
@media (min-width: 700px) { .kd-sheet { align-items: center; } .kd-sheet__panel { border-radius: 24px; transform: translateY(24px) scale(.97); opacity: 0; transition: transform 240ms var(--ease), opacity 200ms; } .kd-sheet.is-open .kd-sheet__panel { transform: none; opacity: 1; } }
.kd-sheet__top { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.kd-sheet__top h2 { font: 22px/1.2 var(--f-titre); }
.kd-sheet__p { color: var(--texte-doux); margin-bottom: 12px; }
.kd-sheet__p::first-letter { text-transform: uppercase; }
.kd-switches { display: grid; gap: 8px; }
.kd-switch { min-height: 60px; padding: 0 16px; border-radius: 14px; background: rgb(255 255 255 / .06); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-size: 17px; }
.kd-switch b { padding: 6px 12px; border-radius: 99px; background: rgb(63 181 107 / .2); color: #B9F0CB; font-size: 14px; }
.kd-switch[aria-pressed="true"] b { background: rgb(229 56 59 / .25); color: #FFD6D6; }
.kd-sheet__note { margin: 10px 0 20px; font-size: 14px; color: var(--texte-doux); }
.kd-sheet__h { font: 600 16px/1.2 var(--f-texte); margin-bottom: 10px; }
.kd-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.kd-dayb { min-height: 56px; border-radius: 12px; background: rgb(255 255 255 / .05); display: grid; place-items: center; align-content: center; gap: 2px; font-size: 12px; color: var(--texte-doux); }
.kd-dayb strong { font-size: 17px; color: var(--texte); font-variant-numeric: tabular-nums; }
.kd-dayb.has-orders strong { color: var(--action); }
.kd-dayb[aria-current="date"] { background: var(--bon); color: var(--bon-doux); } .kd-dayb[aria-current="date"] strong { color: var(--bon-encre); }
.kd-quiet { min-height: 52px; width: 100%; border-radius: 14px; color: var(--texte-doux); font-weight: 600; box-shadow: 0 0 0 1px var(--ligne) inset; }

.kd-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 14px 20px; border-radius: 14px; background: var(--bon); color: var(--bon-encre); font-weight: 700; font-size: 17px; box-shadow: 0 20px 40px -12px rgb(0 0 0 / .6); animation: kd-in 240ms var(--ease); }

@media (max-width: 520px) {
  .kd-top { grid-template-columns: 1fr auto; row-gap: 0; }
  .kd-top__id .kd-live { display: none; }
  .kd-day { grid-row: 2; grid-column: 1 / -1; justify-content: center; padding-bottom: 6px; }
  .kd-clock { font-size: 22px; }
  .kd-card__time { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .kd-card.is-new { animation: none; box-shadow: 0 0 0 3px var(--accent); }
  .kd-sheet__panel, .kd-sheet__bg { transition: opacity 150ms; }
}
.kd-quiet--ex { margin-bottom: 8px; }
/* bloc propre au site dans les réglages (plat du jour…) */
.kd-extra { display: grid; gap: 10px; margin-bottom: 20px; padding: 16px; border-radius: 16px; background: var(--bon); color: var(--bon-encre); }
.kd-extra h3 { font: 600 17px/1.2 var(--f-texte); }
.kd-extra p { color: var(--bon-doux); }
.kd-extra form { display: grid; gap: 10px; }
.kd-extra label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.kd-extra input { min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--bon-ligne); background: #fff; color: var(--bon-encre); font-size: 16px; }
.kd-extra button { min-height: 52px; border-radius: 12px; background: var(--action); color: var(--action-encre); font-weight: 700; font-size: 17px; }
/* récapitulatif du jour (boucherie, boulangerie, atelier) */
.kd-recap { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 10px 12px 0; padding: 10px 12px; border-radius: 16px; background: var(--fond-2); align-items: center; }
.kd-recap b { flex: none; font-weight: 700; color: var(--texte-doux); font-size: 14px; margin-right: 4px; }
.kd-recap span { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 99px; background: rgb(255 255 255 / .08); font-size: 15px; font-weight: 600; white-space: nowrap; }
.kd-recap i { font-style: normal; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; background: var(--bon); color: var(--bon-encre); font-weight: 800; font-variant-numeric: tabular-nums; }
.kd-sms { text-decoration: none; display: inline-flex; align-items: center; margin-left: auto; margin-right: 4px; }
@media (min-width: 900px) { .kd-recap:not([hidden]) + .kd-tabs + .kd-board { height: calc(100dvh - var(--top-h) - env(safe-area-inset-top) - 62px); } }
/* listes dans ⋯ (groupes, réservations de table, fermetures, annonces) */
.kd-grp { display: grid; gap: 8px; }
.kd-grp:empty { display: none; }
.kd-grp article { padding: 12px; border-radius: 12px; background: #fff; display: grid; gap: 4px; }
.kd-grp b { font-size: 16px; } .kd-grp small { color: var(--bon-doux); }
.kd-grp div { display: flex; gap: 6px; flex-wrap: wrap; }
.kd-grp div button { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; background: var(--bon-ligne); color: var(--bon-encre); }
.kd-grp div button[aria-pressed="true"] { background: var(--action); color: var(--action-encre); }
.kd-extra select { min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--bon-ligne); background: #fff; color: var(--bon-encre); font-size: 16px; }
.kd-extra .sl-duo, .sl-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kd-check { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; }
.kd-check input, .kd-ep input { width: 22px; height: 22px; min-height: 0; accent-color: var(--action); }
.kd-check small { font-weight: 400; color: var(--bon-doux); }
.kd-ep { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.kd-ep label { display: flex !important; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border-radius: 10px; background: #fff; font-weight: 500 !important; font-size: 15px !important; }
