/* ══════════════════════════════════════════════════════════════════════════
   MyKollectOr® — css/dashboard.css   v1.2
   Styles : dashboard.html, profil.html, strava.html, boutique.html
   Tokens : Design System sombre (mykollector_design-sombre.html uploadé)
   Desktop-first pour dashboard — PWA portrait pour chrono
   ══════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* ── Couleurs — Design System MKO (sombre) ── */
  --gold:     #c8a84b;
  --gold2:    #e8c870;
  --or:       #c8a84b;
  --or2:      #e8c870;
  --ok:       #3ecf8e;
  --live:     #ff4f4f;
  --warn:     #f0b429;
  --blue:     #0e3e5f;
  --blue2:    #1a5580;
  --violet:   #7c5cbf;
  --violet2:  #a07ee0;
  --green:    #1db97a;
  --green2:   #27e89a;
  --strava:   #fc5200;

  /* ── Fonds ── */
  --bg:       #070f18;
  --bg2:      #0a1a28;
  --bg3:      #0f2438;
  --card:     #0d1e30;
  --sidebar:  rgba(6,13,20,.97);

  /* ── Texte ── */
  --text:     #ffffff;
  --dim:      rgba(255,255,255,.65);
  --clair:    rgba(255,255,255,.82);
  --white:    #ffffff;

  /* ── Bordures ── */
  --bord:     rgba(201,168,76,.28);
  --bord2:    rgba(255,255,255,.13);

  /* ── Ombres ── */
  --shadow-gold: 0 8px 32px rgba(200,168,75,.4);
  --shadow-card: 0 4px 20px rgba(0,0,0,.35);

  /* ── Espacements ── */
  --sp-xs: 4px;  --sp-sm: 8px;  --sp-md: 12px;
  --sp-lg: 16px; --sp-xl: 20px; --sp-2xl: 24px;
  --gap-section: 14px;

  /* ── Rayons ── */
  --r-sm: 8px; --r-md: 12px; --r-lg: 14px; --r-xl: 18px; --r-pill: 999px;

  /* ── Boutons ── */
  --btn-r: 14px; --btn-pad: 15px 20px;
  --btn-fs: .82rem; --btn-fw: 800; --btn-ls: .08em;
}

html { scroll-behavior: smooth; background: var(--bg); }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg2) 60%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── DESKTOP LAYOUT (dashboard) ──────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 260px;
  background: var(--sidebar);
  border-right: 1px solid var(--bord);
  display: flex; flex-direction: column;
  padding: 0;
  z-index: 100;
}
.sb-brand {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--bord);
  display: flex; align-items: center; gap: 10px;
}
.sb-brand .logo { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(200,168,75,.5)); }
.sb-brand .brand-name { font-size: .95rem; font-weight: 800; color: var(--gold); letter-spacing: .06em; }
.sb-brand .brand-tag { font-size: .44rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(201,168,76,.35); margin-top: 1px; }

.sb-user {
  padding: 14px 20px;
  border-bottom: 1px solid var(--bord);
}
.sb-user-name { font-size: .82rem; font-weight: 700; color: var(--text); }
.sb-user-id { font-family: 'Courier New', monospace; font-size: .6rem; color: var(--gold); opacity: .65; margin-top: 2px; }

.sb-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.sb-section-label {
  font-size: .44rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: rgba(201,168,76,.3);
  padding: 10px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  cursor: pointer; transition: all .2s;
  color: var(--dim); font-size: .75rem; font-weight: 600;
  border: 1px solid transparent;
  background: none; width: 100%; text-align: left;
  font-family: 'Montserrat', sans-serif;
  position: relative;
}
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-item.active { color: var(--gold); background: rgba(201,168,76,.1); border-color: rgba(201,168,76,.2); }
.nav-item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  font-size: .48rem; font-weight: 800;
  background: var(--live); color: #fff;
  padding: 2px 7px; border-radius: var(--r-pill);
}

.sb-bottom { padding: 14px 12px; border-top: 1px solid var(--bord); }

