/* ============================================================
   FONTS — locales uniquement (R11)
============================================================ */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --sat: env(safe-area-inset-top);
  --sar: env(safe-area-inset-right);
  --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left);
}

html {
  height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Safe area — edge-to-edge PWA */
body {
  padding-top: var(--sat);
  padding-bottom: var(--sab);
  padding-left: var(--sal);
  padding-right: var(--sar);
}

/* Scrollbar fine */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Sélection */
::selection { background: var(--gold-dim); color: var(--gold); }

/* Focus visible global */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Images */
img { max-width: 100%; height: auto; display: block; }

/* Liens */
a { color: inherit; text-decoration: none; }

/* ============================================================
   APP LAYOUT
============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: calc(100vh - var(--sat) - var(--sab));
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: var(--sat);
  transition: transform 0.3s ease;
}

.sidebar-logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.sidebar-logo-text span {
  color: var(--gold);
}

.sidebar-section {
  padding: 16px 10px 6px;
}

.sidebar-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  position: relative;
  border: 1px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(201,168,76,0.2);
}

.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--bg-primary);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  font-family: var(--font-mono);
  min-width: 16px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 10px;
  padding-bottom: calc(12px + var(--sab));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.user-card:hover {
  background: var(--bg-hover);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: calc(100vh - var(--sat) - var(--sab));
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: var(--sat);
  z-index: 40;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 8px;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ============================================================
   AVATAR
============================================================ */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--bg-primary);
  flex-shrink: 0;
  border: 1px solid rgba(201,168,76,0.35);
  letter-spacing: 0.03em;
}

.avatar.lg {
  width: 36px;
  height: 36px;
  font-size: 13px;
  border-radius: 9px;
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 9px;
  border-radius: 6px;
}

/* ============================================================
   LIVE BADGE
============================================================ */
.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s infinite;
}

.live-text {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ============================================================
   NOTIF DOT
============================================================ */
.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

/* ============================================================
   NOTIFICATION BUTTON
============================================================ */
.notif-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.notif-btn:hover { background: var(--bg-hover); }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  border: 1.5px solid var(--bg-secondary);
  line-height: 1;
}

/* ============================================================
   TOPBAR AVATAR BUTTON
============================================================ */
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--bg-primary);
  cursor: pointer;
  border: 1px solid rgba(201,168,76,0.4);
  transition: border-color 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.topbar-avatar:hover { border-color: var(--gold); opacity: 0.9; }

/* ============================================================
   PERIOD TABS
============================================================ */
.period-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 3px;
}

.period-tab {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  letter-spacing: 0.03em;
  user-select: none;
  border: none;
  background: transparent;
  font-family: var(--font-body);
}

.period-tab:hover { color: var(--text-primary); }

.period-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* ============================================================
   PANELS
============================================================ */
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.panel-body { padding: 18px; }

/* ============================================================
   METRIC CARDS
============================================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.metric-card:hover { border-color: var(--border-light); }

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.metric-card.gold::before   { background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.metric-card.teal::before   { background: linear-gradient(90deg, transparent, var(--teal), transparent); }
.metric-card.green::before  { background: linear-gradient(90deg, transparent, var(--green), transparent); }
.metric-card.red::before    { background: linear-gradient(90deg, transparent, var(--red), transparent); }
.metric-card.blue::before   { background: linear-gradient(90deg, transparent, var(--blue), transparent); }

.metric-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}

.metric-value.positive { color: var(--green); }
.metric-value.negative { color: var(--red); }

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.metric-change.up   { color: var(--green); }
.metric-change.down { color: var(--red); }

.metric-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ============================================================
   STAT ROWS
============================================================ */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }

.stat-key  { font-size: 12px; color: var(--text-secondary); }
.stat-val  { font-size: 12px; font-family: var(--font-mono); color: var(--text-primary); font-weight: 500; }
.stat-val.pos  { color: var(--green); }
.stat-val.neg  { color: var(--red); }
.stat-val.gold { color: var(--gold); }

/* ============================================================
   LIMIT ROWS
============================================================ */
.limit-row { margin-bottom: 14px; }
.limit-row:last-child { margin-bottom: 0; }

.limit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.limit-label { font-size: 12px; color: var(--text-secondary); }
.limit-val   { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); }

.limit-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.limit-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease, background-color 0.3s ease;
}

/* couleurs dynamiques selon avancement */
.limit-fill[data-pct="low"]    { background: var(--green); }
.limit-fill[data-pct="medium"] { background: var(--warning); }
.limit-fill[data-pct="high"]   { background: var(--danger); }

/* ============================================================
   STREAK BOXES
============================================================ */
.streak-boxes {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.streak-box {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
}

.streak-box.win { background: var(--green); opacity: 0.85; }
.streak-box.loss { background: var(--red); opacity: 0.85; }
.streak-box.neutral { background: var(--border-light); }

/* ============================================================
   HEATMAP
============================================================ */
.heatmap-grid {
  display: grid;
  grid-template-columns: 40px repeat(5, 1fr);
  gap: 3px;
}

.heatmap-label {
  font-size: 9px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  font-family: var(--font-mono);
}

.heatmap-header {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 4px;
  font-family: var(--font-mono);
}

.heatmap-cell {
  height: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: default;
  transition: opacity 0.2s;
}

.heatmap-cell:hover { opacity: 0.8; }

/* ============================================================
   SETUP PERFORMANCE BARS
============================================================ */
.setup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.setup-row:last-child { margin-bottom: 0; }

.setup-name {
  font-size: 11px;
  color: var(--text-secondary);
  width: 130px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setup-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.setup-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.setup-val {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 50px;
  text-align: right;
}

/* ============================================================
   SESSION BARS
============================================================ */
.session-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.session-row:last-child { margin-bottom: 0; }

.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.session-label {
  font-size: 11px;
  color: var(--text-secondary);
  width: 70px;
}

.session-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.session-bar {
  height: 100%;
  border-radius: 3px;
  opacity: 0.75;
  transition: width 0.5s ease;
}

.session-pct {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 36px;
  text-align: right;
}

/* ============================================================
   DIVIDER
============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ============================================================
   INSIGHT CARDS
============================================================ */
.insight-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  transition: border-color 0.2s;
}

.insight-card:last-child { margin-bottom: 0; }
.insight-card:hover { border-color: var(--border-light); }

.insight-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.insight-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.insight-highlight {
  color: var(--gold);
  font-family: var(--font-mono);
}

/* ============================================================
   SETUP CARDS (Playbook)
============================================================ */
.setup-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 14px;
}

