/* ==========================================================================
   Espace d'administration — aperçu WebnexLab
   Page de démonstration : elle ressemble à un vrai panneau, mais rien n'y est
   modifiable. Aucune dépendance, aucun build.

   Elle vit hors des dossiers de maquettes, et c'est volontaire : l'espace
   d'administration n'est pas livré avec les fichiers d'un modèle, il est
   construit avec le site. Le mettre dans `restaurant/` laisserait croire
   qu'il fait partie du dossier remis au client.
   ========================================================================== */

:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --ink: #14161c;
  --muted: #5c6472;
  --faint: #8a92a1;
  --line: #e2e5eb;
  --line-strong: #cdd2db;
  --accent: #3f3d9e;
  --accent-soft: #ecebf8;
  --accent-line: #cfcdf0;
  --ok: #1c7a53;
  --ok-soft: #e3f2eb;
  --warn: #8a5a00;
  --warn-soft: #fdf1da;
  --r: 14px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1, h2 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1rem; font-weight: 600; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.15em; height: 1.15em; flex: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: .6rem; left: 50%; transform: translate(-50%, -200%);
  z-index: 300; padding: .6rem 1.1rem; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .85rem;
}
.skip-link:focus { transform: translate(-50%, 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }

/* --- Bandeau d'avertissement -------------------------------------------- */

.warn { background: var(--warn-soft); border-bottom: 1px solid #f0dcb4; }
.warn__in {
  display: flex; align-items: flex-start; gap: .8rem;
  max-width: 1400px; margin-inline: auto; padding: .85rem clamp(1rem, 3vw, 2rem);
  font-size: .86rem; line-height: 1.5; color: var(--warn);
}
.warn .ico { margin-top: .15rem; }
.warn p { flex: 1; }
.warn strong { font-weight: 600; }
.warn__back {
  display: inline-flex; align-items: center; gap: .4rem; flex: none;
  padding: .4rem .9rem; border-radius: 999px; border: 1px solid #e0c68c;
  font-size: .8rem; font-weight: 500; white-space: nowrap;
  transition: background-color .2s var(--ease);
}
.warn__back:hover { background: #f8e6c4; }

/* --- Barre du haut ------------------------------------------------------ */

.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  background: var(--surface); border-bottom: 1px solid var(--line);
}

.top__site { display: flex; align-items: center; gap: .7rem; margin-right: auto; }
.top__dot {
  width: 2.1rem; height: 2.1rem; flex: none; border-radius: 8px;
  background: var(--accent);
  box-shadow: inset 0 -.55rem 0 rgb(255 255 255 / .18);
}
.top__site strong { display: block; font-size: .95rem; font-weight: 600; line-height: 1.25; }
.top__site small { display: block; font-size: .74rem; color: var(--faint); }

.top__right { display: flex; align-items: center; gap: .6rem; }

.picker { display: inline-flex; align-items: center; gap: .5rem; }
.picker__label {
  padding: .35rem .75rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}

.picker select {
  padding: .5rem .8rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); font: inherit; font-size: .82rem;
  max-width: 15rem;
}
.picker select:focus { outline: none; border-color: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}

.burger { display: none; width: 2.4rem; height: 2.4rem; place-items: center; border-radius: 8px; border: 1px solid var(--line-strong); }

/* --- Colonnes ----------------------------------------------------------- */

.shell {
  display: grid; grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  max-width: 1400px; margin-inline: auto;
  padding: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

.side {
  position: sticky; top: 5.2rem;
  display: flex; flex-direction: column; gap: .2rem;
  padding: .8rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}

.side__item {
  display: flex; align-items: center; gap: .7rem;
  padding: .68rem .8rem; border-radius: 10px;
  font-size: .89rem; font-weight: 500; color: var(--muted); text-align: left;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.side__item:hover { background: var(--bg); color: var(--ink); }
.side__item.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side__item span:first-of-type { flex: 1; }

.side__badge {
  padding: .1rem .5rem; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
}

.side__note {
  margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line);
  font-size: .74rem; line-height: 1.5; color: var(--faint);
}
.side__note strong { color: var(--muted); font-weight: 600; }

/* --- Panneau ------------------------------------------------------------ */

.panel { min-width: 0; }

.panel__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem;
  margin-bottom: 1.4rem;
}
.panel__head h1 { flex: 1 0 auto; }
.panel__head p { flex: 1 1 100%; font-size: .89rem; color: var(--muted); order: 3; }
.panel__head .btn { order: 2; }

/* --- Tuiles chiffrées ---------------------------------------------------- */

.tiles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); margin-bottom: 1.4rem; }
.tile { padding: 1.1rem 1.2rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.tile__label { font-size: .76rem; color: var(--faint); }
.tile__value { margin-top: .25rem; font-size: 1.65rem; font-weight: 600; letter-spacing: -.02em; }
.tile__delta { font-size: .74rem; color: var(--ok); font-weight: 500; }

/* --- Cartes -------------------------------------------------------------- */

.cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); align-items: start; }

