/* ==========================================================================
   FinFlow - Modern Design System & CSS Stylesheet
   ========================================================================== */

:root {
  /* Core Colors */
  --bg-main: #0b0f19;
  --bg-sidebar: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Accent & Status Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --accent: #8b5cf6;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  --grad-accent: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Utility Classes */
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.currency-val { font-family: var(--font-mono); }

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Layout Structure */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--grad-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.brand-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

/* User Badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.user-badge .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-badge .user-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
}
.user-badge .user-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Nav Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #fff;
  background: var(--grad-primary);
  box-shadow: var(--shadow-glow);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.quick-salary-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  color: var(--success);
  position: relative;
  transition: var(--transition);
}
.quick-salary-info.clickable {
  cursor: pointer;
}
.quick-salary-info.clickable:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
}
.quick-salary-info .edit-icon {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.7;
}
.quick-salary-info.clickable:hover .edit-icon {
  opacity: 1;
  transform: scale(1.1);
}
.quick-salary-info i { font-size: 1.25rem; }
.quick-salary-info small { display: block; font-size: 0.68rem; color: var(--text-muted); }
.quick-salary-info strong { font-size: 0.78rem; font-weight: 700; color: var(--text-main); }

.metric-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-icon-link {
  background: transparent;
  border: none;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  transition: var(--transition);
}
.btn-icon-link:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-reset {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
  transition: var(--transition);
}
.btn-reset:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-glow);
}

/* Main Content Wrapper */
.main-wrapper {
  margin-left: 270px;
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  transition: var(--transition);
}

/* Top Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

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

.mobile-toggle-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  cursor: pointer;
}

.top-header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.top-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 3px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--grad-danger);
  color: #fff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.btn-glow {
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
}
.btn-text:hover { text-decoration: underline; }

/* View Content Visibility */
.view-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.view-content.active {
  display: block;
}

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

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.metric-icon.total-balance { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.metric-icon.income { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.metric-icon.expense { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.metric-icon.savings { background: rgba(139, 92, 246, 0.15); color: var(--accent); }
.metric-icon.budget { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.metric-body .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.metric-body .amount {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0.15rem 0;
}

.metric-body .hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Cards & Layout Containers */
.card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.card-header-flex h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Budget Progress Summary Card */
.budget-summary-card {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.budget-badge {
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.budget-badge.safe { background: var(--success-glow); color: var(--success); border: 1px solid var(--success); }
.budget-badge.warning { background: var(--warning-glow); color: var(--warning); border: 1px solid var(--warning); }
.budget-badge.danger { background: var(--danger-glow); color: var(--danger); border: 1px solid var(--danger); }

.budget-progress-container {
  margin-top: 1rem;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--grad-primary);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.budget-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Two Column Grid */
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Accounts Mini List */
.accounts-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.acc-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.acc-mini-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.acc-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.acc-mini-name { font-weight: 600; font-size: 0.9rem; }
.acc-mini-type { font-size: 0.72rem; color: var(--text-muted); }
.acc-mini-balance { font-family: var(--font-mono); font-weight: 700; }

/* Top Spending Categories List */
.top-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.top-cat-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.top-cat-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}
.top-cat-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}
.top-cat-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

/* Category Badge */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
}

/* Type Badge */
.type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
}
.type-badge.income { background: var(--success-glow); color: var(--success); }
.type-badge.expense { background: var(--danger-glow); color: var(--danger); }
.type-badge.transfer { background: rgba(139, 92, 246, 0.2); color: var(--accent); }

/* Filter Toolbar */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.search-input {
  position: relative;
  min-width: 220px;
  flex: 1;
}
.search-input i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-input input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
}
.search-input input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-select {
  padding: 0.65rem 1rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  cursor: pointer;
}
.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Budget Cards Grid */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.budget-card {
  padding: 1.25rem;
  border-left: 4px solid var(--primary);
}
.budget-card.traffic-green { border-left-color: var(--success); }
.budget-card.traffic-yellow { border-left-color: var(--warning); }
.budget-card.traffic-red { border-left-color: var(--danger); }

.budget-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.budget-cat-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Report Sub-tabs */
.report-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.report-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: var(--transition);
}

.report-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.report-tab-btn.active {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.report-pane {
  display: none;
}
.report-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}
.chart-large {
  height: 400px;
}

/* Daily Timeline List */
.daily-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.timeline-date-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}
.timeline-date-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}
.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}

/* Accounts Grid */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.acc-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

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

