/* ==========================================================================
   Champimed — systeme de design
   Palette : emeraude profond (soin, confiance) + or sable (Mali, premium)
   ========================================================================== */

:root {
  /* marque */
  --brand-50:  #EAF9F4;
  --brand-100: #CFF0E5;
  --brand-200: #A2E2CD;
  --brand-300: #66CFAF;
  --brand-400: #2FB893;
  --brand-500: #12A180;
  --brand-600: #0B8368;
  --brand-700: #0B6B58;
  --brand-800: #084C40;
  --brand-900: #06332B;
  --brand-950: #05231E;

  --gold-200: #F7E4BE;
  --gold-300: #F0C77E;
  --gold-400: #E2B15F;
  --gold-500: #D4A24C;
  --gold-600: #B08234;

  /* neutres chauds */
  --ink:      #10201C;
  --ink-2:    #35514A;
  --ink-3:    #6B857D;
  --line:     #E2E8E4;
  --line-2:   #EDF1EE;
  --surface:  #FFFFFF;
  --surface-2:#F7FAF8;
  --bg:       #F2F6F3;

  /* etats */
  --ok:       #0F9A6E;
  --ok-bg:    #E6F7F0;
  --warn:     #B4700C;
  --warn-bg:  #FDF3E2;
  --danger:   #C0392B;
  --danger-bg:#FCEDEB;
  --info:     #1E6FA8;
  --info-bg:  #E9F3FA;

  /* formes */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(6, 51, 43, .06), 0 1px 3px rgba(6, 51, 43, .05);
  --sh-2: 0 4px 12px rgba(6, 51, 43, .07), 0 2px 4px rgba(6, 51, 43, .04);
  --sh-3: 0 12px 32px rgba(6, 51, 43, .12), 0 4px 8px rgba(6, 51, 43, .06);
  --sh-4: 0 24px 60px rgba(6, 51, 43, .22);

  --ff: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --ff-num: "SF Mono", "Segoe UI", Consolas, system-ui, sans-serif;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand-700); }

.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* --------------------------------------------------------- fond decoratif */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 12% -6%, rgba(18, 161, 128, .16), transparent 62%),
    radial-gradient(700px 380px at 96% 4%, rgba(212, 162, 76, .13), transparent 60%);
}

/* ================================================================= EN-TETE */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--safe-t);
  background: linear-gradient(178deg, var(--brand-900), var(--brand-800) 58%, var(--brand-700));
  color: #fff;
  box-shadow: var(--sh-2);
}

.topbar__in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand__mark { width: 38px; height: 38px; border-radius: 11px; flex: none; box-shadow: 0 2px 10px rgba(0,0,0,.28); }
.brand__mark--lg { width: 74px; height: 74px; border-radius: 21px; }
.brand__txt { min-width: 0; }

.wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.32px;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
}
.wordmark em { font-style: normal; color: var(--gold-300); }
.wordmark--xl { font-size: 34px; letter-spacing: -.9px; }
.wordmark--ink { color: var(--brand-900); }
.wordmark--ink em { color: var(--gold-600); }

.tagline {
  font-size: 11.5px;
  letter-spacing: .34px;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tagline--ink { color: var(--ink-3); }

.topbar__sp { flex: 1; }

/* pastille reseau */
.netdot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.12);
  color: #fff;
  white-space: nowrap;
}
.netdot i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-300); flex: none; }
.netdot--off i { background: var(--gold-400); }
.netdot__q {
  background: var(--gold-500);
  color: var(--brand-950);
  border-radius: var(--r-pill);
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  min-width: 17px;
  text-align: center;
}

/* ============================================== bandeau client selectionne */
.clientbar {
  position: sticky;
  top: 0;
  z-index: 35;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.clientbar__in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.clientbar__ic {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-50);
  color: var(--brand-700);
}
.clientbar__txt { min-width: 0; flex: 1; }
.clientbar__lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink-3);
}
.clientbar__nom {
  font-size: 14.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ================================================================== LAYOUT */
.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 16px; }
.wrap--pad-cart { padding-bottom: calc(112px + var(--safe-b)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card--pad { padding: 18px; }

.sect-title {
  font-size: 12px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 10px;
}

/* ================================================================ CONTROLES */
.field { display: block; margin-bottom: 14px; }
.field__lbl {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--ink-2); margin-bottom: 6px;
}
.field__hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(18, 161, 128, .14);
}
.input::placeholder { color: #9CB0A9; }
.input--lg { padding: 15px 16px 15px 46px; font-size: 16px; border-radius: var(--r-lg); }

.searchbox { position: relative; }
.searchbox svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
}
.searchbox__clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-3);
}
.searchbox__clear:hover { background: var(--line-2); color: var(--ink); }

/* boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r);
  font-weight: 650;
  font-size: 14.5px;
  border: 1.5px solid transparent;
  transition: transform .1s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn--primary {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  color: #fff;
  box-shadow: 0 2px 10px rgba(11, 107, 88, .28);
}
.btn--primary:hover { background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); }

.btn--gold {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  color: var(--brand-950);
  box-shadow: 0 2px 10px rgba(176, 130, 52, .3);
}
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); }
.btn--quiet { background: transparent; color: var(--ink-3); padding: 8px 12px; }
.btn--quiet:hover { background: var(--line-2); color: var(--ink); }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--danger:hover { background: #F8DDD9; }
.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn--block { width: 100%; }
.btn--onbrand {
  background: rgba(255,255,255,.14); color: #fff;
  border-color: rgba(255,255,255,.2);
}
.btn--onbrand:hover { background: rgba(255,255,255,.24); }

/* onglets / filtres */
.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: .15s;
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); }
.chip[aria-pressed="true"] {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}
.chip__n { opacity: .6; font-weight: 600; margin-left: 3px; font-size: 12px; }

/* ================================================== LISTE CLIENTS / PRODUITS */
.list { display: flex; flex-direction: column; gap: 8px; }

.row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.row:hover { border-color: var(--brand-300); box-shadow: var(--sh-1); }
.row--sel { border-color: var(--brand-500); background: var(--brand-50); }
.row--muted { opacity: .55; }

.row__ic {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-50);
  color: var(--brand-700);
}
.row__ic--gold { background: var(--gold-200); color: var(--gold-600); }
.row__main { flex: 1; min-width: 0; display: block; }
.row__nom {
  display: block;
  font-weight: 650; font-size: 14.5px; color: var(--ink); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row__sub {
  display: block;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row__end { flex: none; text-align: right; display: flex; align-items: center; gap: 10px; }

.price { font-weight: 750; font-size: 15px; color: var(--brand-800); white-space: nowrap; }
.price small { font-weight: 600; font-size: 11px; color: var(--ink-3); }

.tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--line-2); color: var(--ink-3);
  text-transform: uppercase;
}
.tag--brand { background: var(--brand-50); color: var(--brand-700); }
.tag--gold  { background: var(--gold-200); color: var(--gold-600); }
.tag--ok    { background: var(--ok-bg); color: var(--ok); }
.tag--warn  { background: var(--warn-bg); color: var(--warn); }
.tag--info  { background: var(--info-bg); color: var(--info); }
.tag--danger{ background: var(--danger-bg); color: var(--danger); }

/* pas-a-pas quantite */
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.qty button {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--brand-700); font-size: 19px; font-weight: 700; line-height: 1;
}
.qty button:hover { background: var(--brand-50); }
.qty button:disabled { opacity: .3; pointer-events: none; }
.qty input {
  width: 44px; border: 0; background: transparent; text-align: center;
  font-weight: 700; font-size: 15px; outline: none;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.addbtn {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-700); color: #fff;
  box-shadow: 0 2px 8px rgba(11,107,88,.26);
  transition: .15s;
}
.addbtn:hover { background: var(--brand-600); }

/* ============================================================ ARDOISE / PANIER */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(6,51,43,.08);
}
.dock__in {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.dock__tot { flex: 1; min-width: 0; }
.dock__lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-3); }
.dock__val {
  font-size: 25px; font-weight: 800; letter-spacing: -.6px; color: var(--brand-800);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.dock__val small { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-left: 3px; }

/* animation d'ajout au panier */
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.09); } 100% { transform: scale(1); } }
.pop { animation: pop .32s ease; }

/* =============================================================== FEUILLES / MODALES */
.sheet-bg {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 35, 30, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
.sheet-bg--center { align-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }

.sheet {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-4);
  display: flex; flex-direction: column;
  animation: rise .26s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}
.sheet--center { border-radius: var(--r-xl); max-width: 460px; animation: zoom .26s cubic-bezier(.22,1,.36,1); }
@keyframes rise { from { transform: translateY(28px); opacity: .4; } }
@keyframes zoom { from { transform: scale(.94); opacity: 0; } }