.setup-card:last-child { margin-bottom: 0; }
.setup-card:hover { border-color: var(--gold-dark); background: var(--bg-hover); }

.setup-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gold-glow);
  border: 1px solid rgba(201,168,76,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setup-card-body { flex: 1; min-width: 0; }

.setup-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setup-card-meta { font-size: 11px; color: var(--text-muted); }

.setup-card-stats { display: flex; gap: 16px; flex-shrink: 0; }

.setup-stat { text-align: right; }

.setup-stat-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.setup-stat-key {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ============================================================
   WALLET HERO
============================================================ */
.wallet-hero {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--gold-glow) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wallet-balance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.wallet-balance {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1;
}

.wallet-balance span { color: var(--gold); }

/* ============================================================
   AI BANNER
============================================================ */
.ai-banner {
  padding: 14px 18px;
  background: var(--gold-dim);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ai-banner-title { font-size: 13px; font-weight: 600; color: var(--gold); }
.ai-banner-sub   { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   EMPTY STATE
============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   TABLES
============================================================ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

thead tr { border-bottom: 1px solid var(--border); }

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}

th.sortable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

th.sortable:hover { color: var(--text-primary); }

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   GAUGE
============================================================ */
.gauge-wrap { display: flex; align-items: center; gap: 16px; }

.gauge-circle {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}

.gauge-sublabel {
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* ============================================================
   ANIMATIONS GLOBALES
============================================================ */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-right {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes float-badge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.fade-in  { animation: fade-in 0.3s ease forwards; }
.fade-up  { animation: fade-up 0.6s ease forwards; }

/* Reveal au scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   NOTIFICATION PANEL
============================================================ */
.notif-panel {
  position: fixed;
  top: calc(var(--sat) + 60px);
  right: 14px;
  width: 300px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  z-index: 150;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: fade-in 0.2s ease forwards;
}

.notif-panel.open { display: block; }

.notif-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-panel-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-panel-action {
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  background: none;
  border: none;
  padding: 0;
}

.notif-panel-action:hover { color: var(--gold); }

.notif-item {
  display: flex;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }

.notif-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 4px;
}

.notif-item-dot.read { background: var(--text-muted); }

.notif-item-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notif-item-time {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ============================================================
   PROFILE DROPDOWN
============================================================ */
.profile-dropdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,9,13,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
}

.profile-dropdown-overlay.open { display: block; }

.profile-dropdown {
  position: fixed;
  top: calc(var(--sat) + 60px);
  right: 14px;
  width: 240px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  z-index: 201;
  display: none;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
  overflow: hidden;
}

.profile-dropdown.open {
  display: block;
  animation: dropdown-in 0.2s ease forwards;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.dropdown-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.dropdown-user-plan {
  font-size: 10px;
  color: var(--gold);
  font-family: var(--font-mono);
  margin-top: 1px;
}

.dropdown-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

.dropdown-theme-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-items { padding: 6px; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-dim); color: var(--danger); }

.dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================================================
   BOTTOM SHEET
============================================================ */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,9,13,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.detail-overlay.open { display: flex; }

.detail-sheet {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding-bottom: calc(16px + var(--sab));
  animation: slide-up 0.28s cubic-bezier(0.32,0.72,0,1) forwards;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.detail-handle {
  width: 36px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 12px auto 0;
}

.detail-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.detail-sheet-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-sheet-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.detail-sheet-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.detail-sheet-body { padding: 18px 20px; }

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }

.detail-key  { font-size: 12px; color: var(--text-secondary); }
.detail-val  { font-size: 12px; font-family: var(--font-mono); color: var(--text-primary); font-weight: 500; }
.detail-val.pos  { color: var(--green); }
.detail-val.neg  { color: var(--red); }
.detail-val.gold { color: var(--gold); }

/* ============================================================
   TABS (Wallet)
============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-body);
}

.tab:hover { color: var(--text-primary); }

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ============================================================
   MISC LAYOUT GRIDS
============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-7-5 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ============================================================
   RESPONSIVE — MOBILE
============================================================ */
@media (max-width: 1200px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2  { grid-template-columns: 1fr; }
  .grid-7-5 { grid-template-columns: 1fr; }
  .grid-3  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }

  .main-content { margin-left: 0; }

  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-title { font-size: 14px; }
  .topbar-subtitle { display: none; }

  .metrics-grid { grid-template-columns: 1fr 1fr; }

  .page-content {
    padding: 16px 14px;
    padding-bottom: calc(80px + var(--sab));
  }

  .wallet-hero { flex-direction: column; align-items: flex-start; }
  .wallet-balance { font-size: 28px; }
}