.acc-card-type-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.acc-card-balance {
  font-size: 1.6rem;
  font-weight: 700;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal-content {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-type-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-sidebar);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.tx-type-btn {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.tx-type-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix-wrapper .prefix {
  position: absolute;
  left: 1rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}
.input-prefix-wrapper input {
  padding-left: 2.2rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-sidebar);
  color: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  animation: slideInRight 0.3s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.danger { border-left: 4px solid var(--danger); }

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

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM (PC, TABLET, HP)
   ========================================================================== */

/* 1. Large PC & Desktop Screens (> 1200px) */
@media (min-width: 1201px) {
  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 2. Medium PC & Laptop Screens (993px - 1200px) */
@media (max-width: 1200px) and (min-width: 993px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-wrapper {
    padding: 1.5rem;
  }
}

/* 3. Tablets & Small Laptops (768px - 992px) */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 29, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: all;
  }
  .mobile-close-btn { display: block; }
  .mobile-toggle-btn { display: flex; align-items: center; justify-content: center; }

  .main-wrapper {
    margin-left: 0;
    padding: 1.25rem;
    max-width: 100%;
  }
  .two-col-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .report-tabs-bar {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  .report-tab-btn {
    flex-shrink: 0;
  }
}

/* 4. Smartphones & Mobile / HP (< 768px) */
@media (max-width: 767px) {
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .header-left {
    width: 100%;
    justify-content: space-between;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .budget-grid, .accounts-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .filter-group {
    flex-direction: column;
    width: 100%;
  }
  .filter-group .search-input,
  .filter-group .form-select {
    width: 100%;
  }
  .modal-content {
    width: 95%;
    padding: 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
  }
  .login-container {
    padding: 1.5rem 1.1rem;
    width: 95%;
    max-height: 92vh;
    overflow-y: auto;
  }
  .login-numpad {
    gap: 0.35rem;
  }
  .numpad-btn {
    padding: 0.5rem;
    font-size: 1rem;
  }
  .card {
    padding: 1.1rem;
  }
  .card-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .tx-header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================
 * DUAL USER LOGIN OVERLAY STYLING (AICANG & DAICO)
 * ========================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  visibility: hidden;
  overflow: hidden;
}

.login-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.login-bg-glow.blob-1 {
  top: 15%;
  left: 20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.8) 0%, rgba(99, 102, 241, 0) 70%);
  animation: floatBlob1 8s ease-in-out infinite alternate;
}

.login-bg-glow.blob-2 {
  bottom: 15%;
  right: 20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.6) 0%, rgba(16, 185, 129, 0) 70%);
  animation: floatBlob2 10s ease-in-out infinite alternate;
}

@keyframes floatBlob1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -40px) scale(1.15); }
}

@keyframes floatBlob2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 30px) scale(1.1); }
}

.login-overlay.active {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.login-container {
  position: relative;
  z-index: 10;
  max-width: 540px;
  width: 92%;
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(23, 30, 48, 0.92) 0%, rgba(13, 18, 32, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(99, 102, 241, 0.2);
  animation: loginPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-container.shake-error {
  animation: pinShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

@keyframes pinShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

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

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 0.6rem;
}

.login-brand .brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.login-brand h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-brand h2 span {
  font-size: 0.85rem;
  display: block;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-welcome-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.25rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  line-height: 1.4;
}

.user-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.user-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.user-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.user-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.14);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.28);
}

