:root {
  --bg: #F8F9FA;
  --text: #212529;
  --card-bg: #FFFFFF;
  --sidebar-bg: #F0F5FF;
  --primary: #0A2463;
  --secondary: #61A0AF;
  --accent: #3E92CC;
  --border: #E9ECEF;
  --shadow: 0 4px 12px rgba(0,0,0,0.05);
  --danger: #E53E3E;
  --success: #38A169;
}

[data-theme="dark"] {
  --bg: #121212;
  --text: #E0E0E0;
  --card-bg: #1E1E1E;
  --sidebar-bg: #2A2A2A;
  --border: #333;
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header h2 {
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--primary);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
  background-color: rgba(10, 36, 99, 0.1);
  color: var(--primary);
}

.nav-item.active {
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

.sidebar-footer {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.security-badge {
  font-size: 0.85rem;
  margin-bottom: 16px;
  color: var(--success);
}

.btn-theme {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.2s;
}

.btn-theme:hover {
  transform: rotate(20deg);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 24px;
  transition: margin-left 0.3s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.balance-highlight {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-bottom: 16px;
  font-weight: 600;
}

.balance {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}

/* Carte bancaire stylisée */
.credit-card .card-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 16px;
  position: relative;
  min-height: 180px;
}

.card-chip {
  width: 40px;
  height: 30px;
  background: gold;
  border-radius: 4px;
  position: absolute;
  top: 24px;
  right: 24px;
}

.card-number {
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin: 40px 0 16px;
}

.card-name, .card-expiry {
  font-size: 0.9rem;
}

.card-logo {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-weight: 700;
  font-size: 1.2rem;
}

/* Transactions */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.transaction {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.transaction:last-child {
  border-bottom: none;
}

.amount.negative {
  color: var(--danger);
}

.amount.positive {
  color: var(--success);
}

.date {
  color: #888;
  font-size: 0.85rem;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 40px 0;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #081d4e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(10, 36, 99, 0.2);
}

.btn-secondary {
  background: none;
  border: 2px dashed var(--accent);
  color: var(--accent);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: #888;
  font-size: 0.9rem;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 80%;
    max-width: 300px;
    z-index: 200;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .menu-toggle {
    display: block;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    width: 90%;
    max-width: 400px;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }

  .overlay.active {
    opacity: 1;
    visibility: visible;
  }
}