/* ============================================================
   ARK Formation — dashboard.css
   Styles spécifiques au tableau de bord utilisateur
   Dépend de : global.css
   ============================================================ */

html, body { height: 100%; }
body {
  background: var(--off-white);
  color: var(--text-primary);
  font-size: 15px;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--accent);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 60;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.logo-mark {
  font-family: 'Times New Roman', Times, serif;
  font-size: 20px;
  letter-spacing: 0.2em;
  color: #fff;
  font-weight: 400;
}
.logo-badge {
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 980px; transition: all .4s;
}
.logo-badge.free { color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.08); }
.logo-badge.paid {
  color: #7a4f00;
  background: linear-gradient(90deg, #f5d06a, #fceea0, #c9a84c, #fceea0, #f5d06a);
  background-size: 200% auto;
  animation: shine 2.5s linear infinite;
  box-shadow: 0 0 8px rgba(201,168,76,0.5);
}
@keyframes shine { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }

.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 10px 10px 4px;
  margin-top: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 400;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.nav-item.active { background: rgba(255,255,255,0.11); color: #fff; font-weight: 500; }
.nav-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-pill {
  margin-left: auto;
  font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 980px;
  background: rgba(255,255,255,0.11);
  color: rgba(255,255,255,0.6);
}
.nav-pill.blue { background: rgba(0,113,227,0.3); color: #86c7f5; }

.sidebar-user {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.user-row:hover { background: rgba(255,255,255,0.06); }
.user-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; color: #fff; }
.user-plan { font-size: 11px; color: rgba(255,255,255,0.35); font-weight: 300; }

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

/* ── CONTENT PANELS ──────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 26px 30px 40px; display: none; flex-direction: column; gap: 20px; }
.content.active { display: flex; animation: pageIn .28s ease; }
.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-thumb { background: var(--mid-gray); border-radius: 3px; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.page-welcome { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.page-welcome span { color: var(--accent); }
.page-welcome-sub { font-size: 13px; color: var(--text-tertiary); font-weight: 300; margin-top: 2px; }
.header-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.header-tab {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  padding: 8px 16px; border-radius: 980px;
  border: 1px solid var(--mid-gray);
  cursor: pointer; background: var(--white); color: var(--text-secondary);
  transition: all .15s; font-family: inherit;
}
.header-tab:hover { border-color: var(--accent); color: var(--accent); }
.header-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── CARDS ───────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 22px 24px; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; display: flex; align-items: center; gap: 7px; }
.card-sub { font-size: 12px; color: var(--text-tertiary); font-weight: 300; margin-top: 2px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.card-link { font-size: 13px; color: var(--accent); cursor: pointer; }
.card-link:hover { opacity: .7; }

/* ── KPI TRIO ────────────────────────────────────────────── */
.kpi-trio { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--mid-gray); border-radius: var(--radius); overflow: hidden; margin-top: 18px; }
.kpi-cell { background: var(--off-white); padding: 20px 18px; display: flex; align-items: center; gap: 14px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.kpi-val { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.kpi-lbl { font-size: 12px; color: var(--text-tertiary); font-weight: 300; margin-top: 3px; }

/* ── CTA BANNER ──────────────────────────────────────────── */
.cta-banner {
  background: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.cta-title { font-size: 16px; font-weight: 600; color: #fff; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.cta-sub { font-size: 13px; color: rgba(255,255,255,0.42); font-weight: 300; margin-top: 3px; }
.cta-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500;
  background: #fff; color: var(--text-primary);
  padding: 10px 20px; border-radius: 980px;
  border: none; cursor: pointer; white-space: nowrap;
  transition: opacity .15s; flex-shrink: 0; font-family: inherit;
}
.cta-btn:hover { opacity: .88; }
.cta-btn.blue { background: var(--accent); color: #fff; }
.cta-btn.blue:hover { background: var(--accent-hover); opacity: 1; }

/* ── RANK BAR ────────────────────────────────────────────── */
.rank-wrap { margin: 16px 0 22px; }
.rank-lbl-row { display: flex; justify-content: center; margin-bottom: 8px; }
.rank-lbl { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--mid-gray); padding: 4px 14px; border-radius: 980px; }
.rank-track { height: 8px; background: var(--mid-gray); border-radius: 980px; overflow: hidden; }
.rank-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #86c7f5); border-radius: 980px; width: 0; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.rank-ends { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11px; color: var(--text-tertiary); font-weight: 300; }

/* ── RINGS ───────────────────────────────────────────────── */
.rings-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.ring-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring-name { font-size: 13px; font-weight: 500; text-align: center; }
.ring-note { font-size: 11px; color: var(--text-tertiary); font-weight: 300; text-align: center; margin-top: -4px; }

/* ── PROGRESS BARS ───────────────────────────────────────── */
.prog-wrap { display: flex; flex-direction: column; gap: 5px; }
.prog-row { display: flex; justify-content: space-between; font-size: 13px; }
.prog-row span:last-child { color: var(--text-tertiary); font-weight: 300; }
.prog-track { height: 6px; background: var(--light-gray); border-radius: 980px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 980px; background: var(--accent); transition: width 1s cubic-bezier(.4,0,.2,1); }
.prog-fill.g { background: var(--green); }
.prog-fill.o { background: var(--orange); }

/* ── MODULE LIST ─────────────────────────────────────────── */
.mod-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.mod-item:hover { background: var(--light-gray); }
.mod-num { width: 28px; height: 28px; border-radius: 8px; background: var(--light-gray); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.mod-num.done { background: rgba(52,199,89,0.12); color: var(--green); }
.mod-num.cur  { background: var(--accent-light); color: var(--accent); }
.mod-title { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-meta  { font-size: 12px; color: var(--text-tertiary); font-weight: 300; }
.mod-badge { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 980px; white-space: nowrap; flex-shrink: 0; }
.bd-done { background: rgba(52,199,89,0.1); color: var(--green); }
.bd-wip  { background: var(--accent-light); color: var(--accent); }
.bd-lock { background: var(--light-gray); color: var(--text-tertiary); }

/* ── ACTIVITY ────────────────────────────────────────────── */
.act-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--mid-gray); align-items: flex-start; }
.act-item:last-child { border-bottom: none; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.act-dot.g { background: var(--green); }
.act-dot.o { background: var(--orange); }
.act-text { font-size: 13px; color: var(--text-secondary); font-weight: 300; }
.act-text strong { color: var(--text-primary); font-weight: 500; }
.act-time { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

/* ── QUIZ ────────────────────────────────────────────────── */
.quiz-q { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.55; margin-bottom: 20px; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt { padding: 13px 18px; border-radius: 12px; border: 1.5px solid var(--mid-gray); font-size: 14px; cursor: pointer; transition: all .15s; background: var(--white); text-align: left; font-family: inherit; }
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.quiz-opt.selected { border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 500; }
.quiz-opt.correct { border-color: var(--green); background: rgba(52,199,89,0.08); color: #2aa34a; font-weight: 500; }
.quiz-opt.wrong   { border-color: #ff3b30; background: rgba(255,59,48,0.07); color: #d93025; }
.quiz-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.btn-p { font-size: 14px; font-weight: 500; background: var(--accent); color: #fff; padding: 10px 22px; border-radius: 980px; border: none; cursor: pointer; transition: background .15s; font-family: inherit; }
.btn-p:hover { background: var(--accent-hover); }
.btn-g { font-size: 14px; font-weight: 400; color: var(--text-secondary); padding: 10px 16px; border-radius: 980px; border: none; cursor: pointer; background: var(--light-gray); font-family: inherit; }
.btn-g:hover { background: var(--mid-gray); }
.quiz-score { font-size: 12px; color: var(--text-tertiary); margin-left: auto; font-weight: 300; }

/* ── BONUS CARDS ─────────────────────────────────────────── */
.bonus-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.bonus-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: all .2s; }
.bonus-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.08); }
.bonus-card.locked { opacity: .5; pointer-events: none; }
.bonus-ico { font-size: 26px; }
.bonus-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.bonus-desc { font-size: 12px; color: var(--text-secondary); font-weight: 300; line-height: 1.6; }
.badge { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 980px; align-self: flex-start; }
.badge.new   { background: rgba(52,199,89,0.1); color: var(--green); }
.badge.exclu { background: var(--accent-light); color: var(--accent); }
.badge.lock  { background: var(--light-gray); color: var(--text-tertiary); }

/* ── SETTINGS ────────────────────────────────────────────── */
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--mid-gray); gap: 20px; }
.set-row:last-child { border-bottom: none; }
.set-name { font-size: 14px; font-weight: 500; }
.set-desc { font-size: 12px; color: var(--text-tertiary); font-weight: 300; margin-top: 1px; }
.toggle { width: 44px; height: 26px; background: var(--mid-gray); border-radius: 980px; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; border: none; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.toggle.on::after { transform: translateX(18px); }
.sel { font-size: 13px; color: var(--text-secondary); background: var(--light-gray); border: none; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-family: inherit; outline: none; }
.sml-btn { font-size: 13px; font-weight: 400; color: var(--text-secondary); padding: 7px 14px; border-radius: 980px; border: none; cursor: pointer; background: var(--light-gray); font-family: inherit; white-space: nowrap; }
.sml-btn:hover { background: var(--mid-gray); }

/* ── COURS PILLS ─────────────────────────────────────────── */
.cours-pill {
  font-size: 13px; font-weight: 400; color: rgba(255,255,255,0.75);
  padding: 8px 18px; border-radius: 980px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.cours-pill:hover { background: rgba(255,255,255,0.15); color: #fff; }
.cours-pill.active-pill { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.45); }

/* ── COURS CARDS ─────────────────────────────────────────── */
.cours-card {
  background: var(--off-white); border-radius: var(--radius);
  border: 1px solid var(--mid-gray); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s; cursor: pointer;
}
.cours-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.08); }
.cours-card.cours-lock { pointer-events: none; opacity: .7; }
.cours-card-top {
  position: relative;
  background: linear-gradient(140deg, #dce9ff, #eef3ff);
  height: 110px;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.cours-card.cours-done .cours-card-top { background: linear-gradient(140deg, #d4f0de, #e8f8ee); }
.cours-card.cours-wip  .cours-card-top { background: linear-gradient(140deg, #dce9ff, #eef3ff); }
.cours-card.cours-lock .cours-card-top { background: linear-gradient(140deg, #ebebeb, #f5f5f5); }
.cours-price-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.82); color: var(--text-secondary);
  padding: 3px 10px; border-radius: 980px;
}
.cours-price-badge.wip-badge  { background: var(--accent); color: #fff; }
.cours-price-badge.lock-badge { background: var(--light-gray); color: var(--text-tertiary); }
.cours-card-meta { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px 0; font-size: 12px; color: var(--text-tertiary); font-weight: 300; }
.cours-access { font-size: 11px; font-weight: 600; color: var(--text-tertiary); }
.done-access { color: var(--green); }
.wip-access  { color: var(--accent); }
.cours-card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); padding: 8px 14px 0; line-height: 1.3; }
.cours-card-desc  { font-size: 12px; color: var(--text-secondary); font-weight: 300; padding: 6px 14px 16px; line-height: 1.6; }

/* ── UTILITAIRES DASHBOARD ───────────────────────────────── */
.tag { font-size: 11px; font-weight: 500; color: var(--accent); background: var(--accent-light); padding: 3px 9px; border-radius: 980px; display: inline-block; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.divider { height: 1px; background: var(--mid-gray); margin: 14px 0; }
.grid2   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.col { display: flex; flex-direction: column; gap: 18px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.18); }
  .main { margin-left: 0; }
  .kpi-trio, .rings-row { grid-template-columns: repeat(2,1fr); }
  .grid2-1 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .bonus-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 18px 16px 32px; }
}
@media (max-width: 540px) {
  .kpi-trio, .rings-row, .bonus-grid { grid-template-columns: 1fr; }
  .header-tabs { display: none; }
}

/* ── BASE ────────────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