.user-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.user-avatar-box {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.avatar-aicang {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.avatar-daico {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  background: #10b981;
  border: 2px solid #111827;
  border-radius: 50%;
}

.user-select-check {
  font-size: 1.35rem;
  color: rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
}

.user-card.active .user-select-check {
  color: var(--primary);
  transform: scale(1.1);
}

.user-card-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.user-role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
}

.badge-aicang {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-daico {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.user-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.user-meta strong {
  color: var(--text-main);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .form-input {
  padding-right: 42px;
  font-size: 1.1rem;
  letter-spacing: 2px;
  font-family: var(--font-mono);
}

.btn-toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.05rem;
  padding: 4px;
  transition: color 0.2s ease;
}

.btn-toggle-pass:hover {
  color: var(--text-main);
}

.pin-hint {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.pin-hint strong {
  color: var(--primary);
}

/* Interactive On-Screen NumPad */
.login-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.numpad-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.numpad-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  transform: scale(1.03);
}

.numpad-btn:active {
  transform: scale(0.96);
}

.numpad-clear {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.numpad-clear:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
}

.numpad-submit {
  color: #fff;
  background: var(--grad-primary);
  border-color: transparent;
}

.numpad-submit:hover {
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.login-footer {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-switch-user {
  margin-top: 0.5rem;
  color: #a5b4fc !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

.btn-switch-user:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  color: #fff !important;
}

@media (max-width: 480px) {
  .user-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   AICANG FEMININE SAKURA THEME (Soft, Elegant Rose & Sakura Petals)
   ========================================================================== */
body.theme-aicang-sakura {
  --bg-main: #180d1b;
  --bg-sidebar: #221127;
  --bg-card: rgba(43, 22, 48, 0.78);
  --bg-card-hover: rgba(58, 29, 65, 0.88);
  --bg-glass: rgba(244, 114, 182, 0.06);

  --text-main: #fcf2f7;
  --text-muted: #f4b5d0;
  --text-dim: #c0849e;

  --primary: #ec4899;
  --primary-hover: #db2777;
  --primary-glow: rgba(236, 72, 153, 0.4);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #fbbf24;
  --warning-glow: rgba(251, 191, 36, 0.2);
  --danger: #f43f5e;
  --danger-glow: rgba(244, 63, 94, 0.2);
  --accent: #f472b6;

  --border-color: rgba(244, 114, 182, 0.22);
  --border-focus: rgba(236, 72, 153, 0.55);

  --grad-primary: linear-gradient(135deg, #f472b6 0%, #fb7185 50%, #e11d48 100%);
  --grad-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-danger: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  --grad-accent: linear-gradient(135deg, #f472b6 0%, #c084fc 100%);

  --shadow-sm: 0 4px 16px rgba(236, 72, 153, 0.12);
  --shadow-lg: 0 12px 36px rgba(34, 17, 39, 0.65);
  --shadow-glow: 0 0 25px rgba(236, 72, 153, 0.35);

  background-image: 
    radial-gradient(circle at 12% 18%, rgba(244, 114, 182, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 88% 82%, rgba(251, 113, 133, 0.14) 0%, transparent 40%);
}

/* Floating Sakura Petals Layer */
.sakura-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.sakura-petal {
  position: absolute;
  top: -30px;
  background: linear-gradient(135deg, rgba(255, 214, 231, 0.9) 0%, rgba(244, 114, 182, 0.75) 100%);
  border-radius: 14px 1px 14px 14px;
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.45);
  opacity: 0.85;
  animation: sakuraFall ease-in-out infinite, sakuraSway ease-in-out infinite alternate;
}

@keyframes sakuraFall {
  0% {
    top: -30px;
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  88% {
    opacity: 0.9;
  }
  100% {
    top: 105vh;
    opacity: 0;
  }
}

@keyframes sakuraSway {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(45px) rotate(180deg);
  }
  100% {
    transform: translateX(-35px) rotate(360deg);
  }
}

/* Sakura Theme Component Accents */
body.theme-aicang-sakura .brand-icon {
  background: linear-gradient(135deg, #f472b6 0%, #e11d48 100%);
  box-shadow: 0 0 22px rgba(244, 114, 182, 0.55);
}

body.theme-aicang-sakura .glass-card {
  border: 1px solid rgba(244, 114, 182, 0.24);
}

body.theme-aicang-sakura .glass-card:hover {
  border-color: rgba(244, 114, 182, 0.5);
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.22);
}

body.theme-aicang-sakura .user-badge {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.3);
}

body.theme-aicang-sakura .avatar-aicang {
  background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
  box-shadow: 0 4px 18px rgba(244, 114, 182, 0.5);
}

body.theme-aicang-sakura .metric-card {
  border-top: 3px solid rgba(244, 114, 182, 0.4);
}

body.theme-aicang-sakura .nav-item.active {
  background: linear-gradient(135deg, #f472b6 0%, #e11d48 100%);
  box-shadow: 0 4px 22px rgba(244, 114, 182, 0.45);
}

body.theme-aicang-sakura .btn-primary {
  background: linear-gradient(135deg, #f472b6 0%, #e11d48 100%);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.35);
}

/* ==========================================================================
   DAICO ADMIN MANAGEMENT TOOLS STYLING
   ========================================================================== */
.badge-daico-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  font-weight: 700;
}

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

.user-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.user-mgmt-card {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-left: 4px solid var(--warning);
}

.user-mgmt-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-id-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
}

.user-mgmt-details {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.detail-item small {
  color: var(--text-muted);
}

.pin-display {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
}

.btn-icon-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.btn-icon-sm:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.user-mgmt-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}




