/* ================================================================
   FINANCETRACKER - Material Design 3 + Apple Liquid Glass
   Modern Finance Dashboard
   ================================================================ */

:root {
  /* ============================================
     MATERIAL DESIGN 3 COLOR SYSTEM (Dark Mode Adapted)
     ============================================ */
  
  /* Primary Palette - Neon Blue/Purple Accent */
  --md-primary-40: #3b82f6;
  --md-primary-60: #60a5fa;
  --md-primary-70: #93c5fd;
  --md-primary-80: #bfdbfe;
  --md-primary-90: #dbeafe;
  
  /* Success - Neon Green */
  --md-success-50: #10b981;
  --md-success-60: #34d399;
  --md-success-70: #6ee7b7;
  --md-success-80: #a7f3d0;
  --md-success-90: #d1fae5;
  --md-success-container: rgba(16, 185, 129, 0.2);
  
  /* Error - Neon Pink/Red */
  --md-error-50: #ef4444;
  --md-error-60: #f87171;
  --md-error-70: #fca5a5;
  --md-error-80: #fecaca;
  --md-error-container: rgba(239, 68, 68, 0.2);
  
  /* Warning - Amber */
  --md-warning-50: #f59e0b;
  --md-warning-60: #fbbf24;
  --md-warning-container: rgba(245, 158, 11, 0.2);
  
  /* Neutral (Light Theme) */
  --md-neutral-10: #f8fafc;
  --md-neutral-20: #f1f5f9;
  --md-neutral-40: #cbd5e1;
  --md-neutral-50: #94a3b8;
  --md-neutral-60: #64748b;
  --md-neutral-80: #334155;
  --md-neutral-90: #1e293b;
  --md-neutral-95: #0f172a;
  --md-neutral-99: #020617;
  
  /* Neutral Variant */
  --md-neutral-variant-60: #94a3b8;
  --md-neutral-variant-80: #e2e8f0;
  --md-neutral-variant-90: #f8fafc;
  
  /* ============================================
     MINIMALISTIC SURFACES (Light Mode)
     ============================================ */
  --glass-bg: #ffffff;
  --glass-bg-strong: #ffffff;
  --glass-bg-subtle: #f8fafc;
  --glass-bg-sidebar: #ffffff;
  --glass-border: #e2e8f0;
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  
  /* ============================================
     SEMANTIC TOKENS
     ============================================ */
  --color-background: #f8fafc;
  --color-surface: var(--glass-bg);
  --color-surface-strong: var(--glass-bg-strong);

  --color-border: var(--glass-border);
  
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  
  --color-primary: var(--md-primary-40);
  --color-primary-hover: var(--md-primary-60);
  
  --color-success: var(--md-success-50);
  --color-error: var(--md-error-50);
  --color-warning: var(--md-warning-50);

  --color-profit: #10b981;
  --color-expense: #ef4444;
  
  /* ============================================
     SHADOWS & ELEVATION
     ============================================ */
  --elevation-0: none;
  --elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --elevation-2: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --elevation-3: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --elevation-4: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Glass elevation with blur */
  --glass-elevation: var(--glass-shadow);
  
  /* ============================================
     TYPOGRAPHY
     ============================================ */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-family-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Type Scale */
  --text-display: 42px;
  --text-headline-large: 32px;
  --text-headline: 28px;
  --text-title-large: 22px;
  --text-title: 18px;
  --text-body-large: 16px;
  --text-body: 14px;
  --text-label: 12px;
  --text-caption: 11px;
  
  /* Font Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  
  /* ============================================
     SPACING SYSTEM
     ============================================ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* ============================================
     BORDER RADIUS
     ============================================ */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* ============================================
     ANIMATION
     ============================================ */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================================================================
   BASE STYLES
   ================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-background);
  min-height: 100vh;
}

/* ================================================================
   LAYOUT
   ================================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ================================================================
   SIDEBAR - Liquid Glass Design
   ================================================================ */
.sidebar {
  width: 280px;
  background: var(--glass-bg-sidebar);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
  z-index: 1000;
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%);
}

