/* =============================================
   HALO — Design System
   Couleurs, typographie, composants
   ============================================= */

/* --- Variables mode clair (défaut) --- */
:root,
[data-theme="light"] {
  --bg:        #ffffff;
  --bg-panel:  #fafbfc;
  --border:    #eef0f3;
  --ink:       #0b1220;
  --ink-soft:  #9aa3ad;
  --blue:      #007AFF;
  --blue-bg:   #e8f2ff;
  --green:     #1cb35c;
  --green-bg:  #eaf6ee;
  --orange:    #b3690a;
  --orange-bg: #fff4e5;
  --shadow:    rgba(10, 30, 60, .06);
}

/* --- Variables mode sombre --- */
[data-theme="dark"] {
  --bg:        #0b0f17;
  --bg-panel:  #111722;
  --border:    #1c212c;
  --ink:       #f4f6f8;
  --ink-soft:  #6b7480;
  --blue:      #3d9bff;
  --blue-bg:   #0d2040;
  --green:     #34d47a;
  --green-bg:  #0d2e1a;
  --orange:    #f5a623;
  --orange-bg: #2a1c06;
  --shadow:    rgba(0, 0, 0, .3);
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  transition: background .2s, color .2s;
}

a { text-decoration: none; color: inherit; }

/* =============================================
   NAVIGATION HORIZONTALE
   ============================================= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 40px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.nav-brand .ring {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 3.5px solid var(--blue);
  transition: border-color .2s;
}

.nav-brand span {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-item {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background .15s, color .15s;
}

.nav-item:hover {
  background: var(--border);
  color: var(--ink);
}

.nav-item.active {
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px var(--shadow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}

.theme-toggle:hover { color: var(--ink); background: var(--border); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-role { font-size: 11.5px; color: var(--ink-soft); }

/* =============================================
   CONTENU PRINCIPAL
   ============================================= */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px;
}

/* =============================================
   DASHBOARD — EN-TÊTE SOLDE
   ============================================= */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 48px;
}

.balance-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.balance-amount {
  font-family: 'Inter Tight', sans-serif;
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.balance-amount .cents {
  font-size: 26px;
  color: var(--ink-soft);
  font-weight: 500;
}

.balance-change {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.balance-change b { color: var(--ink); font-weight: 600; }

.dashboard-actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* =============================================
   BOUTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}

.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }

.btn-dark {
  background: var(--ink);
  color: var(--bg);
}

.btn-light {
  background: var(--bg-panel);
  color: var(--ink);
  border: 1px solid var(--border);
}

/* =============================================
   TABLEAU DE TRANSACTIONS
   ============================================= */
.section-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
}

.tx-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.tx-table th:last-child,
.tx-table td:last-child { text-align: right; }

.tx-table td {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--ink);
}

.tx-table td.date { color: var(--ink-soft); font-size: 13px; }

.tx-table tr:last-child td { border-bottom: none; }

/* Montants */
.amount { font-weight: 600; white-space: nowrap; }
.amount.positive::before { content: "+ "; }
.amount.negative::before { content: "− "; }

/* =============================================
   BADGES / STATUTS
   ============================================= */
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   }

/* =============================================
   UTILITAIRES
   ============================================= */
.divider {
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

.text-soft { color: var(--ink-soft); }
.text-small { font-size: 12.5px; }
