/* =========================================================
   FINANCEFLOW - MODERN FINTECH DESIGN SYSTEM
   ========================================================= */

:root {
  /* Color Palette - Premium Slate & Glowing Accents */
  --bg-primary: #0a0f1d;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --bg-input: rgba(15, 23, 42, 0.6);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand & Financial Accents */
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  
  /* Income & Expense */
  --income-color: #10b981;
  --income-bg: rgba(16, 185, 129, 0.12);
  --income-border: rgba(16, 185, 129, 0.3);
  
  --expense-color: #f43f5e;
  --expense-bg: rgba(244, 63, 94, 0.12);
  --expense-border: rgba(244, 63, 94, 0.3);
  
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);

  --wa-color: #25d366;
  --wa-hover: #1ebd5a;
  
  /* Shadows & Glassmorphism */
  --glass-blur: blur(16px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.45);
  --glow-accent: 0 0 24px rgba(99, 102, 241, 0.25);
  --glow-income: 0 0 24px rgba(16, 185, 129, 0.25);
  --glow-expense: 0 0 24px rgba(244, 63, 94, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* App Layout Container */
.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Header & Nav */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--glow-accent);
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  transition: var(--transition-fast);
}

.status-pill .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-pill.online {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.status-pill.online .indicator {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.status-pill.demo {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.status-pill.demo .indicator {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  box-shadow: var(--glow-accent);
}

.btn-income {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}
.btn-income:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: var(--glow-income);
}

.btn-expense {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: white;
}
.btn-expense:hover {
  background: linear-gradient(135deg, #e11d48, #be123c);
  box-shadow: var(--glow-expense);
}

.btn-whatsapp {
  background: linear-gradient(135deg, var(--wa-color), #128c7e);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp:hover {
  background: linear-gradient(135deg, #1ebd5a, #075e54);
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--text-main);
  backdrop-filter: var(--glass-blur);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-md);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

.metric-card.balance::before { background: linear-gradient(to right, var(--accent-primary), var(--accent-cyan)); }
.metric-card.income::before { background: linear-gradient(to right, #10b981, #34d399); }
.metric-card.expense::before { background: linear-gradient(to right, #f43f5e, #fb7185); }
.metric-card.cashflow::before { background: linear-gradient(to right, #f59e0b, #fbbf24); }

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.metric-card.balance .metric-icon { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.metric-card.income .metric-icon { background: var(--income-bg); color: var(--income-color); }
.metric-card.expense .metric-icon { background: var(--expense-bg); color: var(--expense-color); }
.metric-card.cashflow .metric-icon { background: var(--warning-bg); color: var(--warning-color); }

.metric-amount {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  word-break: break-word;
}

.metric-card.income .metric-amount { color: #34d399; }
.metric-card.expense .metric-amount { color: #fb7185; }

.metric-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Glass Card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title span.emoji {
  font-size: 1.2rem;
}

/* Chart Containers */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 270px;
}

/* Quick Action Bar */
.action-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.banner-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.banner-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.banner-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Table and Filters Section */
.transactions-section {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  min-width: 240px;
}

.search-input-wrapper input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.custom-select {
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}

.custom-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

/* Transactions Table */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.transactions-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.transactions-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.transactions-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Category Badge */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

/* Type Pill */
.type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.type-badge.income {
  background: var(--income-bg);
  color: var(--income-color);
}

.type-badge.expense {
  background: var(--expense-bg);
  color: var(--expense-color);
}

.amount-col {
  font-weight: 700;
  font-size: 0.95rem;
}
.amount-col.income { color: #34d399; }
.amount-col.expense { color: #fb7185; }

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}
.action-btn:hover {
  color: var(--expense-color);
  background: var(--expense-bg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: all var(--transition-normal);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  flex-shrink: 0;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Segmented Control (Income / Expense) */
.type-segmented {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 6px;
  margin-bottom: 20px;
}

.segmented-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.segmented-btn.active.expense {
  background: var(--expense-color);
  color: white;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.segmented-btn.active.income {
  background: var(--income-color);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Help Text */
.help-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 5px;
  line-height: 1.4;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: white;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease forwards;
}

.toast.success { border-left: 4px solid var(--income-color); }
.toast.error { border-left: 4px solid var(--expense-color); }
.toast.info { border-left: 4px solid var(--accent-primary); }

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

/* Responsive adjustments */
@media (max-width: 640px) {
  .app-container {
    padding: 16px 12px 60px;
  }
  .header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .table-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Category Management */
.category-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 4px;
}

.category-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.category-manage-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.cat-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-delete-cat {
  background: transparent;
  border: none;
  color: var(--expense-color);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.btn-delete-cat:hover {
  background: var(--expense-bg);
  transform: scale(1.04);
}

.btn-edit-cat {
  background: transparent;
  border: none;
  color: #818cf8;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.btn-edit-cat:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: scale(1.04);
}

/* Category Pill Action Buttons */
.category-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.category-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-cat-pill.btn-cat-add {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}

.btn-cat-pill.btn-cat-add:hover {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-cat-pill.btn-cat-manage {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-cat-pill.btn-cat-manage:hover {
  background: #f43f5e;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.4);
  transform: translateY(-1px);
}

.new-category-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
  animation: slideDown 0.2s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.new-cat-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 10px;
}

.new-cat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.new-cat-input-row input {
  flex: 1;
  min-width: 220px;
}

.new-cat-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.new-cat-actions .btn {
  padding: 10px 16px;
  font-size: 0.84rem;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .new-cat-actions {
    width: 100%;
  }
  .new-cat-actions .btn {
    flex: 1;
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Bottom Navigation Bar (Khusus Handphone) */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 72px;
  }

  .app-container {
    padding: 16px 14px 80px;
  }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 15, 29, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 10px;
    justify-content: space-around;
    align-items: center;
    z-index: 900;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-family: inherit;
    flex: 1;
    max-width: 70px;
    touch-action: manipulation;
  }

  .mobile-nav-item * {
    pointer-events: none;
  }

  .mobile-nav-icon {
    font-size: 1.25rem;
    margin-bottom: 2px;
  }

  .mobile-nav-label {
    font-size: 0.68rem;
    font-weight: 600;
  }

  .mobile-nav-item:active {
    transform: scale(0.92);
  }

  .mobile-nav-item.mob-income .mobile-nav-icon {
    color: #10b981;
  }
  .mobile-nav-item.mob-expense .mobile-nav-icon {
    color: #f43f5e;
  }
  .mobile-nav-item.mob-wa .mobile-nav-icon {
    color: #25d366;
  }

  /* Mobile Modals adjustments (Bottom Sheet Style with Pinned Header & Footer) */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal-card form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .modal-header {
    padding: 14px 18px;
    flex-shrink: 0;
  }

  .modal-body {
    padding: 16px 16px 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 12px 16px;
    background: #0d1322;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    padding: 12px 14px;
  }

  /* Prevent auto-zoom on iOS Safari when tapping inputs */
  .form-input, .form-select, .form-textarea {
    font-size: 16px !important;
  }
}

/* =========================================================
   BULK SELECTION, DANGER BUTTON & PASSWORD MODALS STYLES
   ========================================================= */

/* Bulk Action Bar */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(17, 24, 39, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: slideDownFade 0.22s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bulk-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc;
}

.bulk-icon {
  font-size: 1.15rem;
}

.bulk-amount-badge {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 4px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.bulk-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: white;
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #e11d48, #be123c);
  box-shadow: var(--glow-expense);
}

/* Custom Checkbox */
.custom-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
  border-radius: 4px;
  vertical-align: middle;
  transition: transform 0.15s ease;
}

.custom-checkbox:hover {
  transform: scale(1.1);
}

.selected-row td {
  background: rgba(99, 102, 241, 0.12) !important;
}

/* Password Modal & Form Controls */
.modal-card-sm {
  max-width: 440px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-input {
  padding-right: 44px;
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-toggle-password:hover {
  opacity: 0.8;
  transform: translateY(-50%) scale(1.1);
}

.delete-target-box {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.5;
}

.auth-error-msg {
  color: #fb7185;
  font-size: 0.82rem;
  margin-top: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: shakeError 0.3s ease-in-out;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

