/* ============================================================
   LIDESK — App shell (web app connectée)
   Réutilisable par les 3 interfaces. Desktop 1280.
   ============================================================ */

.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; background: var(--paper); }

/* ---------- SIDEBAR ---------- */
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 20px 22px; border-bottom: 1px solid var(--line-2); }
.side-brand .wm { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.03em; color: var(--ink); }
.side-ctx { display: flex; align-items: center; gap: 10px; margin: 16px 16px 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.side-ctx > div { flex: 1; min-width: 0; overflow: hidden; }
.side-ctx .av { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; overflow: hidden; }
.side-ctx .av.has-img, .tb-av.has-img { background: var(--line-2); color: transparent; padding: 0; }
.side-ctx .av img, .tb-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.side-ctx .av.warm { background: var(--warm); }
.side-ctx .av.ink { background: var(--ink); }
.side-ctx .nm { font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-ctx .rl { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-ctx .chev { margin-left: auto; color: var(--ink-3); }
.side-nav { padding: 12px 12px; flex: 1; overflow-y: auto; }
.side-nav .grp + .grp { margin-top: 4px; }
.nav-back-app { margin-bottom: 10px; font-weight: 600; color: var(--accent-press) !important; border: 1px solid var(--line); background: var(--paper); }
.nav-back-app:hover { background: var(--accent-soft); border-color: var(--accent); }
.nav-back-app-foot { display: flex; width: 100%; justify-content: center; text-decoration: none; }
.side-nav .grp:first-child { margin-top: 0; }
.side-nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; padding: 14px 12px 8px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .14s; margin-bottom: 2px; text-decoration: none; }
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); transition: color .14s; }
.nav-item:hover { background: var(--paper); color: var(--ink); }
.nav-item.active { background: var(--ink); color: #fff; }
.nav-item.active svg { color: var(--accent-bright); }
.nav-item .badge-n { margin-left: auto; background: var(--accent-soft); color: var(--accent-press); font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.nav-item.active .badge-n { background: rgba(255,255,255,.16); color: #fff; }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--line-2); }
.side-credits { background: var(--ink); border-radius: var(--r-md); padding: 14px 16px; color: #fff; }
.side-credits .cl { font-size: 11.5px; color: rgba(255,255,255,.55); display: flex; justify-content: space-between; }
.side-credits .cv { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; margin: 4px 0 8px; }
.side-credits .cbar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.side-credits .cbar i { display: block; height: 100%; background: var(--accent-bright); border-radius: 999px; }
.side-credits .side-credits-cta {
  margin-top: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

/* ---------- MAIN ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar-app { height: 68px; display: flex; align-items: center; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.topbar-app h1 { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -.02em; color: var(--ink); }
.topbar-app .crumb { font-size: 13px; color: var(--ink-3); }
.tb-search { margin-left: auto; position: relative; width: 280px; }
.tb-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.tb-search input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px 9px 36px; font-size: 13.5px; color: var(--ink); }
.tb-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tb-icon { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--ink-2); position: relative; transition: all .14s; }
.tb-icon:hover { border-color: var(--ink-3); color: var(--ink); }
.tb-icon .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--warm); border: 1.5px solid var(--surface); }
.tb-av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.tb-av:hover { box-shadow: 0 0 0 2px var(--line), 0 0 0 4px var(--accent-soft); }
.tb-av:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.view { padding: 30px; display: none; }
.view.active { display: block; }
.view-max { max-width: 1180px; }

/* ---------- generic page bits ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head .pt { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -.02em; color: var(--ink); }
.page-head .ps { font-size: 14px; color: var(--ink-3); margin-top: 4px; }
.row-actions { display: flex; gap: 10px; align-items: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.col-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--ink); }
.card-head .link { font-size: 13px; font-weight: 600; color: var(--accent-press); display: inline-flex; align-items: center; gap: 4px; }

/* stat tiles */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.stat .sl { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.stat .sl .si { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-press); display: flex; align-items: center; justify-content: center; }
.stat .sv { font-family: var(--display); font-weight: 700; font-size: 32px; letter-spacing: -.025em; color: var(--ink); margin-top: 14px; }
.stat .sv small { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.stat .sd { font-size: 12.5px; margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.stat .sd.up { color: var(--ok); } .stat .sd.down { color: var(--warm); } .stat .sd.mut { color: var(--ink-3); font-weight: 400; }

/* hero credits stat (dark) */
.credit-hero { color: #fff; border-radius: var(--r-lg); padding: 26px 28px; position: relative; overflow: hidden;
  background:
    radial-gradient(360px 300px at 100% 0%, color-mix(in srgb, var(--accent-bright) 32%, transparent), transparent 62%),
    var(--ink); }
.credit-hero .inner { position: relative; z-index: 2; }
.credit-hero .cl { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.credit-hero .cv { font-family: var(--display); font-weight: 800; font-size: 52px; letter-spacing: -.03em; margin: 8px 0 4px; }
.credit-hero .cv small { font-size: 20px; color: rgba(255,255,255,.5); font-weight: 600; }
.credit-hero .cbar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; margin: 16px 0 10px; }
.credit-hero .cbar i { display: block; height: 100%; background: var(--accent-bright); border-radius: 999px; }
.credit-hero .cmeta { display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,.6); }
.credit-hero .cmeta b { color: #fff; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: 12px 22px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 14px 22px; border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--ink); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--paper); }
.tbl .num { font-family: var(--mono); font-size: 13px; }
.tbl .right { text-align: right; }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-av { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-press); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.cell-av.thumb { background: linear-gradient(135deg, var(--accent), #0a6f70); }
.cell-sub { font-size: 12px; color: var(--ink-3); }

/* list rows */
.lrow { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.lrow:last-child { border-bottom: none; }
.lrow .thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #0a6f70);
  border: 1px solid var(--line);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.8);
  overflow: hidden;
}
.lrow .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lrow .thumb-fallback { width: 20px; height: 20px; }
.lrow .lmain { flex: 1; min-width: 0; }
.lrow .lt { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.lrow .ls { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* tabs / segmented */
.tabs { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.tabs button { padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: all .14s; }
.tabs button.active { background: var(--ink); color: #fff; }

/* mini progress */
.prog { height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* map placeholder */
.map { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background:
  radial-gradient(circle at 30% 40%, #d9ece9 0, transparent 40%),
  radial-gradient(circle at 70% 70%, #e7efe2 0, transparent 45%),
  #eef1ec; min-height: 420px; }
.map .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; opacity: .5; }
.map .road { position: absolute; background: #fff; }
.map-pin { position: absolute; transform: translate(-50%,-100%); cursor: pointer; }
.map-pin .pp { background: var(--ink); color: #fff; font-family: var(--display); font-weight: 700; font-size: 13px; padding: 5px 11px; border-radius: 999px; box-shadow: var(--sh-md); white-space: nowrap; display: flex; align-items: center; gap: 6px; transition: all .15s; }
.map-pin .pp::after { content: ""; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 10px; height: 10px; background: var(--ink); }
.map-pin.accent .pp { background: var(--accent); } .map-pin.accent .pp::after { background: var(--accent); }
.map-pin:hover .pp, .map-pin.on .pp { background: var(--warm); transform: scale(1.06); } .map-pin:hover .pp::after, .map-pin.on .pp::after { background: var(--warm); }

/* modal */
body.lidesk-modal-open .leaflet-container { visibility: hidden; pointer-events: none; }
.modal-back { position: fixed; inset: 0; background: rgba(11,27,43,.5); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 24px; }
.modal-back.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-xl); width: 100%; max-width: 540px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; animation: pop .22s ease; }
.modal.wide { max-width: 680px; }
.detail-hero { height: 200px; border-radius: 14px; overflow: hidden; margin-bottom: 16px; position: relative; background: linear-gradient(135deg, var(--accent), #0a6f70); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-hero-fallback { display: flex; align-items: flex-end; height: 100%; padding: 14px; }
.detail-map { height: 168px; border-radius: 12px; overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); background: var(--paper); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.modal-x { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); transition: all .14s; }
.modal-x:hover { background: var(--paper); color: var(--ink); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { padding: 18px 24px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.modal-foot .spread { margin-right: auto; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }
.stepper .sp { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.stepper .sp .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; font-family: var(--mono); }
.stepper .sp.done .n, .stepper .sp.cur .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .sp.cur { color: var(--ink); }
.stepper .line { flex: 1; height: 1.5px; background: var(--line); margin: 0 12px; }
.stepper .line.done { background: var(--accent); }

/* QR */
.qr-box { width: 180px; height: 180px; border-radius: var(--r-md); border: 1px solid var(--line); padding: 14px; background: #fff; margin: 0 auto; }
.qr-box svg { width: 100%; height: 100%; }

/* slot picker (time) */
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.slot { padding: 11px 0; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; font-family: var(--mono); font-size: 13px; color: var(--ink); cursor: pointer; transition: all .14s; }
.slot:hover { border-color: var(--accent); }
.slot.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot.off { opacity: .35; pointer-events: none; text-decoration: line-through; }

.book-picker { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(220px, 1.2fr); gap: 20px; margin-bottom: 18px; }
.book-cal-widget {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  padding: 12px;
}
.book-cal-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
}
.book-cal-toolbar-sub { margin-bottom: 10px; }
.book-cal-title {
  flex: 1; text-align: center; font-family: var(--display); font-weight: 700; font-size: 15px;
  text-transform: capitalize;
}
.book-cal-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); cursor: pointer; font-size: 18px; line-height: 1;
}
.book-cal-btn:hover { border-color: var(--accent); color: var(--accent); }
.book-cal-btn-text {
  width: auto; min-width: 0; padding: 0 10px; font-size: 12px; font-weight: 600;
}
.book-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px;
}
.book-cal-weekdays span {
  text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-3);
}
.book-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.book-cal-day {
  position: relative; min-height: 42px; border: 1.5px solid transparent; border-radius: 10px;
  background: transparent; cursor: pointer; transition: all .14s; padding: 4px 0 10px;
}
.book-cal-day:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--paper); }
.book-cal-day.on { border-color: var(--accent); background: var(--accent-soft); }
.book-cal-day.muted .book-cal-num { color: var(--ink-3); opacity: .45; }
.book-cal-day.off { opacity: .35; cursor: not-allowed; }
.book-cal-num {
  display: block; text-align: center; font-family: var(--display); font-weight: 700; font-size: 14px;
}
.book-cal-badge {
  position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px;
}
.book-slots-wrap .book-day-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--ink-2); }
.book-cart {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg);
  padding: 14px 16px;
}
.book-cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.book-cart-head h4 { font-family: var(--display); font-weight: 700; font-size: 14px; margin: 0; }
.book-cart-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.book-cart-item:last-child { border-bottom: none; }
.book-cart-summary { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.book-cart-empty { font-size: 13px; color: var(--ink-3); padding: 8px 0; }
.book-credits-recap { margin-bottom: 16px; }
.book-credits-note { font-size: 13px; color: var(--ink-3); margin-top: 14px; line-height: 1.5; }
.book-credits-meter { margin-top: 4px; }
.book-credits-meter-label {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 8px;
}
.book-credits-meter-track {
  position: relative; height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden;
}
.book-credits-meter-fill {
  position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); border-radius: 999px;
  transition: width .2s ease;
}
.book-credits-meter-fill.book-credits-meter-new { background: color-mix(in srgb, var(--accent) 55%, #f59e0b); }
@media (max-width: 720px) {
  .book-picker { grid-template-columns: 1fr; }
}

/* recap line */
.recap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.recap .rr { display: flex; justify-content: space-between; padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--line-2); }
.recap .rr:last-child { border-bottom: none; }
.recap .rr .k { color: var(--ink-3); }
.recap .rr .v { font-weight: 600; color: var(--ink); }
.recap .rr.total { background: var(--paper); }
.recap .rr.total .v { font-family: var(--display); font-size: 18px; }

/* empty state (app) */
.empty-app { text-align: center; padding: 60px 24px; }
.empty-app .ei { width: 64px; height: 64px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.empty-app h4 { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); }
.empty-app p { font-size: 14px; color: var(--ink-3); max-width: 38ch; margin: 8px auto 18px; line-height: 1.5; }

/* form (app) */
.fld { margin-bottom: 16px; }
.fld label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.fld .inp, .fld select { width: 100%; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 14px; color: var(--ink); }
.fld .inp:focus, .fld select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fld .inp[readonly],
.fld input[readonly],
.fld textarea[readonly],
.fld input:disabled,
.fld select[disabled] {
  background: var(--paper);
  color: var(--ink-3);
  border-style: dashed;
  cursor: not-allowed;
}
.fld-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin: 6px 0 0;
  line-height: 1.45;
}
.readonly-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .tl { font-weight: 600; font-size: 14px; color: var(--ink); }
.toggle-row .ts { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.tg { width: 44px; height: 25px; border-radius: 999px; background: var(--line); position: relative; transition: all .2s; flex: none; cursor: pointer; }
.tg.on { background: var(--accent); }
.tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: all .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tg.on::after { left: 22px; }

/* Horaires d'ouverture (admin + partenaire) */
.hours-editor { border: 1px solid var(--line-2); border-radius: 10px; padding: 4px 14px; background: var(--paper); }
.hours-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 44px; align-items: center; column-gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.hours-row:last-child { border-bottom: none; }
.hours-row .hd { font-weight: 600; font-size: 13px; width: 40px; color: var(--ink); flex: none; }
.hours-row .ht { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.hours-inp { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--surface); width: 112px; max-width: 100%; }
.hours-row.closed .ht { color: var(--ink-3); }
.hours-row.closed .hours-inp,
.hours-row.closed .hours-sep { display: none; }
.hours-row:not(.closed) .hours-closed-label { display: none; }
.hours-row .tg { margin-left: 0; justify-self: end; transform: scale(.9); }

@media (max-width: 680px) {
  .hours-row { grid-template-columns: 40px minmax(0, 1fr) 40px; column-gap: 8px; }
  .hours-row .ht { gap: 6px; }
  .hours-inp { width: 96px; }
}

/* Stripe Card Element (paiement carte réel) */
.stripe-card-input { padding: 13px 13px; min-height: 46px; display: flex; flex-direction: column; justify-content: center; }
.stripe-card-input.StripeElement--focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stripe-card-input.StripeElement--invalid { border-color: #c0392b; }
.stripe-card-error { color: #c0392b; font-size: 12.5px; margin-top: 6px; min-height: 16px; }

/* chart bars (reusable) */
.chartbars { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.chartbars .cb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.chartbars .cb .bar { width: 100%; max-width: 38px; background: var(--accent-soft); border-radius: 6px 6px 0 0; position: relative; overflow: hidden; }
.chartbars .cb .bar i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--accent); border-radius: 6px 6px 0 0; }
.chartbars .cb .lb { font-size: 11px; color: var(--ink-3); }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { width: 132px; height: 132px; flex: none; }
.legend { display: flex; flex-direction: column; gap: 12px; }
.legend .lg { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.legend .lg i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend .lg b { color: var(--ink); margin-left: auto; padding-left: 16px; font-family: var(--mono); font-size: 13px; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid; }
.alert .ai { flex: none; }
.alert.warm { background: var(--warm-soft); border-color: color-mix(in srgb, var(--warm) 25%, transparent); color: var(--warm); }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.alert.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent-press); }
.alert .at { font-weight: 700; font-size: 13.5px; }
.alert .as { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.side-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 43, .45);
  z-index: 85;
  backdrop-filter: blur(2px);
}
.side-backdrop.open { display: block; }
body.side-open { overflow: hidden; }

.equip-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.equip-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
  line-height: 1.2;
}
.equip-chip:hover { border-color: var(--accent); color: var(--ink); }
.equip-chip.on {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent-press);
}
.equip-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.side-logout { margin-top: 12px; }
.side-logout .logout-btn {
  width: 100%;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- Panier global (réservation en cours) ---------- */
.global-cart-toggle {
  position: relative;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-press);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .14s;
  flex: none;
}
.global-cart-toggle:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent)); color: var(--ink); }
  .global-cart-toggle .gc-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 1080px) {
  .global-cart-toggle span:not(.gc-count) { display: none; }
  .global-cart-toggle { padding: 8px 10px; }
}
.global-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 43, .35);
  backdrop-filter: blur(2px);
  z-index: 1990;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.global-cart-backdrop.open { opacity: 1; pointer-events: auto; }
.global-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-xl);
  z-index: 1995;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.global-cart-drawer.open { transform: translateX(0); }
.global-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-2);
}
.global-cart-head h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin: 0;
}
.global-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.global-cart-space {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
}
.global-cart-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.global-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  margin-bottom: 4px;
}
.global-cart-total .v {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}
.global-cart-login-hint {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
  margin-top: 4px;
}