.main-content {
  margin-left: 260px;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 52px;
  background: rgba(7,15,24,.94); backdrop-filter: blur(18px);
 -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--bord);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.topbar-title { font-size: .9rem; font-weight: 700; color: var(--text); letter-spacing: .06em; }
.topbar-title em { color: var(--gold); font-style: normal; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page-content { padding: 24px 28px 40px; flex: 1; }
.page-title { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: .04em; margin-bottom: 20px; }
.page-title em { color: var(--gold); font-style: normal; }

/* ── SECTIONS / CARDS ─────────────────────────────────────────── */
.section {
  background: var(--card);
  border: 1px solid var(--bord);
  border-radius: var(--r-xl);
  padding: 18px;
  margin-bottom: var(--gap-section);
  box-shadow: var(--shadow-card);
}
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.section-title { font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.section-meta { font-size: .7rem; color: var(--dim); font-weight: 600; }

/* ── GRILLE DASHBOARD ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }

/* Stat cards */
.stat-card { background: var(--card); border: 1px solid var(--bord2); border-radius: var(--r-lg); padding: 16px 14px; }
.stat-val { font-size: 2rem; font-weight: 900; letter-spacing: .03em; color: var(--gold); font-family: 'Courier New', monospace; }
.stat-lbl { font-size: .52rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
.stat-trend { font-size: .62rem; font-weight: 600; color: var(--ok); margin-top: 5px; }

/* ── LISTE PARCOURS ───────────────────────────────────────────── */
.parcours-list { display: flex; flex-direction: column; gap: 10px; }
.parcours-item {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--bord2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer; transition: all .2s;
}
.parcours-item:hover { border-color: rgba(201,168,76,.35); background: rgba(255,255,255,.06); }
.parcours-row1 { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.parcours-name { flex: 1; font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: .01em; }
.parcours-time { font-family: 'Courier New', monospace; font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.parcours-row2 { display: flex; align-items: center; gap: 8px; font-size: .68rem; color: var(--dim); font-weight: 600; flex-wrap: wrap; }

/* ── BADGES ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: .58rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.badge-strava { background: rgba(252,82,0,.12); color: #ff7a3d; border: 1px solid rgba(252,82,0,.3); }
.badge-gps    { background: rgba(62,207,142,.1); color: var(--ok); border: 1px solid rgba(62,207,142,.25); }
.badge-info   { background: rgba(255,255,255,.06); color: var(--dim); border: 1px solid var(--bord2); }
.badge-warn   { background: rgba(240,180,41,.12); color: var(--warn); border: 1px solid rgba(240,180,41,.3); }
.badge-strava-confirm { background: rgba(74,180,232,.1); color: #4ab4e8; border: 1px solid rgba(74,180,232,.25); }

/* ── MEDAL STATUS ─────────────────────────────────────────────── */
.medal-status {
  margin-top: 9px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 11px; border-radius: var(--r-md);
  background: rgba(7,15,24,.5); border: 1px solid var(--bord2);
  font-size: .72rem; font-weight: 600; flex-wrap: wrap;
}
.medal-status .medal-label { color: var(--text); display: flex; align-items: center; gap: 6px; }
.medal-status.success { border-color: rgba(62,207,142,.3); }
.medal-status.success .medal-label { color: var(--green2); }
.medal-status.warn { border-color: rgba(240,180,41,.3); }
.medal-status.warn .medal-label { color: var(--warn); }
.medal-status.info { border-color: var(--bord); }
.medal-cta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: .64rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #07111c; border: none; cursor: pointer; transition: transform .2s;
}
.medal-cta.ghost { background: rgba(201,168,76,.1); color: var(--gold); border: 1px solid rgba(201,168,76,.3); }

/* ── VUE DÉTAIL ───────────────────────────────────────────────── */
.best-time-box {
  background: linear-gradient(160deg, rgba(201,168,76,.12), rgba(201,168,76,.04));
  border: 1px solid rgba(201,168,76,.35); border-radius: var(--r-xl);
  padding: 24px; text-align: center; margin-bottom: 14px;
}
.best-time-box .label { font-size: .58rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 9px; }
.best-time-box .time { font-family: 'Courier New', monospace; font-size: 3rem; font-weight: 900; color: var(--text); letter-spacing: -.02em; line-height: 1; margin-bottom: 8px; }
.best-time-box .meta { font-size: .75rem; color: var(--dim); font-weight: 600; }
.best-time-box .rank { margin-top: 8px; font-size: .82rem; font-weight: 700; color: var(--gold); }

.history-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.history-table th, .history-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--bord2); }
.history-table th { font-size: .56rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.history-table td { color: var(--text); }
.history-table .t-time { font-family: 'Courier New', monospace; color: var(--gold); font-weight: 700; }
.history-table tr.me td { background: rgba(201,168,76,.08); }

/* ── CLASSEMENT ───────────────────────────────────────────────── */
.ranking { display: flex; flex-direction: column; gap: 7px; }
.ranking-row {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 13px; background: rgba(255,255,255,.04);
  border: 1px solid var(--bord2); border-radius: var(--r-md); font-size: .8rem;
}
.ranking-row.me { border-color: rgba(201,168,76,.4); background: rgba(201,168,76,.07); }
.ranking-pos { font-weight: 800; color: var(--gold); }
.ranking-name { color: var(--text); font-weight: 600; }
.ranking-time { font-family: 'Courier New', monospace; color: var(--gold); font-weight: 700; }

/* ── NOTIFICATIONS ────────────────────────────────────────────── */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--bord2);
  cursor: pointer; transition: opacity .2s;
}
.notif-item:last-child { border: none; }
.notif-item.lu { opacity: .5; }
.notif-item:hover { opacity: 1; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 4px; }
.notif-dot.lu { background: transparent; border: 1.5px solid var(--bord2); }
.notif-title { font-size: .8rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.notif-msg { font-size: .68rem; color: var(--dim); line-height: 1.5; }
.notif-time { font-size: .58rem; color: var(--dim); margin-top: 4px; }

/* ── STRAVA ───────────────────────────────────────────────────── */
.strava-widget { display: flex; flex-direction: column; gap: 10px; }
.strava-status {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  background: rgba(252,82,0,.06); border: 1px solid rgba(252,82,0,.25); border-radius: var(--r-md);
}
.strava-status.disconnected { background: rgba(255,255,255,.04); border-color: var(--bord2); }
.strava-status .icon { font-size: 1.1rem; }
.strava-status .txt { flex: 1; font-size: .82rem; color: var(--text); }
.strava-status .txt .sub { font-size: .68rem; color: var(--dim); margin-top: 2px; }
.strava-alert {
  background: rgba(240,180,41,.08); border: 1px solid rgba(240,180,41,.35);
  border-radius: var(--r-md); padding: 13px;
  font-size: .78rem; color: var(--text);
}
.strava-alert .title { font-weight: 800; color: var(--warn); margin-bottom: 6px; }
.strava-alert .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── PROFIL ───────────────────────────────────────────────────── */
.profil-section { margin-bottom: 24px; }
.profil-section-title { font-size: .62rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.profil-alert-gravure {
  background: rgba(240,180,41,.08); border: 1px solid rgba(240,180,41,.35);
  border-radius: var(--r-md); padding: 11px 13px;
  font-size: .74rem; color: var(--warn); margin-bottom: 14px;
}
.profil-alert-gravure strong { color: var(--warn); }

/* ── BOUTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: var(--btn-pad);
  border: none; border-radius: var(--btn-r); cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: var(--btn-fs); font-weight: var(--btn-fw); letter-spacing: var(--btn-ls);
  text-transform: uppercase; transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #07111c; box-shadow: var(--shadow-gold); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(200,168,75,.5); }
.btn-secondary { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #ffffff; }
.btn-secondary:hover { background: rgba(255,255,255,.16); color: #ffffff; }
.btn-ghost { background: transparent; border: 1px solid var(--bord); color: var(--clair); }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-danger { background: rgba(255,79,79,.1); border: 1px solid rgba(255,79,79,.35); color: var(--live); }
.btn-strava { background: linear-gradient(135deg, #fc5200, #ff7a3d); color: #fff; box-shadow: 0 6px 20px rgba(252,82,0,.3); }
.btn-sm { padding: 9px 18px; font-size: .68rem; width: auto; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: var(--gap-section); }
.btn-row .btn { flex: 1; min-width: 140px; }

/* ── ICON BTN ─────────────────────────────────────────────────── */
.icon-btn {
  position: relative; width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); border: 1px solid var(--bord2);
  border-radius: var(--r-md); cursor: pointer; transition: all .2s; color: var(--text);
}
.icon-btn:hover { background: rgba(255,255,255,.13); border-color: rgba(201,168,76,.3); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 6px var(--live);
}

/* ── FORMULAIRES ──────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 12px 14px;
  background: rgba(7,15,24,.6); border: 1px solid var(--bord2);
  border-radius: var(--r-md); color: var(--text);
  font-family: 'Montserrat', sans-serif; font-size: .9rem; font-weight: 600;
  transition: border-color .2s, background .2s;
}
.form-input:focus { outline: none; border-color: var(--gold); background: rgba(7,15,24,.85); }
.form-input::placeholder { color: rgba(255,255,255,.3); }
.form-input:disabled, .form-input[readonly] { opacity: .6; cursor: not-allowed; }

/* Wrapper oeil mot de passe */
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--dim); transition: color .2s; display: flex; align-items: center;
}
.pw-eye:hover { color: var(--gold); }
.pw-eye svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.form-help { font-size: .66rem; color: var(--dim); margin-top: 4px; line-height: 1.5; }
.form-info { font-size: .7rem; color: var(--dim); background: rgba(255,255,255,.04); border: 1px solid var(--bord2); border-radius: var(--r-md); padding: 10px 12px; margin-top: 8px; line-height: 1.55; }
.form-info strong { color: var(--gold); }