.sidebar-title {
  font-size: var(--text-title-large);
  font-weight: var(--weight-bold);
  background: linear-gradient(135deg, var(--md-primary-60) 0%, var(--md-primary-80) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-item:hover {
  color: var(--color-primary);
  transform: translateX(4px);
}

.nav-item:hover::before {
  opacity: 1;
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, var(--md-primary-60) 0%, var(--md-primary-40) 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transform: translateX(0);
}

.nav-item.active::before {
  opacity: 0;
}

.nav-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: var(--space-8);
  max-width: 1600px;
}

.view-container {
  display: none;
}

.view-container.active {
  display: block;
  animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  margin-bottom: var(--space-8);
}

.view-title {
  font-size: var(--text-headline);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.view-subtitle {
  font-size: var(--text-body-large);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

/* ================================================================
   METRICS GRID - Glass Cards
   ================================================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.metric-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--glass-elevation);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.15);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-card.metric-income {
  color: var(--md-success-60);
}

.metric-card.metric-expense {
  color: var(--md-error-50);
}

.metric-card.metric-profit {
  color: var(--md-primary-60);
}

.metric-card.metric-savings {
  color: var(--md-primary-70);
}

.metric-label {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.metric-value {
  font-size: var(--text-headline-large);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.metric-value.positive {
  color: var(--md-success-60) !important;
}

.metric-value.negative {
  color: var(--md-error-50) !important;
}

.metric-value.income-color {
  color: var(--md-success-60) !important;
}

.metric-value.expense-color {
  color: var(--md-error-50) !important;
}

.metric-change {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.metric-change.positive {
  color: var(--md-success-60);
}

.metric-change.negative {
  color: var(--md-error-50);
}

.metric-info {
  font-size: var(--text-label);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
}

/* ================================================================
   CONTENT GRID
   ================================================================ */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

/* ================================================================
   CARDS - Glass Design
   ================================================================ */
.card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--glass-elevation);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.15);
}

.card-title {
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.chart-card {
  min-height: 400px;
}

.chart-card-large {
  grid-column: 1 / -1;
  min-height: 450px;
}

.chart-container {
  position: relative;
  height: 320px;
}

.chart-container-large {
  position: relative;
  height: 550px;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.chart-total {
  text-align: center;
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-body-large);
  font-weight: var(--weight-semibold);
}

/* ================================================================
   TREEMAP (div-based, no canvas overflow issues)
   ================================================================ */
.treemap-container {
  width: 100%;
  padding-bottom: 8px;
}

.treemap-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.treemap-cell {
  position: absolute;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
  transition: filter 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  padding: 4px;
}

.treemap-cell:hover {
  filter: brightness(1.12);
  z-index: 2;
}

.treemap-name {
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
}

.treemap-value {
  color: rgba(255,255,255,0.88);
  text-align: center;
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
}

/* ================================================================
   CATEGORY LIST & TABLES
   ================================================================ */
.category-list {
  max-height: 400px;
  overflow-y: auto;
}

.category-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.category-table thead th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: var(--space-3) var(--space-2);
  text-align: left;
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.category-table tbody tr {
  transition: background-color var(--transition-fast);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.category-table tbody tr:hover {
  background: rgba(0, 163, 154, 0.05);
}

.category-table tbody td {
  padding: var(--space-3) var(--space-2);
  font-size: var(--text-body);
}

.category-table tbody td:first-child {
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.budget-status {
  display: inline-block;
  font-size: 16px;
}

.budget-status.over-budget {
  color: var(--md-error-50);
}

.budget-status.under-budget {
  color: var(--md-success-60);
}

/* ================================================================
   TRANSACTIONS LIST
   ================================================================ */
.transactions-list {
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(4px);
  box-shadow: var(--elevation-2);
}

.transaction-info {
  flex: 1;
}

.transaction-description {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.transaction-meta {
  font-size: var(--text-label);
  color: var(--color-text-secondary);
}

.transaction-amount {
  font-size: var(--text-body-large);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.transaction-amount.income {
  color: var(--md-success-60);
  background: var(--md-success-container);
}

.transaction-amount.expense {
  color: var(--md-error-50);
  background: var(--md-error-container);
}

/* ================================================================
   ACCOUNTS
   ================================================================ */
.large-metric {
  grid-column: 1 / -1;
  margin-bottom: var(--space-6);
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
}

.account-item {
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(0, 163, 154, 0.05) 0%, rgba(36, 191, 181, 0.05) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 163, 154, 0.2);
  transition: all var(--transition-base);
}

.account-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
  border-color: var(--md-primary-60);
}

.account-name {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.account-balance {
  font-size: var(--text-title-large);
  font-weight: var(--weight-bold);
  color: var(--md-primary-60);
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   ACCOUNT GROWTH SECTION
   ================================================================ */
.growth-section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.growth-month-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.month-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex: 1;
}

.month-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: var(--text-label-small);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: 1px solid var(--md-primary-60);
  background: transparent;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
}

.month-pill:hover {
  background: rgba(0, 163, 154, 0.1);
  color: var(--md-primary-60);
}

.month-pill.active {
  background: var(--md-primary-60);
  color: #fff;
  border-color: var(--md-primary-60);
}

.card-description {
  font-size: var(--text-body-small);
  color: var(--color-text-tertiary);
  margin: calc(-1 * var(--space-3)) 0 var(--space-4);
}

/* Growth Table */
.growth-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.growth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body-small);
}

.growth-table th {
  padding: var(--space-3) var(--space-4);
  text-align: right;
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  background: var(--glass-bg-subtle);
}

.growth-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--glass-bg-subtle);
  z-index: 1;
}