@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    z-index: 90;
    transition: left .22s ease;
    box-shadow: var(--sh-xl);
  }
  .side.open { left: 0; }
  .col-main { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-app { padding: 0 16px; gap: 10px; }
  .topbar-app h1 {
    font-size: 18px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tb-search { display: none; }
  .view { padding: 20px 16px; }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 18px;
  }
  .page-head .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .row-actions { flex-wrap: wrap; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .topbar-app { height: 56px; }
  .topbar-app h1 { font-size: 16px; }
  .tb-icon.hide-mobile,
  .tb-av.hide-mobile { display: none !important; }
  .grid-4 { grid-template-columns: 1fr; }
  .stat .sv { font-size: 26px; }
  .view { padding: 16px 14px; }
  .card-pad { padding: 16px; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .lrow {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 10px;
  }
  .lrow .thumb {
    width: 58px;
    height: 58px;
    border-radius: 10px;
  }
  .lrow .lt {
    font-size: 14px;
    line-height: 1.3;
  }
  .lrow .row-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .lrow .ls { font-size: 12.5px; }
  .tabs { flex-wrap: wrap; width: 100%; }
  .weeknav { width: 100%; justify-content: space-between; }
  .weeknav button { flex: 1; justify-content: center; }
  .avail-filter { flex-direction: column; align-items: stretch; }
  .modal-back { padding: 12px; align-items: flex-end; }
  .modal {
    max-height: calc(100dvh - 24px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; min-width: 120px; }
  .card:has(.tbl) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 520px; }
  .tbl th, .tbl td { padding-left: 14px; padding-right: 14px; }
  .wcal { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wcal-grid { min-width: 640px; }
  .copylink { flex-wrap: wrap; padding: 10px 12px; }
  .copylink .btn { width: 100%; }
}

/* Sélecteur d'espace actif (multi-rôles) */
.portal-switch-wrap {
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 12px;
}
.portal-switch-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.portal-switch-select {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--body);
}
.portal-switch-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.portal-switch-hint {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-3);
}
