/* ==========================================================================
   Tracker PF — Design System Fintech Épuré & Minimaliste (Apple / Stripe style)
   ========================================================================== */

:root {
  /* Palette de fond & surfaces (Slate sombre profond & noble) */
  --bg-main: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #0f172a;
  --bg-subtle: #1e293b;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(15, 23, 42, 0.85);
  --border: rgba(255, 255, 255, 0.09);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-active: rgba(56, 189, 248, 0.45);

  /* Typographie & Couleurs de texte */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-numeric: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accents Fintech sobres */
  --primary: #38bdf8;
  --accent: #38bdf8;
  --primary-hover: #7dd3fc;
  --success: #34d399;
  --success-color: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-color: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-color: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);

  /* Rayons & Ombres légères */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 40px;
  }
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* ==========================================================================
   Barre de Navigation Flottante & Verre Dépoli (Glassmorphism)
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text-main);
}
.nav-brand img {
  width: 26px;
  height: 26px;
}

.nav-links {
  display: none;
  gap: 12px;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
    align-items: center;
  }
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-size: 13.5px;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #0f172a;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  z-index: 1000;
  margin-top: 6px;
}
.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content {
  display: block;
}
.nav-dropdown-item {
  color: var(--text-muted);
  padding: 8px 12px;
  display: block;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.nav-dropdown-item:hover, .nav-dropdown-item.active {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.06);
}

/* User pill & avatar */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 13px;
  color: var(--text-main);
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================
   Navigation Mobile Épurée
   ========================================== */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--bg-glass);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 100;
}
@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}
.mobile-nav-item.active {
  color: var(--primary);
}

/* ==========================================
   Conteneur & Typographie
   ========================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* Onglets Segmentés (Apple / Linear style) */
.tab-container {
  display: inline-flex;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 28px;
  gap: 4px;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover {
  color: var(--text-main);
}
.tab-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   Cartes & Panneaux Épurés (Zéro bordure lourde)
   ========================================== */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Panneau Héro Net Worth (Minimalist Apple Style) */
.hero-wealth-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero-wealth-card::before {
  content: "";
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(56, 189, 248, 0) 70%);
  pointer-events: none;
}
.hero-net-worth {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.2px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 12px 0;
}
@media (min-width: 768px) {
  .hero-net-worth {
    font-size: 48px;
  }
}

/* Grille de Métriques Minimaliste */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.metric-item {
  display: flex;
  flex-direction: column;
}
.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.metric-num {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}
.metric-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ==========================================
   Tableaux de Données Financières (Dense & Tabulaire)
   ========================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
td {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
  transition: background 0.15s ease;
}
tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================
   Boutons & Contrôles
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12.5px;
}
.btn-primary {
  background-color: #0ea5e9;
  color: #fff;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}
.btn-primary:hover {
  background-color: #38bdf8;
  color: #fff;
}
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Badges subtils */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-secondary {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Classes utilitaires de couleurs financières */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }

/* Formulaires & Contrôles Épurés (Input / Select) */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.15s ease;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Badges financiers */
.badge-pea {
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-cto {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge-success {
  background-color: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.badge-danger {
  background-color: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.badge-warning {
  background-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Alertes & Encadrés d'Information Subtils */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.02);
}
.alert-info {
  background-color: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
  color: #e0f2fe;
}
.alert-warning {
  background-color: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.2);
  color: #fef3c7;
}

