:root {
  --navy:        #0B1F4B;
  --navy-dark:   #071530;
  --navy-light:  #152d6e;
  --gold:        #C9A84C;
  --gold-light:  #E8C97A;
  --gold-dim:    #8B6E2A;
  --white:       #FFFFFF;
  --bg:          #0a1628;
  --card:        #111d35;
  --border:      rgba(255,255,255,0.07);
  --text:        rgba(255,255,255,0.85);
  --muted:       rgba(255,255,255,0.4);
  --green:       #10B981;
  --red:         #EF4444;
  --cyan:        #06B6D4;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.4);
  --transition:  .2s ease;
}

/* Force fond sombre partout */
html, body {
  background: #0a1628 !important;
  color: rgba(255,255,255,0.85) !important;
}

/* ============================================================
   MODERNITY PRO — Feuille de style responsive complète
   Breakpoints :
     Mobile     : < 480px
     Tablette   : 480px – 768px
     Laptop     : 768px – 1024px
     Desktop    : > 1024px
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #0e1e38;
  --navy-dark:   #071120;
  --navy-light:  #182c4e;
  --gold:        #C9A84C;
  --gold-light:  #E8C97A;
  --gold-dim:    #8B6E2A;
  --white:       #FFFFFF;
  --bg:          #081225;
  --card:        #0f1c30;
  --border:      rgba(255,255,255,0.07);
  --text:        #f3f4f6;
  --muted:       #9ca3af;
  --green:       #10B981;
  --red:         #EF4444;
  --cyan:        #06B6D4;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 8px 32px rgba(0,0,0,0.25);
  --shadow-lg:   0 16px 48px rgba(0,0,0,0.4);
  --transition:  .2s ease;
  --sidebar-w:   250px;
}

html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: var(--gold); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; }

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 3px; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; position: relative; }

/* ── OVERLAY MOBILE ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(7,21,48,0.55);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo .logo-title {
  font-size: 1.15rem; font-weight: 900;
  color: var(--gold); letter-spacing: 1px;
  white-space: nowrap;
}
.sidebar-logo .logo-sub {
  font-size: 0.62rem; color: rgba(255,255,255,0.35);
  letter-spacing: 3px; margin-top: 2px;
}

.sidebar-user {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sidebar-user .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--navy); font-size: .9rem;
  flex-shrink: 0;
}
.sidebar-user .user-name { font-size: .82rem; font-weight: 700; color: #fff; }
.sidebar-user .user-vip  { font-size: .7rem; color: var(--gold); margin-top: 1px; }

.sidebar-nav {
  flex: 1; padding: 10px 0;
  overflow-y: auto; overflow-x: hidden;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.58); font-size: .85rem;
  transition: all var(--transition);
  position: relative; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-item.active {
  color: var(--gold); background: rgba(201,168,76,0.13); font-weight: 700;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--gold); border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  border-radius: 10px; padding: 1px 6px; font-size: .68rem; font-weight: 800;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.45); font-size: .82rem;
  background: none; border: none; cursor: pointer; width: 100%;
  transition: color var(--transition); padding: 0;
}
.btn-logout:hover { color: var(--red); }

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex;
  flex-direction: column; min-height: 100vh;
  min-width: 0;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex; align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  gap: 12px;
}
.topbar-title { font-size: 1rem; font-weight: 800; color: #fff; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

#menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: #fff; padding: 4px;
  line-height: 1; flex-shrink: 0;
}

.notif-btn {
  position: relative; background: none; border: none;
  cursor: pointer; color: var(--muted); font-size: 1.15rem;
  padding: 6px; border-radius: 8px; transition: background var(--transition);
  line-height: 1;
}
.notif-btn:hover { background: var(--bg); }
.notif-count {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff;
  border-radius: 50%; width: 15px; height: 15px;
  font-size: .6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── PAGE BODY ────────────────────────────────────────────── */