/* ── ALERTS ───────────────────────────────────────────────────── */
.alert { padding: 10px 13px; border-radius: var(--r-md); font-size: .76rem; margin: 10px 0; }
.alert-warn { background: rgba(240,180,41,.08); border: 1px solid rgba(240,180,41,.4); color: var(--warn); }
.alert-error { background: rgba(255,79,79,.1); border: 1px solid rgba(255,79,79,.4); color: var(--live); }
.alert-success { background: rgba(62,207,142,.08); border: 1px solid rgba(62,207,142,.4); color: var(--ok); }

/* ── SPINNER ──────────────────────────────────────────────────── */
.spinner { width: 28px; height: 28px; border: 3px solid rgba(201,168,76,.2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px; color: var(--dim); font-size: .78rem; }
.empty-state { text-align: center; padding: 22px; color: var(--dim); font-size: .82rem; }
.empty-state .icon { font-size: 2rem; opacity: .5; margin-bottom: 8px; }

/* ── MODAL ────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(7,15,24,.88); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.active { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--bord); border-radius: var(--r-xl); padding: 24px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.modal p { color: var(--clair); font-size: .85rem; line-height: 1.55; margin-bottom: 12px; }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast-host { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 380px; padding: 12px 18px; background: var(--bg3); border: 1px solid var(--bord); border-radius: var(--r-md); color: var(--text); font-size: .8rem; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: toastIn .3s ease-out; }
.toast.error   { border-color: rgba(255,79,79,.5); }
.toast.success { border-color: rgba(62,207,142,.5); }
@keyframes toastIn { from { opacity:0; transform:translateX(12px); } to { opacity:1; transform:translateX(0); } }

/* ── LIGNES DORÉES ────────────────────────────────────────────── */
.gold-line-top, .gold-line-bot {
  position: fixed; left: 0; right: 0; height: 2px; z-index: 200;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold2) 50%, var(--gold) 70%, transparent);
  pointer-events: none;
}
.gold-line-top { top: 0; }
.gold-line-bot { bottom: 0; }

