/* ===== CSS Variables ===== */
:root {
  /* Colors - Clean Light theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --accent-primary: #3b82f6;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #3b82f6;
  
  /* Amounts */
  --amount-positive: #16a34a;
  --amount-negative: #dc2626;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* Background pattern - subtle for light theme */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

#app {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ===== Login Screen ===== */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
  animation: fadeSlideUp 0.6s ease;
}

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

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  color: var(--accent-primary);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-header h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.login-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.login-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--accent-danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #ff6b61;
}

.btn.loading .btn-text {
  visibility: hidden;
}

.btn-loader {
  display: none;
}

.btn.loading .btn-loader {
  display: block;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Dashboard ===== */
#dashboard {
  padding: 1.5rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.header-left h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

.transaction-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.header-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.cache-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

#force-refresh-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

/* ===== Filters ===== */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.15s ease;
}

/* Active filter indicator */
.filter-group.filter-active {
  position: relative;
}

.filter-group.filter-active label {
  color: var(--accent-primary);
  font-weight: 600;
}

.filter-group.filter-active label::after {
  content: " •";
  color: var(--accent-primary);
}

.filter-group.filter-active input,
.filter-group.filter-active select,
.filter-group.filter-active .multi-select-display {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
}

/* Multi-Select Component */
.multi-select {
  position: relative;
}

.multi-select-display {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 140px;
  transition: border-color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select-display::after {
  content: "▼";
  font-size: 0.6rem;
  margin-left: 0.5rem;
  opacity: 0.6;
}

.multi-select-display:hover {
  border-color: var(--accent-primary);
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  max-width: 400px;
  max-height: 350px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.multi-select-search {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.multi-select-search input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
}

.multi-select-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.multi-select-action {
  flex: 1;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.multi-select-action:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.multi-select-options {
  flex: 1;
  overflow-y: auto;
  max-height: 250px;
}

.multi-select-option {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s ease;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.multi-select-option:last-child {
  border-bottom: none;
}

.multi-select-option:hover {
  background: var(--bg-hover);
}

.multi-select-option.selected {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid var(--accent-primary);
  padding-left: calc(0.75rem - 3px);
}

.multi-select-option.selected label {
  font-weight: 500;
}

.multi-select-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
  border: 2px solid var(--border-color);
  border-radius: 3px;
}

.multi-select-option label {
  flex: 1;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary) !important;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.multi-select-option .count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.multi-select-option.hidden {
  display: none;
}

.filter-group input,
.filter-group select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  min-width: 140px;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.date-inputs,
.amount-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-inputs span,
.amount-inputs span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.date-inputs input,
.amount-inputs input {
  width: 120px;
}

.filter-group-date .date-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-presets {
  display: flex;
  gap: 0.2rem;
}

.preset-btn {
  padding: 0.35rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.preset-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.preset-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

#filter-search {
  min-width: 200px;
}

/* ===== Table ===== */
.table-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

#transactions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#transactions-table th {
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

#transactions-table th.sortable {
  cursor: pointer;
  user-select: none;
}

#transactions-table th.sortable:hover {
  color: var(--text-primary);
}

#transactions-table th.sortable::after {
  content: '';
  display: inline-block;
  margin-left: 0.5rem;
  opacity: 0.3;
}

#transactions-table th.sortable.asc::after {
  content: '↑';
  opacity: 1;
}

#transactions-table th.sortable.desc::after {
  content: '↓';
  opacity: 1;
}

#transactions-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

#transactions-table tbody tr {
  transition: var(--transition-fast);
}

#transactions-table tbody tr:hover {
  background: var(--bg-hover);
}

#transactions-table tbody tr.flagged {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid var(--accent-primary);
}

/* Table Columns */
.th-flag {
  width: 60px;
  text-align: center;
}

.th-resolve {
  width: 80px;
  text-align: center;
}

.th-date {
  width: 110px;
}

.th-amount {
  width: 120px;
}

.th-status {
  width: 100px;
}

.th-note {
  width: 200px;
}

/* Flag Button */
.flag-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.flag-btn:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.flag-btn.flagged {
  color: var(--accent-warning);
}

.flag-btn.commented {
  color: var(--accent-primary);
}

.flag-btn svg {
  width: 20px;
}

.flag-btn .note-icon {
  font-size: 1.1rem;
}

/* Row styles for flagged/commented */
tr.commented {
  background: rgba(59, 130, 246, 0.03);
}

tr.commented:hover {
  background: rgba(59, 130, 246, 0.08);
}

/* Resolve Button */
.resolve-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.resolve-btn.unresolved {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid var(--accent-danger);
}

.resolve-btn.unresolved:hover {
  background: rgba(239, 68, 68, 0.2);
}

.resolve-btn.resolved {
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-success);
  border: 1px solid var(--accent-success);
}

.resolve-btn.resolved:hover {
  background: rgba(34, 197, 94, 0.2);
}

