/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-bg: #1a1d1f;
  --sidebar-text: #9ca3af;
  --sidebar-active: #14b8a6;
  --page-bg: #f5f7fa;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --teal: #14b8a6;
  --teal-dark: #0d9488;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--page-bg);
}

a { text-decoration: none; color: inherit; }

/* Utilities */
.text-teal { color: var(--teal); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* DASHBOARD LAYOUT */
.dashboard-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR - EXACT MATCH */
.sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--sidebar-text);
  transition: all 0.2s;
  gap: 12px;
  font-size: 15px;
  position: relative;
}

.nav-item .icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(20, 184, 166, 0.05);
  color: var(--teal);
}

.nav-item.active {
  background: rgba(20, 184, 166, 0.1);
  color: var(--teal);
  border-left: 3px solid var(--teal);
  font-weight: 500;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #23262a;
  border-radius: 8px;
  margin-top: 12px;
}

.profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  flex: 1;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.view-profile {
  display: block;
  font-size: 12px;
  color: var(--sidebar-text);
  margin-top: 2px;
}

.menu-dots {
  color: var(--sidebar-text);
  font-size: 20px;
  cursor: pointer;
}

/* MAIN CONTENT AREA */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-header {
  background: #fff;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left h1 {
  display: inline;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-date {
  margin-left: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.header-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.notif-bell {
  position: relative;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 16px;
  width: 300px;
}

.search-box input {
  border: none;
  outline: none;
  padding: 10px 8px;
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.search-box button {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
}

/* CONTENT SCROLL AREA */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* DASHBOARD GRID - 3 COLUMNS */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

/* CARD COMPONENT */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.view-all {
  font-size: 14px;
  color: var(--teal);
}

/* TOTAL BALANCE */
.total-balance {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.account-selector {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  cursor: pointer;
}

/* VIRTUAL CARD */
.virtual-card {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  margin: 20px 0;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-type small {
  display: block;
  opacity: 0.8;
  font-size: 12px;
}

.card-type strong {
  display: block;
  font-size: 16px;
  margin-top: 4px;
}

.card-provider {
  font-size: 24px;
  font-weight: 700;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-number {
  font-size: 18px;
  letter-spacing: 2px;
}

.card-balance {
  font-size: 22px;
  font-weight: 700;
}

.card-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* GOALS CARD */
.goal-amount {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin: 16px 0;
}

.goal-stats {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 20px 0;
}

.goal-stats-left {
  flex: 1;
}

.stat-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-item .icon {
  font-size: 24px;
}

.stat-item .info small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.stat-item .info strong {
  display: block;
  font-size: 18px;
  color: var(--text-primary);
  margin-top: 2px;
}

.progress-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: transparent;
  stroke: #e5e7eb;
  stroke-width: 10;
}

.progress-ring circle.progress {
  stroke: var(--teal);
  stroke-dasharray: 314; /* 2 * pi * r (50) */
  stroke-dashoffset: 314; /* Will be set via JS */
  transition: stroke-dashoffset 0.5s ease;
}

.ring-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.target-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* BAR CHART */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-filter {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.color-box.teal { background: var(--teal); }
.color-box.gray { background: #d1d5db; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 8px 16px 40px; /* Add padding for Y-axis */
  position: relative;
}

.y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40px;
}

.y-axis div {
  position: absolute;
  left: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.bar-pair {
  width: 100%;
  display: flex;
  gap: 2px;
  align-items: flex-end;
}

.bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
}

.bar.this-week { background: var(--teal); }
.bar.last-week { background: #d1d5db; }

.x-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* PAYMENT LIST */
.payment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.payment-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 50px;
}

.payment-date .month {
  font-size: 11px;
  color: var(--text-secondary);
}

.payment-date .day {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.payment-icon { font-size: 32px; }

.payment-info { flex: 1; }

.payment-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
}

.payment-info small {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.payment-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* BOTTOM SECTION - 2 COLUMNS */
.bottom-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* TRANSACTION TABS */
.transaction-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.tab {
  background: transparent;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab:hover { color: var(--text-primary); }

.tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 500;
}

/* TRANSACTION LIST */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.transaction-item:hover { background: #f9fafb; }

.txn-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.txn-info { flex: 1; }

.txn-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
}

.txn-info small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.txn-amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 16px;
}

.txn-date {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
}

/* EXPENSE BREAKDOWN */
.expense-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.expense-card {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  position: relative;
}

.expense-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.expense-name {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.expense-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.expense-change { font-size: 12px; }
.expense-change.up { color: var(--success); }
.expense-change.down { color: var(--danger); }
.expense-change.same { color: var(--text-muted); }

.expense-arrow {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.compare-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* UI Elements Standard Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; color: var(--text-primary); }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 14px; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--teal); }
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; text-align: center; cursor: pointer; border: none; transition: .2s; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover { background: #f9fafb; }
.btn-danger { background: var(--danger); color: #fff; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--border-color); text-align: left; }
.table th { color: var(--text-secondary); font-weight: 500; font-size: 13px; }

/* RESPONSIVE */
@media (max-width: 1400px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid > :nth-child(3) { grid-column: span 2; }
}

@media (max-width: 1024px) {
  .sidebar { width: 70px; }
  .sidebar-logo span, .nav-item span:not(.icon), .user-name, .view-profile { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > :nth-child(3) { grid-column: auto; }
  .bottom-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; height: 60px; }
  .sidebar-logo { display: none; }
  .sidebar-nav { display: flex; padding: 0; }
  .nav-item { padding: 0 15px; }
  .sidebar-footer { display: none; }
}