/* ── UTILS ────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: .8rem; font-weight: 600; text-decoration: none; padding: 6px 0; }
.back-link:hover { color: var(--gold); }
.flex-row { display: flex; gap: 8px; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }


}

/* ══ MOBILE (< 860px) ═══════════════════════════════════════════
   App-like : header fixe + 3 onglets + contenu
════════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {

  /* Masquer layout desktop */
  .dashboard-layout { display: block; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .topbar { display: none; }

  /* Masquer vues desktop inutiles sur mobile */
  #view-saisie-desktop,
  #view-strava,
  #view-profil { display: none !important; }

  /* ── HEADER MOBILE ── */
  .m-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    background: var(--sidebar); border-bottom: 1px solid var(--bord);
    padding: 10px 16px 0;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .m-header-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .m-hero {
    display: flex; align-items: center; gap: 10px;
  }
  .m-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg3); border: 2px solid var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 800; color: var(--gold);
    flex-shrink: 0;
  }
  .m-username { font-size: .88rem; font-weight: 700; color: var(--text); }
  .m-userid   { font-size: .56rem; color: var(--gold); opacity: .65; margin-top: 1px; font-family: 'Courier New', monospace; }
  .m-settings-btn {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,.07); border: 1px solid var(--bord2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s; color: var(--dim);
  }
  .m-settings-btn:hover { border-color: rgba(200,168,75,.3); color: var(--gold); }
  .m-settings-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

  /* ── ONGLETS MOBILE ── */
  .m-tabs {
    display: flex; border-bottom: 1px solid var(--bord2);
  }
  .m-tab {
    flex: 1; padding: 9px 4px; text-align: center; cursor: pointer;
    font-size: .65rem; font-weight: 700; letter-spacing: .05em;
    color: var(--dim); border: none; border-bottom: 2px solid transparent;
    background: none; font-family: 'Montserrat', sans-serif;
    transition: all .2s; position: relative;
  }
  .m-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
  .m-tab .m-tab-badge {
    position: absolute; top: 5px; right: 8px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--live); display: none;
  }
  .m-tab .m-tab-badge.on { display: block; }

  /* ── CONTENU MOBILE ── */
  .m-content {
    padding-top: calc(88px + max(0px, env(safe-area-inset-top)));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    min-height: 100vh;
  }
  .m-panel { display: none; }
  .m-panel.active { display: block; }

  /* ── PANEL : À VALIDER ── */
  .m-valider-scroll {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 4px;
    scrollbar-width: none;
  }
  .m-valider-scroll::-webkit-scrollbar { display: none; }
  .m-valider-card {
    min-width: 280px; max-width: 300px; flex-shrink: 0;
    scroll-snap-align: start;
    background: var(--card); border: 1px solid rgba(62,207,142,.2);
    border-left: 3px solid var(--ok);
    border-radius: 14px; padding: 16px;
    display: flex; flex-direction: column; gap: 11px;
  }
  .m-valider-name { font-size: .95rem; font-weight: 800; color: var(--text); }
  .m-valider-meta { font-size: .65rem; color: var(--dim); }
  .m-valider-time {
    font-family: 'Courier New', monospace; font-size: 2rem;
    font-weight: 900; color: var(--gold); text-align: center;
    padding: 12px; background: rgba(200,168,75,.06);
    border: 1px solid rgba(200,168,75,.12); border-radius: 10px;
  }
  .m-valider-dots {
    display: flex; gap: 5px; justify-content: center; margin-top: 2px;
  }
  .m-valider-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: rgba(255,255,255,.15); transition: all .25s;
  }
  .m-valider-dot.on { background: var(--gold); width: 14px; border-radius: 3px; }
  .m-valider-empty {
    margin: 24px 16px; padding: 28px 16px;
    text-align: center; color: var(--dim); font-size: .8rem; line-height: 2;
    background: var(--card); border: 1px solid var(--bord2); border-radius: 14px;
  }
  .m-valider-empty .icon { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .5; }

  /* ── PANEL : SAISIE MANUELLE ── */
  .m-saisie-wrap { padding: 16px; }
  .m-saisie-drum {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
    margin-bottom: 16px;
  }
  .m-drum-unit input {
    width: 100%; padding: 14px 4px; text-align: center;
    background: var(--bg3); border: 2px solid var(--bord2);
    border-radius: 12px; color: var(--gold);
    font-family: 'Courier New', monospace; font-size: 2rem; font-weight: 900;
    outline: none; transition: border-color .2s;
    -webkit-appearance: none; appearance: none;
  }
  .m-drum-unit input:focus { border-color: var(--gold); }
  .m-drum-lbl {
    text-align: center; font-size: .5rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--dim); margin-top: 5px;
  }
  .m-saisie-field { margin-bottom: 12px; }
  .m-saisie-field label {
    display: block; font-size: .58rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--dim); margin-bottom: 6px;
  }
  .m-saisie-field select,
  .m-saisie-field input[type="date"] {
    width: 100%; padding: 12px 14px;
    background: var(--bg3); border: 1px solid var(--bord2);
    border-radius: 11px; color: var(--text);
    font-family: 'Montserrat', sans-serif; font-size: .88rem;
    outline: none; transition: border-color .2s;
  }
  .m-saisie-field select:focus,
  .m-saisie-field input[type="date"]:focus { border-color: var(--gold); }

  /* ── PANEL : HISTORIQUE ── */
  .m-hist-list { padding: 8px 0; }
  .m-hist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--bord2);
    cursor: pointer; transition: background .2s;
  }
  .m-hist-item:active { background: rgba(200,168,75,.05); }
  .m-hist-info { flex: 1; min-width: 0; }
  .m-hist-name { font-size: .82rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-hist-meta { font-size: .62rem; color: var(--dim); margin-top: 2px; }
  .m-hist-right { text-align: right; flex-shrink: 0; }
  .m-hist-time { font-family: 'Courier New', monospace; font-size: .88rem; font-weight: 700; color: var(--gold); }
  .m-hist-source { font-size: .5rem; color: var(--dim); margin-top: 2px; }


  /* ── POPUP VALIDATION CHRONOS ── */
  .m-popup-overlay {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(0,0,0,.75); backdrop-filter: blur(10px);
 -webkit-backdrop-filter: blur(10px);
    display: none; align-items: flex-end; justify-content: center;
    padding: 0 0 max(16px, env(safe-area-inset-bottom));
  }
  .m-popup-overlay.open { display: flex; }
  .m-popup-sheet {
    width: 100%; max-width: 420px; margin: 0 12px;
    background: var(--bg2); border: 1px solid var(--bord);
    border-radius: 20px 20px 16px 16px;
    padding: 20px 0 16px;
    animation: slideUp .32s cubic-bezier(.34,1.56,.64,1);
  }
  @keyframes slideUp {
    0%  { transform: translateY(60px); opacity: 0; }
    100%{ transform: translateY(0);    opacity: 1; }
  }
  .m-popup-drag {
    width: 32px; height: 3px; border-radius: 2px;
    background: var(--bord2); margin: 0 auto 16px;
  }
  .m-popup-title {
    font-size: 1rem; font-weight: 800; color: var(--text);
    text-align: center; margin-bottom: 3px; padding: 0 20px;
  }
  .m-popup-sub {
    font-size: .7rem; color: var(--gold); font-weight: 700;
    letter-spacing: .08em; text-align: center; margin-bottom: 16px;
  }

  /* Cards scroll horizontal dans le popup */
  .m-popup-scroll {
    display: flex; gap: 11px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 4px; scrollbar-width: none;
  }
  .m-popup-scroll::-webkit-scrollbar { display: none; }
  .m-popup-card {
    min-width: calc(100% - 32px); flex-shrink: 0;
    scroll-snap-align: start;
    background: var(--card); border: 1px solid var(--bord2);
    border-radius: 14px; padding: 16px;
    transition: opacity .35s, transform .35s;
  }
  .m-popup-card.removing {
    opacity: 0; transform: scale(.95) translateY(8px);
  }
  .m-popup-card-name {
    font-size: .9rem; font-weight: 800; color: var(--text); margin-bottom: 3px;
  }
  .m-popup-card-meta { font-size: .62rem; color: var(--dim); margin-bottom: 12px; }
  .m-popup-time-display {
    font-family: 'Courier New', monospace; font-size: 2.2rem; font-weight: 900;
    color: var(--gold); text-align: center;
    padding: 12px; background: rgba(200,168,75,.07);
    border: 1px solid rgba(200,168,75,.14); border-radius: 11px;
    margin-bottom: 11px; letter-spacing: -.02em;
  }

  /* Drum-roller ajustement */
  .m-popup-adj-label {
    font-size: .52rem; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--dim); margin-bottom: 7px;
  }
  .m-popup-drums {
    display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  }
  .m-popup-drums input {
    width: 54px; padding: 8px 4px; text-align: center;
    background: var(--bg3); border: 1px solid var(--bord2);
    border-radius: 9px; color: var(--gold);
    font-family: 'Courier New', monospace; font-size: 1.1rem; font-weight: 700;
    outline: none; -webkit-appearance: none;
  }
  .m-popup-drums input:focus { border-color: var(--gold); }
  .m-popup-drums span { color: var(--dim); font-size: .8rem; font-weight: 600; }
  .m-popup-delta {
    font-size: .6rem; color: var(--ok); min-height: 14px; margin-bottom: 11px;
  }

  .m-popup-btn-valider {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    border: none; border-radius: 12px; cursor: pointer;
    font-family: 'Montserrat', sans-serif; font-size: .8rem;
    font-weight: 800; letter-spacing: .08em; color: #07111c;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: opacity .2s;
  }
  .m-popup-btn-valider:disabled { opacity: .55; cursor: not-allowed; }

  .m-popup-dots {
    display: flex; gap: 5px; justify-content: center; margin-top: 10px;
  }
  .m-popup-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: rgba(255,255,255,.14); transition: all .25s; cursor: pointer;
  }
  .m-popup-dot.on { background: var(--gold); width: 14px; border-radius: 3px; }

  /* Médailles panel */
  .m-medaille-card {
    background: var(--card); border: 1px solid var(--bord2);
    border-radius: 12px; padding: 14px 15px; margin: 0 0 9px;
  }
  .m-medaille-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .m-medaille-name { font-size: .85rem; font-weight: 700; color: var(--text); }
  .m-medaille-ref  { font-size: .58rem; color: var(--dim); margin-top: 2px; }
  .m-medaille-bot  { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  /* ── DRAWER PARAMÈTRES ── */
  .m-drawer-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,.65); backdrop-filter: blur(8px);
 -webkit-backdrop-filter: blur(8px);
    display: none;
  }
  .m-drawer-overlay.open { display: block; }
  .m-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 501;
    width: min(300px, 85vw);
    background: var(--sidebar); border-left: 1px solid var(--bord);
    padding: 20px 20px max(20px, env(safe-area-inset-bottom));
    padding-top: max(20px, env(safe-area-inset-top));
    display: flex; flex-direction: column; gap: 0;
    transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  }
  .m-drawer-overlay.open .m-drawer { transform: translateX(0); }
  .m-drawer-title { font-size: 1rem; font-weight: 800; color: var(--gold); margin-bottom: 20px; }
  .m-drawer-section { margin-bottom: 20px; }
  .m-drawer-section-title { font-size: .5rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(200,168,75,.4); margin-bottom: 10px; }
  .m-drawer-row { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--bord2); margin-bottom: 7px; }
  .m-drawer-row-info { flex: 1; }
  .m-drawer-row-name { font-size: .8rem; font-weight: 600; color: var(--text); }
  .m-drawer-row-sub  { font-size: .62rem; color: var(--dim); margin-top: 2px; }

  /* Section compacte */
  .section { padding: 14px 13px; margin-bottom: 10px; }
  .page-content { padding: 14px; }
}

@media (min-width: 861px) {
  .m-header, .m-tabs, .m-content,
  .m-drawer-overlay { display: none !important; }
}