.growth-table td {
  padding: var(--space-3) var(--space-4);
  text-align: right;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.growth-table td:first-child {
  text-align: left;
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  position: sticky;
  left: 0;
  background: var(--glass-bg);
  z-index: 1;
}

.growth-table tr:hover td {
  background: rgba(0, 163, 154, 0.04);
}

.growth-table tr:hover td:first-child {
  background: rgba(0, 163, 154, 0.06);
}

.growth-table .row-total td {
  font-weight: var(--weight-bold);
  border-top: 2px solid var(--color-border);
  background: var(--glass-bg-subtle);
}

.growth-table .row-total td:first-child {
  background: var(--glass-bg-subtle);
}

.growth-positive {
  color: var(--color-profit);
}

.growth-negative {
  color: var(--color-expense);
}

.growth-zero {
  color: var(--color-text-tertiary);
}

/* ================================================================
   UPLOAD VIEW
   ================================================================ */
.upload-container {
  max-width: 800px;
  margin: 0 auto;
}

.upload-card-large {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 2px dashed var(--md-primary-60);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.upload-card-large::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 163, 154, 0.1) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.upload-card-large:hover {
  border-color: var(--md-primary-70);
  box-shadow: 0 0 0 4px rgba(0, 163, 154, 0.1);
  transform: translateY(-4px);
}

.upload-card-large:hover::before {
  opacity: 1;
}

.upload-icon-large {
  font-size: 64px;
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 4px 8px rgba(0, 163, 154, 0.2));
}

.upload-title {
  font-size: var(--text-title-large);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.upload-description {
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.file-input {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  font-family: var(--font-family);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--md-primary-60) 0%, var(--md-primary-70) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 163, 154, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 163, 154, 0.4);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: rgba(0, 163, 154, 0.1);
  color: var(--md-primary-60);
  border: 2px solid var(--md-primary-60);
}

.btn--secondary:hover {
  background: rgba(0, 163, 154, 0.2);
  transform: translateY(-2px);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-body-large);
}

.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-label-small);
  border-radius: var(--radius-md);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover {
  background: rgba(0, 163, 154, 0.08);
  color: var(--md-primary-60);
  border-color: var(--md-primary-60);
}

.upload-status-container {
  margin-top: var(--space-6);
}

.upload-status {
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  padding: var(--space-3);
}

.upload-status.success {
  color: var(--md-success-60);
  font-weight: var(--weight-semibold);
}

.upload-progress {
  margin-top: var(--space-4);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 163, 154, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--md-primary-60), var(--md-primary-70));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 163, 154, 0.5);
}

.progress-text {
  font-size: var(--text-label);
  color: var(--color-text-secondary);
  text-align: center;
}

.upload-info {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: linear-gradient(135deg, rgba(0, 163, 154, 0.05) 0%, rgba(36, 191, 181, 0.05) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 163, 154, 0.2);
}

.upload-info h4 {
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.upload-info ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.upload-info li {
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  padding-left: var(--space-6);
  position: relative;
}

.upload-info li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--md-success-60);
  font-weight: var(--weight-bold);
}

.upload-note {
  margin-top: var(--space-4);
  font-size: var(--text-label);
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* ================================================================
   FORM CONTROLS
   ================================================================ */
.view-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.form-label {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.form-control {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 2px solid rgba(0, 163, 154, 0.2);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  font-family: var(--font-family);
}

.form-control:focus {
  outline: none;
  border-color: var(--md-primary-60);
  box-shadow: 0 0 0 4px rgba(0, 163, 154, 0.1);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2300a39a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

/* ================================================================
   BEST/WORST MONTHS
   ================================================================ */
.month-highlight {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  border: 2px solid;
  transition: all var(--transition-base);
}

.month-highlight.best {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
  border-color: var(--md-success-60);
}

.month-highlight.worst {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  border-color: var(--md-error-50);
}

.month-highlight:hover {
  transform: translateX(4px);
  box-shadow: var(--elevation-2);
}

.month-highlight-label {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.month-highlight-name {
  font-size: var(--text-body-large);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.month-highlight-amount {
  font-size: var(--text-title-large);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}

.month-highlight.best .month-highlight-amount {
  color: var(--md-success-60);
}

.month-highlight.worst .month-highlight-amount {
  color: var(--md-error-50);
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-text-tertiary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-text {
  font-size: var(--text-body-large);
  color: var(--color-text-secondary);
}

/* ================================================================
   SCROLLBAR STYLING
   ================================================================ */
.transactions-list::-webkit-scrollbar,
.category-list::-webkit-scrollbar {
  width: 8px;
}

.transactions-list::-webkit-scrollbar-track,
.category-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
}

.transactions-list::-webkit-scrollbar-thumb,
.category-list::-webkit-scrollbar-thumb {
  background: rgba(0, 163, 154, 0.3);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.transactions-list::-webkit-scrollbar-thumb:hover,
.category-list::-webkit-scrollbar-thumb:hover {
  background: var(--md-primary-60);
}

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */
@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 240px;
  }
  
  .main-content {
    margin-left: 240px;
    padding: var(--space-4);
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-value {
    font-size: var(--text-headline);
  }
}

@media (max-width: 640px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}