.page-body { padding: 24px; flex: 1; }
.page-dashboard .page-body {
  padding-top: 12px;
}
.page-dashboard .bal-carousel-container {
  margin-top: 0;
  margin-bottom: 20px;
}
.page-dashboard .stat-row {
  margin-top: 4px;
}
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-title { font-size: 1.3rem; font-weight: 900; color: #fff; }
.page-subtitle { color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card-title {
  font-size: .9rem; font-weight: 700; color: #fff;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}

/* ── GRILLES RESPONSIVE ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.balances-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.vip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.two-col-wide {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── STAT CARDS ───────────────────────────────────────────── */
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  position: relative; overflow: hidden;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); }
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent, var(--gold));
}
.stat-card .stat-icon { font-size: 1.4rem; margin-bottom: 8px; display: block; }
.stat-card .stat-label {
  font-size: .72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px;
}
.stat-card .stat-value {
  font-size: 1.4rem; font-weight: 900; color: #fff;
  font-family: 'Courier New', monospace; line-height: 1.1;
}
.stat-card .stat-sub { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.stat-gold   { --accent: var(--gold); }
.stat-green  { --accent: var(--green); }
.stat-blue   { --accent: var(--cyan); }
.stat-purple { --accent: #7B5EA7; }
.stat-red    { --accent: var(--red); }

/* ── BALANCE CARDS ────────────────────────────────────────── */
.balance-card {
  background: var(--navy); border-radius: var(--radius);
  padding: 20px; color: #fff; position: relative; overflow: hidden;
}
.balance-card::after {
  content: ''; position: absolute;
  bottom: -16px; right: -16px;
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.balance-card .balance-label {
  font-size: .72rem; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: .4px;
}
.balance-card .balance-value {
  font-size: 1.6rem; font-weight: 900;
  color: var(--gold); font-family: 'Courier New', monospace;
  margin: 5px 0; line-height: 1.1; word-break: break-all;
}
.balance-card .balance-sub { font-size: .72rem; color: rgba(255,255,255,0.38); }
.balance-icon {
  position: absolute; top: 14px; right: 14px;
  font-size: 1.5rem; opacity: 0.13;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  border: none; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
  line-height: 1.4; touch-action: manipulation;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--navy);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(201,168,76,.35); color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-light); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--navy); }
