/* Kiosque du bar — CSS sans build step, sans dépendance externe. Pensé pour un iPad fixe
   (grands boutons, pas de survol souris à prévoir) plutôt que mobile-first comme PlanningBar,
   mais reprend la même charte de couleurs pour rester cohérent visuellement. */

:root {
  color-scheme: light;
  --brand-50: #f4f5f6;
  --brand-100: #e4e7ea;
  --brand-200: #bfc7cf;
  --brand-500: #1c3753;
  --brand-600: #182f47;
  --brand-700: #14263a;
  --cream-50: #f8f3ea;
  --cream-100: #f3ece0;
  --cream-200: #e4d4bb;
  --cream-600: #8c8168;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-900: #1c1917;
  --green-100: #d1fae5;
  --green-700: #047857;
  --red-100: #fee2e2;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --amber-100: #fef3c7;
  --amber-700: #b45309;
  --blue-100: #dbeafe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --bg: #f8f3ea;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background-color: var(--bg);
  color: var(--stone-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

input, select, textarea, button { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.kiosk-shell { max-width: 980px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.page-content { padding: 20px 24px 40px; flex: 1; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Barre haute ---------- */
.kiosk-topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--brand-500); color: #fff; flex-wrap: wrap;
}
.kiosk-topbar__brand { display: flex; align-items: center; flex-shrink: 0; }
.kiosk-topbar__logo { max-height: 34px; max-width: 160px; object-fit: contain; }
.kiosk-topbar__logo-fallback { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.kiosk-topbar__nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; justify-content: center; }
.kiosk-topbar__link {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px;
  border-radius: 10px; color: rgba(255,255,255,0.75); font-size: 11px; font-weight: 600;
}
.kiosk-topbar__link .icon { display: flex; }
.kiosk-topbar__link.active, .kiosk-topbar__link:active { background: rgba(255,255,255,0.15); color: #fff; }
.kiosk-topbar__user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.kiosk-topbar__name { font-weight: 700; font-size: 14px; }
.kiosk-topbar__logout {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 999px; background: rgba(255,255,255,0.12); color: #fff;
}

/* ---------- Cartes / mise en page générale ---------- */
.card { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 1px 3px rgba(28,55,83,0.08); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.card-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 800; color: var(--brand-700); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--brand-700); }
.text-sm { font-size: 13px; }
.text-muted { color: var(--stone-500); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 10px; }
.mb-2 { margin-bottom: 10px; }
.w-full { width: 100%; }

/* ---------- Boutons (grands, tactiles) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: 14px; border: none; font-weight: 700; font-size: 15px;
  cursor: pointer; min-height: 52px;
}
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:active { background: var(--brand-600); }
.btn-outline { background: #fff; color: var(--brand-500); box-shadow: inset 0 0 0 1.5px var(--stone-300); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--stone-600); }
.btn-sm { padding: 10px 14px; min-height: 40px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; }
.icon-btn {
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border-radius: 12px; border: none; background: var(--stone-100); color: var(--stone-700); cursor: pointer;
}

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 700; color: var(--stone-700); }
.field input, .field select, .field textarea {
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--stone-300); background: #fff; font-size: 15px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand-500); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Sélection du personnel (accueil non connecté) ---------- */
.name-list { display: flex; flex-direction: column; gap: 10px; }
.name-list-item {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(28,55,83,0.08); cursor: pointer;
}
.name-list-item:active { background: var(--cream-100); }
.name-list-item__name { flex: 1; font-weight: 700; font-size: 17px; }
.name-list-item__chevron { color: var(--stone-400); display: flex; }

.avatar {
  display: flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--cream-200); color: var(--brand-700); font-weight: 800; width: 36px; height: 36px; font-size: 14px;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ---------- Pavé PIN ---------- */
.pin-screen { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 30px 16px; }
.pin-screen__who { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin-screen__who .avatar { width: 72px; height: 72px; font-size: 26px; }
.pin-dots { display: flex; gap: 14px; }
.pin-dot { width: 18px; height: 18px; border-radius: 999px; background: var(--stone-200); box-shadow: inset 0 0 0 1.5px var(--stone-300); }
.pin-dot.filled { background: var(--brand-500); box-shadow: none; }
.pin-dot.error { background: var(--red-600); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 300px; width: 100%; }
.pin-key {
  aspect-ratio: 1; border-radius: 999px; border: none; background: #fff; font-size: 24px; font-weight: 700;
  color: var(--brand-700); box-shadow: 0 1px 3px rgba(28,55,83,0.1); cursor: pointer;
}
.pin-key:active { background: var(--cream-100); }
.pin-key--ghost { background: transparent; box-shadow: none; }

/* ---------- Bandeau d'action mis en avant (accueil) ---------- */
.cta-banner {
  display: flex; align-items: center; gap: 14px; background: var(--brand-500); color: #fff;
  border-radius: 16px; padding: 18px 20px;
}
.cta-banner__icon {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cta-banner__text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cta-banner__text strong { font-size: 15px; font-weight: 800; }
.cta-banner__text small { font-size: 12.5px; color: rgba(255,255,255,0.75); font-weight: 600; }
.cta-banner__arrow { display: flex; align-items: center; justify-content: center; opacity: .85; flex-shrink: 0; }

/* ---------- Tuiles du tableau de bord ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 18px;
  background: #fff; box-shadow: 0 1px 3px rgba(28,55,83,0.08); position: relative;
}
.tile:active { background: var(--cream-100); }
.tile__icon {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 12px; background: var(--cream-200); color: var(--brand-700);
}
.tile__label { font-weight: 700; font-size: 15px; color: var(--brand-700); }
.tile__badge {
  position: absolute; top: 14px; right: 14px; background: var(--red-600); color: #fff;
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
}

/* ---------- Checklist ---------- */
.checklist-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px;
  background: var(--stone-50); cursor: pointer;
}
.checklist-item.is-done { background: var(--green-100); }
.checklist-item.is-skipped { background: var(--red-100); }
.checklist-item__check {
  width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; box-shadow: inset 0 0 0 2px var(--stone-300); color: transparent; background: #fff;
}
.checklist-item.is-done .checklist-item__check { background: var(--green-700); box-shadow: none; color: #fff; }
.checklist-item.is-skipped .checklist-item__check { background: var(--red-600); box-shadow: none; color: #fff; }
.checklist-item__label { flex: 1; font-weight: 600; font-size: 15px; }
.checklist-item__reason { font-size: 12px; color: var(--red-700); margin-top: 2px; }
.checklist-progress { display: flex; align-items: center; gap: 10px; }
.checklist-progress__bar { flex: 1; height: 10px; border-radius: 999px; background: var(--stone-200); overflow: hidden; }
.checklist-progress__fill { height: 100%; background: var(--green-700); border-radius: 999px; }

/* ---------- Recettes ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.recipe-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(28,55,83,0.08); cursor: pointer; }
.recipe-card__photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--cream-100); }
.recipe-card__photo-fallback {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: var(--cream-100); color: var(--cream-600);
}
.recipe-card__body { padding: 12px 14px; }
.recipe-card__name { font-weight: 800; font-size: 15px; margin: 0 0 2px; }
.recipe-card__category { font-size: 12px; color: var(--stone-500); }

/* ---------- Actus ---------- */
.news-post { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(28,55,83,0.08); }
.news-post.is-pinned { box-shadow: 0 0 0 2px var(--cream-200), 0 1px 3px rgba(28,55,83,0.08); }
.news-post__title { font-weight: 800; font-size: 16px; margin: 0 0 4px; }
.news-post__date { font-size: 12px; color: var(--stone-500); margin: 0 0 10px; }
.news-post__body { white-space: pre-line; font-size: 14px; line-height: 1.5; margin: 0; }

/* ---------- Badges / alertes ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-success { background: var(--green-100); color: var(--green-700); }
.badge-danger { background: var(--red-100); color: var(--red-700); }
.badge-warning { background: var(--amber-100); color: var(--amber-700); }
.badge-brand { background: var(--cream-200); color: var(--brand-700); }
.badge-neutral { background: var(--stone-100); color: var(--stone-700); }
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.alert-success { background: var(--green-100); color: var(--green-700); }
.alert-danger { background: var(--red-100); color: var(--red-700); }
.alert-warning { background: var(--amber-100); color: var(--amber-700); }

.list-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--stone-50); gap: 10px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--stone-500); text-align: center; }
.empty-state .icon { color: var(--stone-300); }
.empty-state .title { font-weight: 700; color: var(--stone-700); }

/* ---------- Toasts / confirm modal (partagés avec le pattern PlanningBar) ---------- */
.toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast {
  background: var(--brand-700); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  opacity: 0; transform: translateY(10px); transition: all .2s; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--green-700); }
.toast--error { background: var(--red-600); }

.confirm-overlay {
  position: fixed; inset: 0; background: rgba(12,10,9,0.5); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; z-index: 9998; padding: 20px;
}
.confirm-overlay.show { opacity: 1; }
.confirm-modal { background: #fff; border-radius: 18px; padding: 24px; max-width: 400px; width: 100%; }
.confirm-modal__message { margin: 0 0 16px; font-size: 15px; font-weight: 600; }
.confirm-modal__actions { display: flex; gap: 10px; }
.confirm-modal__actions .btn { flex: 1; }

.sheet-overlay {
  position: fixed; inset: 0; background: rgba(12,10,9,0.5); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .2s; z-index: 9997;
}
.sheet-overlay.show { opacity: 1; }
.sheet-panel { background: #fff; border-radius: 20px 20px 0 0; padding: 20px 20px 28px; max-width: 520px; width: 100%; max-height: 85vh; overflow-y: auto; }
.sheet-panel__handle { width: 40px; height: 4px; background: var(--stone-300); border-radius: 999px; margin: 0 auto 16px; }
.sheet-panel__title { font-size: 17px; font-weight: 800; margin: 0 0 12px; }

@media (max-width: 640px) {
  .kiosk-topbar { flex-direction: column; align-items: stretch; }
  .kiosk-topbar__nav { justify-content: flex-start; overflow-x: auto; }
  .page-content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
}