/* Stats Bar */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-spent .stat-value {
  color: var(--amount-negative);
}

.stat-credited .stat-value {
  color: var(--amount-positive);
}

.stat-net .stat-value {
  color: var(--text-primary);
}

.stat-net .stat-value.positive {
  color: var(--amount-positive);
}

.stat-net .stat-value.negative {
  color: var(--amount-negative);
}

.stat-count .stat-value {
  color: var(--accent-primary);
}

/* Top Pagination */
.pagination-top {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* Toggle Flagged Button */
#toggle-flagged {
  width: auto;
  white-space: nowrap;
}

#toggle-flagged.active {
  background: var(--accent-warning);
  color: #000;
}

.flag-btn svg {
  width: 20px;
  height: 20px;
}

/* Amount styling */
.amount {
  font-family: var(--font-mono);
  font-weight: 500;
}

.amount.positive {
  color: var(--amount-positive);
}

.amount.negative {
  color: var(--amount-negative);
}

/* Category badge */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-tertiary);
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.pending {
  background: rgba(210, 153, 34, 0.2);
  color: var(--accent-warning);
}

.status-badge.cleared {
  background: rgba(63, 185, 80, 0.2);
  color: var(--accent-success);
}

.status-badge.recurring {
  background: rgba(163, 113, 247, 0.2);
  color: var(--accent-purple);
}

/* Note cell */
.note-preview {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Merchant */
.merchant-name {
  font-weight: 500;
}

.merchant-original {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Account cell */
.account-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

#page-info,
#page-info-top {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== Loading ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 100;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

/* Larger modal for note/flag */
#note-modal .modal-content {
  max-width: 600px;
}

#note-modal textarea {
  min-height: 120px;
  font-size: 0.95rem;
}

/* Note type toggle */
.note-type-toggle {
  margin-bottom: 1rem;
}

.toggle-buttons {
  display: flex;
  gap: 0.5rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  text-align: center;
}

.toggle-btn:hover {
  border-color: var(--accent-primary);
}

.toggle-btn.active {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  font-weight: 600;
}

.toggle-btn .toggle-hint {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* Notes filter group in filter bar */
.notes-filter-group {
  display: flex;
  gap: 0.25rem;
}

.notes-filter-group .btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  min-width: 120px;
  text-align: center;
  white-space: nowrap;
}

.notes-filter-group .btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.transaction-preview {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.transaction-preview .preview-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.transaction-preview .preview-row:last-child {
  margin-bottom: 0;
}

.transaction-preview .preview-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.transaction-preview .preview-value {
  font-weight: 500;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.modal-footer .keyboard-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: auto;
}

.modal-footer .btn-danger {
  /* Remove margin-right: auto since keyboard-hint takes it */
}

/* Progress Modal */
.progress-modal-content {
  max-width: 450px;
}

.progress-info {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.progress-bar-container {
  width: 100%;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-purple));
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-bar.indeterminate {
  width: 30%;
  animation: indeterminate 1.5s infinite ease-in-out;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.progress-stats {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
}

.progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.progress-stat .stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.progress-stat .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

/* Stats Modal */
.stats-modal-content {
  max-width: 800px;
  max-height: 80vh;
}

.stats-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.stats-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.stats-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.stats-tab.active {
  background: var(--accent-primary);
  color: white;
}

.stats-content {
  max-height: 55vh;
  overflow-y: auto;
}

.stats-panel {
  display: none;
}

.stats-panel.active {
  display: block;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.stats-table th {
  text-align: left;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
}

.stats-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.stats-table tr:hover td {
  background: var(--bg-hover);
}

.stats-table .amount-negative {
  color: var(--amount-negative);
  font-family: var(--font-mono);
}

.stats-table .amount-positive {
  color: var(--amount-positive);
  font-family: var(--font-mono);
}

.stats-table .amount-neutral {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.stats-table .count {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.stats-row-clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.stats-row-clickable:hover td {
  background: var(--accent-primary) !important;
  color: white !important;
}

.stats-row-clickable:hover .amount-negative,
.stats-row-clickable:hover .amount-positive,
.stats-row-clickable:hover .count {
  color: white !important;
}

.stats-total-row {
  font-weight: 700;
  background: var(--bg-tertiary) !important;
}

.stats-total-row td {
  border-top: 2px solid var(--border-color);
}

/* ===== Toast Notifications ===== */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 300;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  animation: toastSlideIn 0.3s ease;
  max-width: 350px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 3px solid var(--accent-success);
}

.toast.error {
  border-left: 3px solid var(--accent-danger);
}

.toast.info {
  border-left: 3px solid var(--accent-primary);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .filters-bar {
    gap: 0.75rem;
  }
  
  .filter-group input,
  .filter-group select {
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  #dashboard {
    padding: 1rem;
  }
  
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-group input,
  .filter-group select {
    width: 100%;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  #transactions-table {
    min-width: 800px;
  }
}