.sheet__hd {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet__ttl { font-size: 17px; font-weight: 750; letter-spacing: -.2px; flex: 1; }
.sheet__bd { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__ft {
  padding: 12px 18px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex; gap: 10px;
}
.sheet__ft .btn { flex: 1; }

.xbtn {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-3);
}
.xbtn:hover { background: var(--line-2); color: var(--ink); }

/* ------------------------------------------------- confirmation de commande */
.done { text-align: center; padding: 30px 24px 24px; }
.done__ring {
  width: 92px; height: 92px; margin: 0 auto 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, var(--brand-400), var(--brand-700));
  box-shadow: 0 10px 34px rgba(11, 107, 88, .34);
  animation: ringIn .5s cubic-bezier(.2,1.3,.4,1);
}
@keyframes ringIn { from { transform: scale(.4); opacity: 0; } }
.done__ring svg { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .45s .2s forwards ease-out; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__ttl { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin: 0 0 8px; color: var(--brand-900); }
.done__txt { color: var(--ink-2); margin: 0 0 18px; font-size: 15px; }
.done__ref {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 11px 20px; border-radius: var(--r);
  background: var(--brand-50); border: 1px dashed var(--brand-200);
}
.done__ref b { font-size: 17px; letter-spacing: .4px; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.done__ref span { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); font-weight: 700; }

/* ------------------------------------------------------------------- toasts */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(104px + var(--safe-b));
  z-index: 70;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  background: var(--brand-950); color: #fff;
  padding: 11px 16px; border-radius: var(--r);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--sh-3);
  display: flex; align-items: center; gap: 9px;
  animation: toastIn .22s ease;
}
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }
.toast--gold { background: var(--gold-500); color: var(--brand-950); }

/* ----------------------------------------------------------------- vide/etat */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty svg { color: var(--brand-200); margin-bottom: 12px; }
.empty b { display: block; color: var(--ink-2); font-size: 15.5px; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 13.5px; }

/* ============================================================= ECRAN D'ACCUEIL */
.hero {
  text-align: center;
  padding: 26px 20px 22px;
}
.hero .brand__mark--lg { margin-bottom: 14px; }
.hero__sub { color: var(--ink-2); font-size: 14.5px; margin: 8px auto 0; max-width: 30rem; }

/* ================================================================= ADMIN */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 15px;
}
.kpi__lbl { font-size: 11px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; color: var(--ink-3); }
.kpi__val { font-size: 23px; font-weight: 800; letter-spacing: -.5px; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.kpi__val small { font-size: 12px; font-weight: 700; color: var(--ink-3); }

.tabbar {
  display: flex; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button {
  flex: 1; min-width: max-content;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 650; color: var(--ink-3);
  transition: .15s;
}
.tabbar button[aria-selected="true"] { background: var(--brand-700); color: #fff; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase; color: var(--ink-3);
  padding: 9px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: right; }
.tbl input.cell {
  width: 108px; padding: 6px 9px; text-align: right;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums; font-weight: 650;
}
.tbl input.cell:focus { border-color: var(--brand-400); outline: none; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* interrupteur */
.sw { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span {
  position: absolute; inset: 0; cursor: pointer;
  background: #CBD8D3; border-radius: var(--r-pill);
  transition: .2s;
}
.sw span::before {
  content: ""; position: absolute;
  height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: .2s; box-shadow: var(--sh-1);
}
.sw input:checked + span { background: var(--brand-500); }
.sw input:checked + span::before { transform: translateX(18px); }

/* connexion admin */
.gate {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  position: relative; z-index: 1;
}
.gate__card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: 30px 26px;
  text-align: center;
}
.pin {
  width: 100%; text-align: center;
  font-size: 30px; letter-spacing: 12px; font-weight: 700;
  padding: 14px 10px; margin: 6px 0 4px;
  border: 1.5px solid var(--line); border-radius: var(--r);
  outline: none;
}
.pin:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(18,161,128,.14); }

.note {
  font-size: 13px; color: var(--ink-2);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  margin: 0 0 14px;
}
.note--warn { background: var(--warn-bg); border-color: #F3E1C2; border-left-color: var(--gold-500); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.hr { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

/* ------------------------------------------------------- detail de commande */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.dl dt { color: var(--ink-3); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; }

.lines { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lines__it {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line-2);
}
.lines__it:last-child { border-bottom: 0; }
.lines__it b { flex: 1; font-weight: 650; font-size: 13.5px; }
.lines__tot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; background: var(--brand-50);
  font-weight: 800; color: var(--brand-800);
}

@media print {
  .topbar, .dock, .tabbar, .btn, .clientbar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

mark {
  background: var(--gold-200);
  color: var(--brand-900);
  border-radius: 3px;
  padding: 0 1px;
  font-weight: 700;
}

/* ==========================================================================
   AUTHENTIFICATION — écran unique de connexion / création de compte
   ========================================================================== */

.gate__card--wide { max-width: 440px; text-align: left; }
.gate__card--wide .brand__mark--lg,
.gate__card--wide .wordmark,
.gate__card--wide .tagline { display: block; margin-left: auto; margin-right: auto; text-align: center; }

/* bascule Se connecter / Créer un compte */
.segbar {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 20px;
}
.segbar button {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-3);
  white-space: nowrap;
  transition: .15s;
}
.segbar button[aria-selected="true"] {
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 2px 8px rgba(11, 107, 88, .24);
}

/* champ mot de passe avec le petit œil */
.pwd { position: relative; display: block; }
.pwd .input { padding-right: 48px; }
.pwd__eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-3);
  transition: .15s;
}
.pwd__eye:hover { background: var(--line-2); color: var(--brand-700); }
.pwd__eye[aria-pressed="true"] { color: var(--brand-600); }