.card { padding: 1.2rem 1.3rem 1.3rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.card--soft { background: var(--accent-soft); border-color: var(--accent-line); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card__foot { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--accent-line); font-size: .78rem; color: var(--muted); }

.feed li { display: flex; gap: .8rem; padding-block: .75rem; border-top: 1px solid var(--line); font-size: .87rem; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed__when { flex: none; width: 5.5rem; color: var(--faint); font-size: .8rem; }
.feed__what strong { font-weight: 600; }
.feed__what span { display: block; color: var(--muted); font-size: .82rem; }

.can li { display: flex; gap: .65rem; padding-block: .45rem; font-size: .87rem; color: var(--accent); }
.can li::before {
  content: ""; flex: none; margin-top: .48rem; width: .85rem; height: .45rem;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

/* --- Tableaux ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.table { width: 100%; min-width: 38rem; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: .85rem 1.1rem; text-align: left; }
.table thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); font-weight: 600; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody tr { border-top: 1px solid var(--line); }
.table tbody tr:first-child { border-top: 0; }
.table tbody tr:hover { background: var(--bg); }
.table td strong { font-weight: 600; }
.table td small { display: block; color: var(--faint); font-size: .78rem; }
.table .num { white-space: nowrap; font-variant-numeric: tabular-nums; }

.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.icon-btn {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 8px; border: 1px solid var(--line-strong); color: var(--muted);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.tag { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.tag--new { background: var(--accent-soft); color: var(--accent); }
.tag--done { background: var(--ok-soft); color: var(--ok); }
.tag--wait { background: var(--warn-soft); color: var(--warn); }

/* --- Filtres -------------------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip-btn {
  padding: .42rem .95rem; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: .82rem; font-weight: 500; color: var(--muted);
  transition: all .2s var(--ease);
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --- Formulaires (désactivés) --------------------------------------------- */

.form { display: grid; gap: .85rem; }
.field { display: grid; gap: .3rem; }
.field span { font-size: .76rem; font-weight: 600; color: var(--muted); }
.field input {
  width: 100%; padding: .62rem .8rem; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  font: inherit; font-size: .88rem;
}
.field input:disabled { cursor: not-allowed; }

.switch { display: flex; align-items: flex-start; gap: .6rem; font-size: .87rem; color: var(--muted); }
.switch input { margin-top: .3rem; accent-color: var(--accent); }

/* --- Notes et avertissements ---------------------------------------------- */

.hint {
  display: flex; align-items: flex-start; gap: .6rem;
  margin-top: 1rem; font-size: .81rem; line-height: 1.55; color: var(--faint);
}
.hint .ico { margin-top: .15rem; flex: none; }

.notice {
  display: flex; align-items: flex-start; gap: .8rem;
  margin-top: 1.2rem; padding: 1rem 1.2rem; border-radius: var(--r);
  background: var(--ok-soft); border: 1px solid #c6e4d6;
  font-size: .85rem; line-height: 1.55; color: var(--ok);
}
.notice .ico { margin-top: .15rem; flex: none; }
.notice strong { display: block; font-weight: 600; }

/* --- Boutons -------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font-size: .85rem; font-weight: 500;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn--solid { background: var(--accent); color: #fff; }
.btn--solid:hover { filter: brightness(1.1); }
.btn--ghost { border-color: var(--line-strong); color: var(--muted); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* --- Pied de page ---------------------------------------------------------- */

.foot {
  max-width: 1400px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem) 3rem;
  display: grid; gap: .7rem; justify-items: start;
  font-size: .87rem; line-height: 1.6; color: var(--muted);
  border-top: 1px solid var(--line);
}
.foot strong { color: var(--ink); font-weight: 600; }
.foot .btn { margin-top: .6rem; }

/* --- Notification ---------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 200;
  transform: translate(-50%, 160%); opacity: 0;
  max-width: min(30rem, calc(100vw - 2rem));
  padding: .8rem 1.3rem; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .84rem; text-align: center;
  box-shadow: 0 14px 34px rgb(20 22 28 / .3);
  transition: transform .35s var(--ease), opacity .25s var(--ease);
  pointer-events: none;
}
.toast.is-up { transform: translate(-50%, 0); opacity: 1; }

/* --- Adaptations ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .burger { display: grid; }
  .side {
    position: static;
    display: none;
  }
  .side.is-open { display: flex; }
  .warn__in { flex-wrap: wrap; }
  .warn__back { margin-left: auto; }
}

@media (max-width: 640px) {
  .picker { display: none; }
  .top__right .chip span { display: none; }
  .panel__head .btn { order: 4; }
}