.btn-danger  { background: var(--red);   color: #fff; }
.btn-danger:hover  { opacity: .85; color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: .85; color: #fff; }
.btn-sm  { padding: 5px 12px; font-size: .78rem; border-radius: 6px; }
.btn-lg  { padding: 12px 26px; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── ACTIONS ROW ──────────────────────────────────────────── */
.actions-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px; align-items: center;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .8rem;
  font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .88rem;
  color: var(--text); background: var(--navy-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; appearance: none; -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.form-control::placeholder { color: var(--muted); }
.form-hint { font-size: .72rem; color: var(--muted); margin-top: 4px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C9A84C' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
}
.alert-success { background: rgba(16,185,129,.1);  color: #10B981; border: 1px solid rgba(16,185,129,.28); }
.alert-danger  { background: rgba(239,68,68,.09);  color: #EF4444; border: 1px solid rgba(239,68,68,.28); }
.alert-info    { background: rgba(14,165,233,.09); color: #38BDF8; border: 1px solid rgba(14,165,233,.22); }
.alert-warning { background: rgba(201,168,76,.1);  color: #FBBF24; border: 1px solid rgba(201,168,76,.28); }

/* ── TABLES ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 500px; }
thead tr { background: var(--navy); }
thead th {
  padding: 11px 14px; color: rgba(255,255,255,0.78);
  font-weight: 600; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .4px;
  text-align: left; white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: rgba(11,31,75,.03); }
tbody td { padding: 11px 14px; color: var(--text); vertical-align: middle; }
.td-mono  { font-family: 'Courier New', monospace; font-weight: 700; }
.td-gold  { color: var(--gold); font-weight: 700; }
.td-green { color: var(--green); font-weight: 700; }
.td-red   { color: var(--red); font-weight: 700; }
.td-muted { color: var(--muted); font-size: .78rem; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
}
.badge-gold  { background: rgba(201,168,76,.14); color: var(--gold-dim); }
.badge-green { background: rgba(0,201,122,.12);  color: #00874f; }
.badge-red   { background: rgba(231,76,60,.11);  color: var(--red); }
.badge-blue  { background: rgba(14,165,233,.11); color: #0369a1; }
.badge-navy  { background: var(--navy); color: #fff; }
.badge-muted { background: var(--bg); color: var(--muted); }

/* ── VIP BADGES ───────────────────────────────────────────── */
.vip-badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 20px; font-size: .75rem; font-weight: 800;
}
.vip-1  { background: #e8e8e8; color: #555; }
.vip-2  { background: rgba(201,168,76,.2);  color: var(--gold-dim); }
.vip-3  { background: rgba(14,165,233,.14); color: #0369a1; }
.vip-4  { background: rgba(0,201,122,.14);  color: #00874f; }
.vip-5  { background: rgba(123,94,167,.14); color: #5b3d8f; }
.vip-6  { background: rgba(231,76,60,.14);  color: var(--red); }
.vip-7  { background: rgba(201,168,76,.24); color: var(--gold); }
.vip-8  { background: rgba(255,153,0,.14);  color: #b36200; }
.vip-9  { background: rgba(255,0,68,.11);   color: #cc0044; }
.vip-10 { background: linear-gradient(135deg,var(--gold-dim),var(--gold)); color: #fff; }

/* ── STATUS DOTS ──────────────────────────────────────────── */
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; }
.status-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.status-valide::before, .status-actif::before, .status-envoye::before { background: var(--green); }
.status-en_attente::before { background: var(--gold); }
.status-rejete::before, .status-suspendu::before { background: var(--red); }
.status-info::before { background: var(--cyan); }

/* ── VIP CARDS ────────────────────────────────────────────── */
.vip-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.vip-card.vip-active { border-color: var(--gold); background: rgba(201,168,76,.04); }
.vip-card.vip-done   { border-color: var(--green); opacity: .75; }
.vip-card.vip-locked { opacity: .5; }
.vip-card:hover:not(.vip-locked) { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.vip-card-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 6px;
}
.vip-card-num   { font-size: 1.2rem; font-weight: 900; color: var(--navy); }
.vip-card-amount { font-size: 1.2rem; font-weight: 900; color: var(--gold); font-family: 'Courier New', monospace; margin-bottom: 3px; }
.vip-card-daily  { font-size: .78rem; color: var(--green); font-weight: 700; }

/* ── WHEEL ────────────────────────────────────────────────── */
.wheel-container { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 24px 16px; }
.wheel-pointer {
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 22px solid var(--gold);
  margin-bottom: -10px; z-index: 2; position: relative;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
#wheel-canvas { border-radius: 50%; box-shadow: 0 8px 36px rgba(11,31,75,.22); max-width: 100%; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(7,21,48,.72); z-index: 200;
  align-items: center; justify-content: center;
  padding: 16px; backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: 16px; padding: 24px;
  max-width: 460px; width: 100%; box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease; max-height: 90vh; overflow-y: auto;
}
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 18px;
}
.modal-title { font-size: 1rem; font-weight: 800; color: #fff; }
.modal-close {
  background: none; border: none; font-size: 1.3rem;
  color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1;
}
.modal-close:hover { background: var(--bg); }

/* ── INFO BOX ─────────────────────────────────────────────── */
.info-box {
  background: var(--bg); border: 1px solid var(--border);
  border-left: 4px solid var(--gold); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: .83rem; color: var(--text); margin-bottom: 14px;
}
.info-box strong { color: var(--gold); }

/* ── TOAST ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 11px 16px; border-radius: 10px;
  font-size: .85rem; font-weight: 700;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  animation: toastIn .25s ease;
  max-width: 300px; display: flex; align-items: center; gap: 8px;
}
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red);   color: #fff; }
.toast-info    { background: var(--navy);  color: #fff; }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── NOTIFICATIONS PANEL ──────────────────────────────────── */
.notif-panel {
  position: fixed; top: 56px; right: 0;
  width: min(340px, 100vw); background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px 0 0 14px;
  box-shadow: var(--shadow-lg); z-index: 150;
  max-height: 70vh; overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; color: #fff;
  position: sticky; top: 0; background: var(--card);
}
.notif-item {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  transition: background var(--transition); cursor: pointer;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { border-left: 3px solid var(--gold); }
.notif-item-title  { font-size: .82rem; font-weight: 700; color: #fff; }
.notif-item-msg    { font-size: .77rem; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.notif-item-time   { font-size: .68rem; color: var(--muted); margin-top: 5px; }

/* ── UPLOAD ZONE ──────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold); background: rgba(201,168,76,.05);
}
.upload-zone .upload-icon { font-size: 1.8rem; margin-bottom: 6px; }
.upload-zone p   { font-size: .82rem; color: var(--muted); }
.upload-zone small { font-size: .72rem; color: var(--muted); }
.upload-zone input[type="file"] { display: none; }

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress { height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 4px; transition: width .6s ease;
}

/* ── AUTH PAGE ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-light) 100%);
  padding: 16px;
}
.auth-box {
  background: #fff; border-radius: 18px; padding: 32px 28px;
  width: 100%; max-width: 400px; box-shadow: 0 24px 80px rgba(7,21,48,.4);
}
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .logo-text { font-size: 1.6rem; font-weight: 900; color: var(--navy); letter-spacing: 1px; }
.auth-logo .logo-devise { font-size: .75rem; color: var(--gold); font-style: italic; margin-top: 3px; }
.auth-tabs {
  display: flex; background: var(--bg);
  border-radius: var(--radius-sm); padding: 3px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 8px; text-align: center; font-size: .85rem;
  font-weight: 700; cursor: pointer; border-radius: 6px;
  border: none; background: none; color: var(--muted);
  transition: all var(--transition);
}
.auth-tab.active { background: var(--navy); color: var(--gold); }

/* ── TABS NAV ─────────────────────────────────────────────── */
.tabs-nav {
  display: flex; gap: 3px; background: var(--bg);
  border-radius: var(--radius-sm); padding: 3px;
  margin-bottom: 20px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; flex-wrap: nowrap;
}
.tabs-nav .btn {
  white-space: nowrap; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — DESKTOP (> 1200px)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — LAPTOP (768px – 1024px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .stat-value { font-size: 1.2rem; }
  .balance-card .balance-value { font-size: 1.3rem; }
  .two-col-wide { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 18px; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — TABLETTE (480px – 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Masquer sidebar, afficher burger */
  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  #menu-btn { display: block !important; }

  /* Grilles tablette */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .balances-grid { grid-template-columns: 1fr; gap: 10px; }
  .balance-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
  .balance-card .balance-icon { position: static; opacity: .3; font-size: 1.4rem; }
  .balance-card .balance-value { font-size: 1.3rem; }
  .two-col { grid-template-columns: 1fr; }
  .two-col-wide { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .vip-grid { grid-template-columns: repeat(2, 1fr); }

  /* Page body */
  .page-body { padding: 14px; }
  .page-title { font-size: 1.1rem; }
  .page-header { margin-bottom: 14px; }

  /* Topbar */
  .topbar { padding: 10px 14px; }
  .topbar-title { font-size: .9rem; }

  /* Tables */
  table { min-width: 400px; font-size: .8rem; }
  thead th { padding: 9px 11px; }
  tbody td  { padding: 9px 11px; }

  /* Card */
  .card { padding: 14px; }

  /* Boutons */
  .actions-row { gap: 8px; }
  .actions-row .btn { padding: 7px 14px; font-size: .8rem; }

  /* Auth */
  .auth-box { padding: 24px 18px; }

  /* Notif panel — slide depuis le bas, au-dessus de la bottom-nav */
  .notif-panel {
    width: 100vw;
    right: 0;
    left: 0;
    border-radius: 20px 20px 0 0;
    top: auto;
    /* Positionné juste au-dessus de la bottom-nav flottante */
    bottom: calc(var(--bottom-h) + var(--bottom-floating-gap) + env(safe-area-inset-bottom, 0px) + 8px);
    z-index: 600;               /* Au-dessus de la bottom-nav (500) */
    max-height: 65vh;
    overflow-y: auto;
    /* Réinitialiser le transform depuis le bas de sa propre position */
    transform: translateY(calc(100% + var(--bottom-h) + var(--bottom-floating-gap) + 20px));
  }
  .notif-panel.open {
    transform: translateY(0);
  }

  /* Modal */
  .modal { padding: 18px; border-radius: 14px; }

  /* Toast */
  #toast-container { top: auto; bottom: 16px; left: 16px; right: 16px; align-items: stretch; }
  .toast { max-width: 100%; }

  /* Tabs */
  .tabs-nav { margin-bottom: 14px; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (< 480px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  html { font-size: 14px; }

  /* Grilles mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-icon { font-size: 1.2rem; margin-bottom: 5px; }
  .stat-card .stat-value { font-size: 1.1rem; }
  .vip-grid { grid-template-columns: 1fr; }

  /* Balance cards empilées */
  .balances-grid { grid-template-columns: 1fr; gap: 8px; }
  .balance-card .balance-value { font-size: 1.2rem; }

  /* Page */
  .page-body { padding: 10px; }
  .page-title { font-size: 1rem; }

  /* Topbar */
  .topbar { padding: 9px 12px; gap: 8px; }

  /* Boutons pleine largeur sur mobile si dans page-header */
  .page-header .btn { width: 100%; justify-content: center; }

  /* Actions row wrap */
  .actions-row { flex-wrap: wrap; }
  .actions-row .btn { flex: 1 1 auto; min-width: 120px; justify-content: center; }

  /* Tables */
  table { min-width: 380px; font-size: .78rem; }
  thead th { padding: 8px 10px; }
  tbody td  { padding: 8px 10px; }

  /* Card title wrap */
  .card-title { font-size: .85rem; }
  .card { padding: 12px; }

  /* VIP card */
  .vip-card { padding: 14px; }
  .vip-card-num { font-size: 1.1rem; }
  .vip-card-amount { font-size: 1.1rem; }

  /* Wheel */
  #wheel-canvas { width: 240px !important; height: 240px !important; }

  /* Auth */
  .auth-box { padding: 20px 14px; border-radius: 14px; }
  .auth-logo .logo-text { font-size: 1.4rem; }

  /* Form row */
  .form-row { grid-template-columns: 1fr; }

  /* Modal */
  .modal { padding: 16px; }
  .modal-title { font-size: .9rem; }

  /* Bouton block sur mobile */
  .btn-lg { padding: 11px 20px; font-size: .9rem; }

  /* Sidebar user compact */
  .sidebar-user .user-name { font-size: .78rem; }

  /* Masquer sous-titres dans stat-card sur très petit écran */
  .stat-card .stat-sub { font-size: .66rem; }

  /* Notif panel plein écran */
  .notif-panel { border-radius: 14px 14px 0 0; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — TRÈS PETIT (< 360px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  html { font-size: 13px; }
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-title { display: none; }
  .balance-card .balance-value { font-size: 1.1rem; }
  #wheel-canvas { width: 210px !important; height: 210px !important; }
}

/* ══════════════════════════════════════════════════════════
   UTILITAIRES
   ══════════════════════════════════════════════════════════ */
.d-none   { display: none !important; }
.d-flex   { display: flex !important; }
.flex-col { flex-direction: column !important; }
.gap-8    { gap: 8px !important; }
.gap-12   { gap: 12px !important; }
.gap-16   { gap: 16px !important; }
.mt-8     { margin-top: 8px !important; }
.mt-12    { margin-top: 12px !important; }
.mt-16    { margin-top: 16px !important; }
.mt-20    { margin-top: 20px !important; }
.mb-16    { margin-bottom: 16px !important; }
.mb-20    { margin-bottom: 20px !important; }
.mb-24    { margin-bottom: 24px !important; }
.text-center { text-align: center !important; }
.text-muted  { color: var(--muted) !important; }
.text-gold   { color: var(--gold) !important; }
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-navy   { color: var(--navy) !important; }
.fw-700  { font-weight: 700 !important; }
.fw-800  { font-weight: 800 !important; }
.font-mono { font-family: 'Courier New', monospace !important; }
.w-full  { width: 100% !important; }
.hidden  { visibility: hidden; }

/* ── PRINT ────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .notif-panel, #toast-container,
  .btn, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ============================================================
   MODERNITY PRO — Design Global Futuriste (toutes pages user)
   ============================================================ */

/* ── FOND GLOBAL ──────────────────────────────────────────── */
body {
  background: #0a1628 !important;
}
.page-body {
  background: #0a1628;
}

/* ── TOPBAR SOMBRE ────────────────────────────────────────── */
.topbar {
  background: #0d1e3d !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
}
.topbar-title, .topbar-breadcrumb .current { color: #fff !important; }
.topbar-breadcrumb { color: rgba(255,255,255,.35) !important; }
.topbar-profile {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.1) !important;
}
.tp-name { color: #fff !important; }
.tp-role { color: rgba(255,255,255,.4) !important; }
.notif-btn { color: rgba(255,255,255,.5) !important; }
.notif-btn:hover { background: rgba(255,255,255,.07) !important; }

/* ── CARDS SOMBRES ────────────────────────────────────────── */
.card {
  background: #111d35 !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,.3) !important;
}
.card-title {
  color: #fff !important;
  border-bottom-color: rgba(255,255,255,.07) !important;
}

/* ── STAT CARDS ───────────────────────────────────────────── */
.stat-card {
  background: #111d35 !important;
  border: 1px solid rgba(255,255,255,.07) !important;
}
.stat-card .stat-value { color: #fff !important; }
.stat-card .stat-label { color: rgba(255,255,255,.4) !important; }
.stat-card .stat-sub   { color: rgba(255,255,255,.3) !important; }

/* ── TEXTES ───────────────────────────────────────────────── */
.page-title    { color: #fff !important; }
.page-subtitle { color: rgba(255,255,255,.4) !important; }

/* ── TABLEAUX ─────────────────────────────────────────────── */
thead tr { background: rgba(255,255,255,.05) !important; }
thead th  { color: rgba(255,255,255,.5) !important; }
tbody tr  { border-bottom-color: rgba(255,255,255,.05) !important; }
tbody tr:hover { background: rgba(255,255,255,.03) !important; }
tbody td  { color: rgba(255,255,255,.85) !important; }
.td-muted { color: rgba(255,255,255,.35) !important; }

/* ── FORMULAIRES ──────────────────────────────────────────── */
.form-label { color: rgba(255,255,255,.7) !important; }
.form-control {
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.1) !important;
  color: #fff !important;
}
.form-control:focus {
  border-color: #C9A84C !important;
  background: rgba(255,255,255,.07) !important;
  box-shadow: 0 0 0 3px rgba(201,168,76,.15) !important;
}
.form-control::placeholder { color: rgba(255,255,255,.25) !important; }
.form-hint { color: rgba(255,255,255,.3) !important; }
select.form-control option { background: #111d35; color: #fff; }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert-info    { background: rgba(59,130,246,.12)  !important; color: #93C5FD !important; border-color: rgba(59,130,246,.25)  !important; }
.alert-success { background: rgba(16,185,129,.12)  !important; color: #6EE7B7 !important; border-color: rgba(16,185,129,.25)  !important; }
.alert-danger  { background: rgba(239,68,68,.12)   !important; color: #FCA5A5 !important; border-color: rgba(239,68,68,.25)   !important; }
.alert-warning { background: rgba(245,158,11,.12)  !important; color: #FCD34D !important; border-color: rgba(245,158,11,.25)  !important; }

/* ── INFO BOX ─────────────────────────────────────────────── */
.info-box {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(201,168,76,.4) !important;
  color: rgba(255,255,255,.75) !important;
}
.info-box strong { color: #fff !important; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge-muted { background: rgba(255,255,255,.07) !important; color: rgba(255,255,255,.5) !important; }
.badge-navy  { background: rgba(59,130,246,.2) !important; color: #93C5FD !important; }

/* ── UPLOAD ZONE ──────────────────────────────────────────── */
.upload-zone {
  border-color: rgba(255,255,255,.12) !important;
  background: rgba(255,255,255,.03) !important;
}
.upload-zone p, .upload-zone small { color: rgba(255,255,255,.35) !important; }
.upload-zone:hover { border-color: #C9A84C !important; background: rgba(201,168,76,.05) !important; }

/* ── TABS NAV ─────────────────────────────────────────────── */
.tabs-nav { background: rgba(255,255,255,.05) !important; }
.tabs-nav .btn { color: rgba(255,255,255,.45) !important; }
.tabs-nav .btn-navy { background: rgba(255,255,255,.1) !important; color: #fff !important; }

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress { background: rgba(255,255,255,.08) !important; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal {
  background: #111d35 !important;
  border: 1px solid rgba(255,255,255,.1) !important;
}
.modal-title { color: #fff !important; }
.modal-close { color: rgba(255,255,255,.4) !important; }
.modal-close:hover { background: rgba(255,255,255,.07) !important; }

/* ── NOTIF PANEL ──────────────────────────────────────────── */
.notif-panel {
  background: #0d1e3d !important;
  border-color: rgba(255,255,255,.08) !important;
}
.notif-panel-header {
  background: #0d1e3d !important;
  color: #fff !important;
  border-bottom-color: rgba(255,255,255,.07) !important;
}
.notif-item { border-bottom-color: rgba(255,255,255,.06) !important; }
.notif-item:hover { background: rgba(255,255,255,.04) !important; }
.notif-item-title { color: #fff !important; }
.notif-item-msg, .notif-item-time { color: rgba(255,255,255,.4) !important; }

/* ── BG ───────────────────────────────────────────────────── */
.bg, .stat-card { background: #0a1628 !important; }


/* ============================================================
   RESPONSIVE MOBILE — Scroll horizontal natif
   Aucun débordement, conteneur stable
   ============================================================ */

/* ── RÈGLE GLOBALE ANTI-DÉBORDEMENT ──────────────────────── */
html {
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}
.main-content {
  overflow-x: hidden;
  max-width: 100%;
}
.page-body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ── MIXIN SCROLL HORIZONTAL ─────────────────────────────── */
/* Utilisé sur les grilles qui deviennent scrollables sur mobile */
.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * {
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* ── INDICATEURS SCROLL ───────────────────────────────────── */
.scroll-indicator {
  display: none;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}
.scroll-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  transition: all .2s;
  cursor: pointer;
}
.scroll-dot.active {
  width: 18px; border-radius: 3px;
  background: #C9A84C;
}

/* ══════════════════════════════════════════════════════════
   MOBILE ≤ 768px
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Afficher indicateurs */
  .scroll-indicator { display: flex; }

  /* ── PAGE BODY ──────────────────────────────────────────── */
  .page-body {
    padding: 12px !important;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px) !important;
  }

  /* ── BALANCES (3 cartes soldes) ────────────────────────── */
  .bal-grid,
  .wallet-soldes {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 6px !important;
    /* Pas de margin négatif = pas de débordement */
  }
  .bal-grid::-webkit-scrollbar,
  .wallet-soldes::-webkit-scrollbar { display: none !important; }

  .bal-grid > *,
  .wallet-soldes > * {
    flex-shrink: 0 !important;
    width: 220px !important;
    min-width: 220px !important;
  }

  /* ── STATS GRIDS ────────────────────────────────────────── */
  .stats-grid,
  .stat-row,
  .coffre-stats-grid,
  .parr-stats-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
  }
  .stats-grid::-webkit-scrollbar,
  .stat-row::-webkit-scrollbar,
  .coffre-stats-grid::-webkit-scrollbar,
  .parr-stats-row::-webkit-scrollbar { display: none !important; }

  .stats-grid > *,
  .stat-row > *,
  .coffre-stats-grid > *,
  .parr-stats-row > * {
    flex-shrink: 0 !important;
    width: 148px !important;
    min-width: 148px !important;
  }

  /* ── VIP CARDS ──────────────────────────────────────────── */
  .vip-cards-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 6px !important;
  }
  .vip-cards-grid::-webkit-scrollbar { display: none !important; }
  .vip-cards-grid > * {
    flex-shrink: 0 !important;
    width: 250px !important;
    min-width: 250px !important;
  }

  /* ── MÉTHODES PAIEMENT ──────────────────────────────────── */
  .methodes-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
  }
  .methodes-grid::-webkit-scrollbar { display: none !important; }
  .methodes-grid > * {
    flex-shrink: 0 !important;
    width: 130px !important;
    min-width: 130px !important;
  }

  /* ── GRAPHIQUES ─────────────────────────────────────────── */
  .charts-grid,
  .charts-grid-3 {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* ── COLONNES 2/3 → COLONNE UNIQUE ────────────────────── */
  .two-col,
  .two-col-wide,
  .three-col,
  .profil-grid,
  .form-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* ── TABS → SCROLL ──────────────────────────────────────── */
  .wallet-tabs,
  .tabs-nav,
  .niv-tabs,
  .support-tabs {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 2px !important;
  }
  .wallet-tabs::-webkit-scrollbar,
  .tabs-nav::-webkit-scrollbar,
  .niv-tabs::-webkit-scrollbar,
  .support-tabs::-webkit-scrollbar { display: none !important; }

  .wallet-tab,
  .niv-tab,
  .support-tab { flex-shrink: 0 !important; }

  /* ── TABLEAUX ────────────────────────────────────────────── */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }
  table { min-width: 480px !important; }

  /* ── ÉLÉMENTS LARGES → LIMITER ──────────────────────────── */
  .card { max-width: 100% !important; }
  .modal { max-width: calc(100vw - 24px) !important; }
  img    { max-width: 100% !important; }

  /* ── SECTIONS HERO → COLONNE ────────────────────────────── */
  .parr-hero,
  .vip-page-header,
  .coffre-hero,
  .support-hero,
  .profil-hero {
    flex-direction: column !important;
  }

  /* ── BOUTONS ACTIONS ─────────────────────────────────────── */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .page-header .btn { width: 100% !important; justify-content: center !important; }

  /* ── GRILLE LIEN PARRAINAGE DASHBOARD ───────────────────── */
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* ── COUNTDOWN ───────────────────────────────────────────── */
  .countdown {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* ── FORMULAIRE DÉPÔT/RETRAIT (2 colonnes → 1) ──────────── */
  [style*="grid-template-columns:3fr 2fr"],
  [style*="grid-template-columns: 3fr 2fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* ── TOPBAR ──────────────────────────────────────────────── */
  .topbar { height: 50px !important; padding: 0 12px !important; }
  .topbar-breadcrumb span:first-child,
  .topbar-breadcrumb .sep { display: none !important; }
  .tp-name, .tp-role { display: none !important; }
  .topbar-profile { padding: 5px !important; }
}

/* ══════════════════════════════════════════════════════════
   TRÈS PETIT ≤ 380px
   ══════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .page-body { padding: 10px !important; }

  .bal-grid > *,
  .wallet-soldes > * { width: 200px !important; min-width: 200px !important; }

  .stats-grid > *,
  .stat-row > * { width: 136px !important; min-width: 136px !important; }

  .vip-cards-grid > * { width: 230px !important; min-width: 230px !important; }

  .methodes-grid > * { width: 118px !important; min-width: 118px !important; }

  table { min-width: 420px !important; }
}

/* ── DASHBOARD BOTTOM ROW ─────────────────────────────────── */
.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .dashboard-bottom-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .dashboard-bottom-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
}

/* ── FIX DÉBORDEMENT GLOBAL FINAL ────────────────────────── */
* { box-sizing: border-box; }

/* Empêcher tout élément de dépasser la largeur viewport */
@media (max-width: 768px) {
  .app-layout,
  .main-content,
  .page-body,
  .card,
  .chart-card,
  .vip-page-header,
  .coffre-hero,
  .parr-hero,
  .support-hero,
  .profil-hero,
  .roue-page {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Canvas graphiques = responsive */
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Images responsive */
  img { max-width: 100% !important; height: auto !important; }

  /* Textes longs ne débordent pas */
  .td-muted, .filleul-meta, .mdu-mail,
  .methode-coords, .cs-val, .ref-code-box {
    word-break: break-all !important;
    overflow-wrap: break-word !important;
  }

  /* Formulaires pleine largeur */
  .form-control, .btn-block { width: 100% !important; }

  /* Vip hero stats scroll */
  .vip-hero-stats {
    display: flex !important;
    overflow-x: auto !important;
    gap: 16px !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
    flex-wrap: nowrap !important;
  }
  .vip-hero-stats::-webkit-scrollbar { display: none !important; }
  .vip-hero-stat { flex-shrink: 0 !important; }

  /* Grille VIP gains (jour/mois/an) */
  .vip-gains-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .vip-gain-box { padding: 8px 4px !important; }
  .vip-gain-box .g-val { font-size: .75rem !important; }

  /* Réduire tailles de police sur très petits écrans */
  .bal-amount, .cca-montant { font-size: 1.4rem !important; }
  .coffre-montant { font-size: 1.3rem !important; }
  .parr-hero .ps-val { font-size: 1.1rem !important; }

  /* Bottom row ligne 3 dashboard */
  .coffre-dash-card,
  .ref-card { border-radius: 14px !important; }

  /* Roue canvas responsive */
  #wheel-canvas {
    width: min(280px, calc(100vw - 80px)) !important;
    height: min(280px, calc(100vw - 80px)) !important;
  }
}
