* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
  --bg: #0a0a0a;
  --card: #151515;
  --card-border: #262626;
  --text: #ffffff;
  --muted: #a1a1aa;
  --orange: #f97316;
  --orange-hover: #ea580c;
  --red: #ef4444;
  --green: #22c55e;
  --blue: #3b82f6;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.topbar {
  background: rgba(25, 25, 25, 0.95);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: #222;
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
}

.icon-btn:hover {
  background: #2c2c2c;
}

/* Auth Page */
.auth-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at bottom, rgba(249, 115, 22, 0.14), transparent 60%);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header .brand {
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  color: #e4e4e7;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: #0c0c0c;
  border: 1px solid #2e2e32;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--orange);
}

.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-orange {
  background: var(--orange);
  color: white;
}

.btn-orange:hover {
  background: var(--orange-hover);
}

.btn-orange:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-switch a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.alert {
  padding: 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: none;
}

.alert.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert.success {
  display: block;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

/* Container & Dashboard utilities */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 18px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
/* Dashboard & Pages internes */
.balance-card {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #111;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.balance-card .greeting {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.9;
}

.balance-card .sub {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 2px;
}

.balance-card .amount {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 8px;
}

.wallet-badge {
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
  border-radius: 12px;
  font-size: 1.5rem;
  text-decoration: none;
  color: #111;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}

.stat-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.action-card {
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  text-decoration: none;
  color: white;
  display: block;
  border: 1px solid var(--card-border);
  transition: transform 0.15s;
}

.action-card:hover {
  transform: translateY(-2px);
}

.action-card.primary {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
}

.action-card.secondary {
  background: var(--card);
}

.action-card .title {
  font-weight: 700;
  font-size: 1rem;
  margin-top: 8px;
}

.action-card .desc {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 3px;
}

.legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-desc {
  font-size: 0.9rem;
  font-weight: 500;
}

.tx-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}

.tx-amount.plus {
  color: var(--green);
  font-weight: 700;
}

.tx-amount.minus {
  color: var(--orange);
  font-weight: 700;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-paid { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }