/* ============================================================
   The Regular — DÉMO investisseurs
   Palettes, polices, composants repris à l'identique de l'app
   mobile (apps/client/src/theme.tsx + ui/*). Thème clair/sombre.
   ============================================================ */

/* ---------- Palette claire (lightColors) ---------- */
:root, [data-theme="light"] {
  --primary: #B5452F;
  --primary-dark: #8F3424;
  --primary-bg: #F8E9E4;
  --bg: #FAF6F1;
  --card: #FFFFFF;
  --text: #241B16;
  --text-muted: #8A7E76;
  --border: #E8DFD7;
  --success: #2E7D4F;
  --success-bg: #E8F4EC;
  --danger: #C0392B;
  --danger-bg: #FBEAE7;
  --shadow-sm: 0 1px 3px rgba(31, 22, 17, 0.08);
  --shadow-md: 0 6px 16px rgba(31, 22, 17, 0.12);
}

/* ---------- Palette sombre (darkColors) ---------- */
[data-theme="dark"] {
  --primary: #D9694F;
  --primary-dark: #B5452F;
  --primary-bg: #2C1C15;
  --bg: #16110E;
  --card: #221A15;
  --text: #F2EAE3;
  --text-muted: #A2938A;
  --border: #382C24;
  --success: #4CAF7D;
  --success-bg: #16291F;
  --danger: #E0705F;
  --danger-bg: #2C1815;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(181,69,47,0.06) 0%, transparent 55%),
    radial-gradient(900px 700px at 100% 0%, rgba(122,46,107,0.06) 0%, transparent 50%),
    #EFE7DE;
  color: #241B16;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[data-page-theme="dark"] body { background: #0E0A08; color: #F2EAE3; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.ic-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; fill: currentColor; stroke: none; flex-shrink: 0; pointer-events: none; }
.ic-svg .ionicon-fill-none { fill: none; stroke: currentColor; }
.ic-svg .ionicon-stroke-width { stroke-width: 32px; }

/* ---------- Mise en page : chrome démo + téléphone ---------- */
.stage {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem;
  align-items: start;
}
@media (max-width: 920px) {
  .stage { grid-template-columns: 1fr; }
  .sidebar { position: static !important; }
}

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 2rem; }
[data-page-theme="dark"] .sidebar { color: #F2EAE3; }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-family: "Fraunces", Georgia, serif; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.brand-tag { color: #8A7E76; font-size: 0.9rem; margin: 0.2rem 0 1.3rem 0.1rem; }
[data-page-theme="dark"] .brand-tag { color: #A2938A; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: #241B16; color: #fff; font-size: 0.7rem; font-weight: 600;
  padding: 0.3rem 0.75rem; border-radius: 999px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1.3rem;
}
.demo-badge i { width: 7px; height: 7px; border-radius: 50%; background: #4CAF7D; display: inline-block; }

.side-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: #8A7E76; font-weight: 700; margin-bottom: 0.7rem; }
[data-page-theme="dark"] .side-label { color: #A2938A; }
.profiles { display: flex; flex-direction: column; gap: 0.55rem; }
.profile-btn {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.8rem 0.9rem; border-radius: 16px;
  background: #fff; border: 1.5px solid #E8DFD7; text-align: left;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
[data-page-theme="dark"] .profile-btn { background: #221A15; border-color: #382C24; }
.profile-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.profile-btn.active { border-color: #B5452F; box-shadow: 0 0 0 3px rgba(181,69,47,.14); }
.profile-ico { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.profile-ico .ic-svg { font-size: 20px; }
.profile-txt b { display: block; font-size: 0.95rem; }
.profile-txt span { font-size: 0.78rem; color: #8A7E76; }
[data-page-theme="dark"] .profile-txt span { color: #A2938A; }

.theme-seg { display: flex; gap: 0.4rem; margin-top: 1.3rem; }
.theme-seg button {
  flex: 1; padding: 0.5rem; border-radius: 10px; font-size: 0.82rem; font-weight: 600;
  border: 1.5px solid #B5452F; color: #B5452F; background: transparent;
}
.theme-seg button.active { background: #B5452F; color: #fff; }

.side-fs {
  margin-top: 1rem; width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1rem; border-radius: 12px; background: #241B16; color: #fff; font-weight: 600; font-size: 0.9rem;
  transition: transform .15s, filter .15s;
}
.side-fs:hover { transform: translateY(-1px); filter: brightness(1.15); }
.side-fs .ic-svg { font-size: 18px; }
[data-page-theme="dark"] .side-fs { background: #D9694F; }

/* ---------- Mode plein écran (app-like) ---------- */
.fs-exit {
  display: none; position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2000;
  width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 20px; line-height: 1; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
body.appmode { overflow: hidden; }
body.appmode .stage { display: block; padding: 0; max-width: none; margin: 0; }
body.appmode .sidebar { display: none; }
body.appmode .phone-wrap { position: fixed; inset: 0; z-index: 1500; }
body.appmode .phone {
  width: 100%; height: 100%; max-width: none; border: none; border-radius: 0; box-shadow: none;
}
body.appmode .phone__notch { display: none; }
body.appmode .statusbar { padding-top: max(0.4rem, env(safe-area-inset-top)); }
body.appmode .tabbar { padding-bottom: max(0.4rem, env(safe-area-inset-bottom)); }
body.appmode .fs-exit { display: flex; }
/* Grand écran (desktop) : garder une forme de téléphone centrée sur fond sombre. */
@media (min-width: 640px) {
  body.appmode .phone-wrap { background: #0b0908; display: flex; align-items: center; justify-content: center; }
  body.appmode .phone { width: 400px; height: min(880px, 96vh); border-radius: 38px; border: 11px solid #0f0d0c; }
  body.appmode .phone__notch { display: block; }
}

.side-note {
  margin-top: 1.3rem; padding: 0.9rem 1rem; border-radius: 14px;
  background: rgba(255,255,255,0.6); border: 1px dashed #D8CFC5; font-size: 0.8rem; color: #6b6058; line-height: 1.5;
}
[data-page-theme="dark"] .side-note { background: rgba(34,26,21,0.6); border-color: #382C24; color: #A2938A; }
.side-note b { color: #241B16; }
[data-page-theme="dark"] .side-note b { color: #F2EAE3; }

/* ---------- Cadre téléphone ---------- */
.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 390px; max-width: 100%; height: 812px;
  background: var(--bg); border-radius: 46px; border: 12px solid #0f0d0c;
  box-shadow: 0 30px 80px rgba(20,14,10,0.35);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.phone__notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 150px; height: 26px; background: #0f0d0c; border-radius: 0 0 18px 18px; z-index: 60; }
.statusbar { height: 46px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 1.7rem 0.4rem; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.statusbar .sb-r { display: flex; gap: 6px; align-items: center; font-size: 0.9rem; }

.screen { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--bg); }
.screen::-webkit-scrollbar { width: 0; }
.pad { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Barre d'onglets (SwipeTabs, position bottom) ---------- */
.tabbar { flex-shrink: 0; display: flex; background: var(--card); border-top: 1px solid var(--border); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 8px; position: relative; color: var(--text-muted); }
.tab .ic-svg { font-size: 22px; }
.tab span { font-size: 11px; font-weight: 600; }
.tab .badge { position: absolute; top: 2px; right: 50%; margin-right: -22px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--success); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.tab.active { color: var(--primary); }
.tab.active::before { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 2px; background: var(--primary); }

/* ---------- Typo ---------- */
.title { font-family: "Fraunces", Georgia, serif; font-size: 26px; line-height: 30px; letter-spacing: -0.4px; color: var(--text); font-weight: 700; }
.subtitle { font-size: 14px; line-height: 20px; color: var(--text-muted); }

/* ---------- Card / MenuGroup ---------- */
.card { background: var(--card); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card-title { font-weight: 700; font-size: 16px; color: var(--text); }
.menu-group { background: var(--card); border-radius: 18px; border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm); }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.menu-row + .menu-row { border-top: 1px solid var(--border); }
.menu-row > .ic-svg:first-child { font-size: 22px; color: var(--text); }
.menu-row.danger > .ic-svg:first-child, .menu-row.danger .mr-label { color: var(--danger); }
.mr-body { flex: 1; min-width: 0; }
.mr-label { font-size: 15px; font-weight: 600; color: var(--text); }
.mr-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.mr-right { margin-left: auto; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mr-right .ic-svg { font-size: 18px; }

/* ---------- Boutons ---------- */
.btn { border-radius: 14px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: 0.2px; background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); width: 100%; transition: transform .12s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn .ic-svg { font-size: 18px; }
.btn.secondary { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); box-shadow: none; }
.btn.danger { background: var(--danger); }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; letter-spacing: 0.3px; color: var(--text-muted); }
.input { background: var(--card); border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 12px; font-size: 16px; color: var(--text); width: 100%; }
.input::placeholder { color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--primary); }

/* Boîtes succès / erreur */
.successbox { background: var(--success-bg); border-radius: 12px; padding: 12px; color: var(--success); font-size: 14px; font-weight: 600; }
.errorbox { background: var(--danger-bg); border-radius: 12px; padding: 12px; color: var(--danger); font-size: 14px; }

/* ---------- Pills (chips de tri / onglets détail / toggles) ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 16px; border: 1.5px solid var(--primary); background: transparent; color: var(--primary); font-size: 13px; font-weight: 600; }
.pill .ic-svg { font-size: 14px; }
.pill.on { background: var(--primary); color: #fff; }
.pill.soft { border-width: 1px; border-color: var(--border); background: var(--card); color: var(--text); }
.pill.soft .ic-svg { color: var(--text-muted); }
.pill.soft.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.pill.soft.on .ic-svg { color: #fff; }
.tabs-row { display: flex; gap: 8px; }
.tabs-row .pill { flex: 1; justify-content: center; padding: 9px 6px; }
.seg-row { display: flex; gap: 8px; }
.seg-row .pill { flex: 1; justify-content: center; padding: 10px; }

.select-pill { -webkit-appearance: none; appearance: none; font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.select-pill.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.select-pill option { color: #241B16; background: #fff; }

.archive-toggle { display: flex; align-items: center; gap: 6px; padding: 8px 0; color: var(--text-muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.archive-toggle .ic-svg { font-size: 16px; }

.rate-row { display: inline-flex; gap: 4px; }
.rate-star { padding: 2px; color: #F5A623; }
.rate-star .ic-svg { font-size: 26px; }
.btn.disabled { pointer-events: none; }

.hscroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.hscroll::-webkit-scrollbar { height: 0; }
.hscroll .pill, .hscroll .chip { flex-shrink: 0; white-space: nowrap; }

/* ---------- Carte de fidélité (LoyaltyCardView) ---------- */
.loyalty-wrap { border-radius: 18px; box-shadow: var(--shadow-md); position: relative; }
.loyalty { border-radius: 18px; border: 1px solid var(--border); overflow: hidden; position: relative; cursor: pointer; }
.loyalty .lc-content { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.lc-estab { font-size: 13px; font-weight: 600; letter-spacing: 0.2px; opacity: 0.85; }
.lc-name { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 20px; letter-spacing: -0.3px; }
.lc-progress { font-size: 13px; font-weight: 600; opacity: 0.9; }
.lc-points-val { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 34px; }
.lc-points-sub { font-size: 13px; font-weight: 600; opacity: 0.9; }
.lc-cashback-badge { align-self: flex-start; padding: 5px 10px; border-radius: 999px; }
.lc-cashback-badge span { color: #fff; font-size: 12px; font-weight: 700; }

/* pastilles overlay */
.lc-rating { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,0.55); }
.lc-rating .ic-svg { color: #F5A623; font-size: 12px; }
.lc-rating span { color: #fff; font-size: 11px; font-weight: 700; }
.lc-status { position: absolute; bottom: 8px; right: 8px; display: flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,0.55); }
.lc-status i { width: 8px; height: 8px; border-radius: 4px; }
.lc-status span { color: #fff; font-size: 11px; font-weight: 700; }
.lc-promo { align-self: flex-start; background: rgba(0,0,0,0.55); padding: 5px 10px; border-radius: 999px; }
.lc-promo span { color: #fff; font-size: 12px; font-weight: 700; }

/* grille de tampons */
.dots { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dots-row { display: flex; gap: 8px; justify-content: center; }
.dot { width: 34px; height: 34px; border-radius: 50%; border-width: 2.5px; border-style: solid; display: grid; place-items: center; position: relative; font-size: 16px; }
.dot.filled { color: #fff; }
.dot .reward-float { position: absolute; top: -14px; right: -7px; font-size: 20px; }

.fav-star { position: absolute; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,0.35); display: grid; place-items: center; z-index: 3; }
.fav-star .ic-svg { color: #F5A623; font-size: 18px; }

.below-line { display: flex; align-items: center; gap: 4px; }
.below-line .ic-svg { font-size: 13px; color: var(--text-muted); }
.below-line span { color: var(--text-muted); font-size: 13px; }
.below-line.success .ic-svg { color: var(--success); font-size: 15px; }
.below-line.success span { color: var(--success); font-weight: 700; }
.archive-link { display: flex; align-items: center; gap: 5px; align-self: flex-end; color: var(--text-muted); font-size: 14px; }
.archive-link .ic-svg { font-size: 15px; }

/* ---------- Récompenses (RewardsList) ---------- */
.reward-item { display: flex; align-items: center; gap: 12px; }
.reward-badge { width: 38px; height: 38px; border-radius: 19px; display: grid; place-items: center; font-weight: 700; font-size: 14px; border: 1.5px solid var(--primary); color: var(--primary); flex-shrink: 0; }
.reward-badge.done { background: var(--success); border: none; color: #fff; font-size: 18px; }
.reward-badge.ready { background: var(--primary); border: none; color: #fff; }
.reward-body { flex: 1; }
.reward-body .rlabel { font-weight: 600; font-size: 15px; color: var(--text); }
.reward-state { font-size: 13px; margin-top: 4px; }
.reward-state.ready { color: var(--primary); font-weight: 700; }
.reward-state.done { color: var(--success); font-weight: 600; }
.reward-state.todo { color: var(--text-muted); }
.rbar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 4px; }
.rbar > i { display: block; height: 100%; background: var(--primary); }

/* ---------- Menu (MenuView) ---------- */
.menu-head { display: flex; align-items: center; gap: 10px; }
.menu-head .mh-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-bg); display: grid; place-items: center; }
.menu-head .mh-ic .ic-svg { color: var(--primary); font-size: 18px; }
.menu-head b { font-size: 17px; font-weight: 800; color: var(--text); }
.menu-head .mh-sub { color: var(--text-muted); font-size: 12px; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-top: 12px; margin-bottom: 2px; }
.cat-head span { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--primary); text-transform: uppercase; }
.cat-head i { flex: 1; height: 1px; background: var(--border); }
.mitem { display: flex; gap: 12px; padding: 11px 0; align-items: center; }
.mitem + .mitem { border-top: 1px solid var(--border); }
.mitem .mi-photo { width: 64px; height: 64px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; font-size: 30px; flex-shrink: 0; }
.mi-body { flex: 1; }
.mi-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mi-name { font-weight: 700; font-size: 15px; color: var(--text); flex: 1; }
.mi-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.mi-old { color: var(--text-muted); font-size: 12px; text-decoration: line-through; }
.mi-cur { font-weight: 800; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 5px; }
.mi-cur.promo { color: var(--primary); }
.mi-badge { color: #fff; background: var(--primary); font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 7px; }

/* ---------- Horaires (OpeningHoursView) ---------- */
.hours-head { display: flex; align-items: center; gap: 8px; }
.hours-head .ic-svg { color: var(--primary); font-size: 18px; }
.hours-head b { font-weight: 700; font-size: 16px; color: var(--text); }
.status-pill { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; }
.status-pill i { width: 8px; height: 8px; border-radius: 4px; }
.status-pill span { font-weight: 700; font-size: 13px; }
.status-pill.open { background: var(--success-bg); } .status-pill.open i { background: var(--success); } .status-pill.open span { color: var(--success); }
.status-pill.closed { background: var(--danger-bg); } .status-pill.closed i { background: var(--danger); } .status-pill.closed span { color: var(--danger); }
.hrow { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 8px; }
.hrow + .hrow { border-top: 1px solid var(--border); }
.hrow.today { background: var(--bg); }
.hrow .hday { font-size: 14px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.hrow.today .hday, .hrow.today .htime { font-weight: 700; }
.hrow .today-tag { font-size: 11px; font-weight: 700; color: var(--primary); }
.hrow .htime { font-size: 14px; font-weight: 500; color: var(--text); }
.hrow .htime.closed { color: var(--text-muted); }

/* ---------- Avis (ReviewsView) ---------- */
.rev-sum { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.rev-sum .big { font-size: 22px; font-weight: 800; color: var(--text); }
.stars { display: inline-flex; gap: 2px; }
.stars .ic-svg { color: #F5A623; font-size: 15px; }
.review { padding: 12px 0; }
.review + .review { border-top: 1px solid var(--border); }
.rev-top { display: flex; align-items: center; justify-content: space-between; }
.rev-meta { color: var(--text-muted); font-size: 12px; }
.rev-sub { display: flex; gap: 16px; color: var(--text-muted); font-size: 12px; margin: 6px 0; }
.rev-dish { display: flex; align-items: center; gap: 5px; color: var(--text); font-size: 13px; font-weight: 600; }
.rev-dish .ic-svg { color: var(--primary); font-size: 13px; }
.rev-comment { color: var(--text); font-size: 14px; margin-top: 4px; }
.rev-reply { margin: 6px 0 0 12px; padding-left: 12px; border-left: 2px solid var(--primary); }
.rev-reply .rr-head { display: flex; align-items: center; gap: 5px; color: var(--primary); font-size: 12px; font-weight: 700; }
.rev-reply .rr-head .ic-svg { font-size: 13px; }
.rev-reply p { color: var(--text); font-size: 14px; margin-top: 3px; }

/* ---------- Historique ---------- */
.hist-row { display: flex; align-items: center; justify-content: space-between; }
.hist-l { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.hist-l .ic-svg { font-size: 16px; }
.hist-when { color: var(--text-muted); font-size: 13px; }

/* ---------- Localisation ---------- */
.loc-map { height: 150px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; position: relative; background:
  repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 26px),
  repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 26px),
  linear-gradient(135deg, #cfe3d0, #bcd6c9); }
.loc-map .pin { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-100%); font-size: 30px; }

/* ---------- QR ---------- */
.qr-box { align-self: center; align-items: center; display: flex; flex-direction: column; gap: 12px; background: #fff; border-radius: 20px; border: 1px solid var(--border); padding: 24px; }
.qr-svg { width: 232px; height: 232px; display: block; }
.qr-count { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.qr-expand { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 13px; }
.qr-expand .ic-svg { font-size: 14px; }

/* ---------- Stats (Stat) ---------- */
.stats-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1; min-width: 44%; background: var(--card); border-radius: 18px; border: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow-sm); }
.stat .sv { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 28px; color: var(--primary); }
.stat .sl { font-size: 13px; color: var(--text-muted); text-align: center; }

/* ---------- Dashboard : segments / heatmap / trend ---------- */
.seg-line { display: flex; align-items: center; gap: 8px; }
.seg-line .sname { width: 104px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.seg-line .sname i { width: 9px; height: 9px; border-radius: 5px; }
.seg-bar { flex: 1; height: 18px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.seg-bar > i { display: block; height: 100%; border-radius: 5px; }
.seg-line .scount { width: 32px; text-align: right; font-size: 13px; color: var(--text); }
.heat { display: flex; flex-direction: column; gap: 2px; }
.heat-row { display: flex; align-items: center; gap: 2px; }
.heat-row .hd { width: 26px; font-size: 10px; color: var(--text-muted); }
.heat-cell { flex: 1; height: 12px; border-radius: 2px; background: var(--primary); }
.heat-x { display: flex; justify-content: space-between; margin-top: 2px; }
.heat-x span { font-size: 10px; color: var(--text-muted); }
.trend { display: flex; align-items: flex-end; gap: 1px; height: 56px; margin-top: 2px; }
.trend > i { flex: 1; background: var(--primary); border-radius: 2px; }

/* ---------- Scanner (caméra) ---------- */
.camera { min-height: 300px; flex: 1; border-radius: 16px; overflow: hidden; background: #000; position: relative; display: grid; place-items: center; margin: 4px 0; }
.scan-frame { width: 62%; aspect-ratio: 1; border-radius: 18px; position: relative; }
.scan-frame::before, .scan-frame::after, .scan-frame > i::before, .scan-frame > i::after { content: ''; position: absolute; width: 32px; height: 32px; border: 4px solid var(--primary); }
.scan-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 12px 0 0 0; }
.scan-frame::after { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 12px 0 0; }
.scan-frame > i::before { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 12px; }
.scan-frame > i::after { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 12px 0; }
.scan-line { position: absolute; left: 8%; right: 8%; height: 3px; background: var(--primary); box-shadow: 0 0 14px var(--primary); border-radius: 3px; animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0%,100% { top: 16%; } 50% { top: 82%; } }
.scan-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.88); display: none; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; gap: 10px; padding: 24px; }
.scan-overlay.show { display: flex; animation: pop .3s; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.scan-check { width: 88px; height: 88px; border-radius: 50%; background: var(--success); display: grid; place-items: center; }
.scan-check .ic-svg { font-size: 46px; color: #fff; }

/* toggle switch (profil) */
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--primary); position: relative; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.switch.off { background: var(--border); }
.switch.off::after { right: auto; left: 3px; }

.foot { text-align: center; color: var(--text-muted); font-size: 12px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; text-align: center; }
.empty .ic-svg { font-size: 34px; color: var(--text-muted); }
.empty span { color: var(--text-muted); font-size: 14px; }