.btn--lg { padding: 14px 20px; font-size: 15.5px; border-radius: var(--r-lg); }

/* messages sous le formulaire */
.alert {
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  margin: 0 0 14px;
  border-left: 3px solid;
}
.alert--danger { background: var(--danger-bg); color: var(--danger); border-left-color: var(--danger); }
.alert--ok     { background: var(--ok-bg);     color: var(--ok);     border-left-color: var(--ok); }

/* pastille du compte dans l'en-tête */
.avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .16);
  border: 1.5px solid rgba(255, 255, 255, .28);
  color: #fff;
  font-size: 13px; font-weight: 750; letter-spacing: .3px;
  transition: .15s;
}
.avatar:hover { background: rgba(255, 255, 255, .28); }

/* ==========================================================================
   ADMIN — statistiques
   ========================================================================== */

.podium { display: flex; flex-direction: column; gap: 8px; }
.podium__it {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.podium__rg {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-700);
  font-weight: 800; font-size: 13px;
}
.podium__it:nth-child(1) .podium__rg { background: var(--gold-300); color: var(--brand-950); }
.podium__it:nth-child(2) .podium__rg { background: #E4E9E7; color: var(--ink-2); }
.podium__it:nth-child(3) .podium__rg { background: #F0DCC4; color: var(--warn); }
.podium__nm { flex: 1; min-width: 0; font-weight: 650; font-size: 14px;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__vl { font-weight: 750; color: var(--brand-800); font-variant-numeric: tabular-nums; white-space: nowrap; }
.podium__sb { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* histogramme mensuel */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 148px; padding: 8px 0 0; }
.bars__c { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
           align-items: center; gap: 6px; min-width: 0; height: 100%; }
.bars__b {
  width: 100%; max-width: 46px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-700));
  min-height: 3px;
  transition: height .35s cubic-bezier(.22,1,.36,1);
}
.bars__c--max .bars__b { background: linear-gradient(180deg, var(--gold-400), var(--gold-600)); }
.bars__l { font-size: 10.5px; color: var(--ink-3); font-weight: 650; white-space: nowrap; }
.bars__v { font-size: 10.5px; color: var(--ink-2); font-weight: 750;
           font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Suggestion d'établissement : rien ne s'affiche avant 3 lettres saisies.
   L'annuaire n'est jamais présenté comme une liste à parcourir.
   -------------------------------------------------------------------------- */
.suggest { position: relative; }
.suggest__pop {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  z-index: 20;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-3);
  max-height: 232px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 5px;
}
.suggest__it {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  transition: background .12s;
}
.suggest__it:hover,
.suggest__it[aria-selected="true"] { background: var(--brand-50); }
.suggest__nm {
  display: block;
  font-size: 14px; font-weight: 650; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest__sb {
  display: block;
  font-size: 12px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest__none { padding: 10px 11px; font-size: 13px; color: var(--ink-3); }

/* ligne dépliable : historique des commandes du client */
.row--stack { flex-direction: column; align-items: stretch; gap: 0; cursor: pointer; }
.row__hd { display: flex; align-items: center; gap: 12px; width: 100%; }
.row__detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
