:root {
  /* Brand Colors */
  --primary: #6C5DD3; /* Vibrant Purple */
  --primary-hover: #5b4cc4;
  --secondary: #0ea5e9;
  --accent: #a78bfa;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1f1d2b; /* Darker Navy/Black */
  --light: #f3f4f6;
  --white: #ffffff;
  --card-bg: #ffffff;
  
  /* Text Colors */
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 3rem;
  
  /* Borders & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --border-light: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f8fafc;
  color: var(--text-main);
  margin: 0;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--white);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 10;
}

.brand {
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.nav-menu {
  flex: 1;
  padding: 0 var(--space-lg);
  list-style: none;
  margin: 0;
}

.nav-item {
  margin-bottom: var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  background-color: #f3f4f6;
  color: var(--primary);
}

.nav-link.active {
  background-color: var(--primary);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(108, 93, 211, 0.3);
}

.nav-link.active .nav-icon {
  background-color: var(--white) !important; /* Force icon to be white in active state */
}

.nav-icon {
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  /* Fallback for no icon */
  border-radius: 4px; 
}

/* Placeholder icons using CSS shapes/colors */
.icon-dashboard { background-color: currentColor; clip-path: polygon(0 0, 40% 0, 40% 40%, 0 40%, 0 0, 60% 0, 100% 0, 100% 60%, 60% 60%, 60% 0, 0 60%, 40% 60%, 40% 100%, 0 100%, 0 60%, 60% 80%, 100% 80%, 100% 100%, 60% 100%, 60% 80%); } /* Simplified grid */

.user-profile {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px; /* Sidebar width */
  padding: var(--space-xl);
  width: calc(100% - 280px);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.actions {
  display: flex;
  gap: var(--space-md);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(229, 231, 235, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

/* Credit Card Visualization */
.credit-card {
  background: linear-gradient(135deg, #2D2D3A 0%, #1F1D2B 100%); /* Dark theme card */
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  color: var(--white);
  position: relative;
  height: 280px; /* Match height of balance card */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.credit-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.credit-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chip {
  width: 45px;
  height: 35px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  border-radius: 6px;
}

.card-brand {
  font-weight: 800;
  font-style: italic;
  font-size: 1.5rem;
}

.card-number {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin: var(--space-lg) 0;
}

.card-details {
  display: flex;
  justify-content: space-between;
}

.card-label {
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.card-value {
  font-size: 1rem;
  font-weight: 600;
}

/* Stats/Balance */
.balance-card {
  background: linear-gradient(135deg, #8B5CF6 0%, #6C5DD3 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 280px;
}

.balance-label {
  opacity: 0.8;
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.balance-amount {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

.balance-pill {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 16px;
  backdrop-filter: blur(4px);
  margin-bottom: 8px;
  width: 100%;
  max-width: 180px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(108, 93, 211, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background-color: var(--light);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light);
  color: var(--text-muted);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

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

.table th {
  text-align: left;
  padding: var(--space-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
}

.table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

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

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.bg-red-light { background-color: #fef2f2; color: #ef4444; }
.bg-green-light { background-color: #ecfdf5; color: #10b981; }
.bg-blue-light { background-color: #eff6ff; color: #3b82f6; }
.bg-purple-light { background-color: #f5f3ff; color: #8b5cf6; }

.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--text-main); font-weight: 600; }

/* Grid Systems */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

/* Quick Transfer */
.avatar-row {
  display: flex;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
  justify-content: space-between;
  padding-bottom: var(--space-xs);
}

.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--light);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.avatar-item:hover .avatar {
  border-color: var(--primary);
}

.avatar-item.add-new .avatar {
  border: 2px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.avatar-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.placeholder-avatar {
  background-color: #e5e7eb;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s;
  background-color: #f9fafb;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background-color: var(--white);
}

.input-with-prefix {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
}

.input-with-prefix .form-input {
  padding-left: 2.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { width: 80px; }
  .brand-name, .nav-text { display: none; }
  .main-content { margin-left: 80px; width: calc(100% - 80px); }
  .nav-link { justify-content: center; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-container { flex-direction: column; }
  .sidebar { 
    width: 100%; 
    height: auto; 
    position: relative; 
    flex-direction: row; 
    justify-content: space-between;
    padding: var(--space-sm);
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .nav-menu { display: none; } /* Mobile Menu would need JS, simpler to hide or simplified */
  .brand { padding: var(--space-sm); }
  .main-content { margin-left: 0; width: 100%; padding: var(--space-md); }
  .header { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .grid-4 { grid-template-columns: 1fr; }
}

/* Card List Layout */
.card-list {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.card-preview {
  width: 340px;
  flex-shrink: 0;
}
