/**
 * NhàBill / HomeBill — style.css
 * Sky Blue (#0EA5E9) Luxury Dark Home Finance Theme & Responsive Layout
 * Theme: Sky Blue primary + Warm Amber accent
 */

:root {
  --primary: #0EA5E9;
  --primary-hover: #0284C7;
  --primary-light: #38BDF8;
  --primary-dark: #0369A1;
  --primary-glow: rgba(14, 165, 233, 0.28);

  /* Warm Amber Accents (Family warmth, savings highlight) */
  --accent: #F59E0B;
  --accent-light: #FBBF24;
  --accent-hover: #D97706;
  --accent-dark: #B45309;
  --accent-glow: rgba(245, 158, 11, 0.35);

  /* Dual Gradients */
  --gradient-primary: linear-gradient(135deg, #0EA5E9 0%, #38BDF8 100%);
  --gradient-accent: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  --gradient-mixed: linear-gradient(135deg, #0EA5E9 0%, #F59E0B 100%);
  --gradient-card-badge: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(245, 158, 11, 0.18) 100%);
  --border-accent-glow: rgba(245, 158, 11, 0.4);

  /* Status colors */
  --status-income: #10B981;
  --status-expense: #EF4444;
  --status-pending: #F59E0B;
  --status-paid: #10B981;
  --status-overdue: #EF4444;
  --status-pool: #8B5CF6;

  /* Surfaces — Deep Midnight Blue */
  --bg-dark: #0A1628;
  --bg-darker: #060F1E;
  --surface: #0F1D32;
  --surface-card: #142640;
  --surface-hover: #1A3050;
  --border: #1E3A5F;
  --border-light: rgba(255, 255, 255, 0.1);

  /* Text */
  --text: #F0F9FF;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --text-dark: #0F172A;
  --text-on-primary: #FFFFFF;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.3);

  /* Fonts */
  --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

/* ============================================================
   LIGHT THEME OVERRIDES
   ============================================================ */
[data-theme="light"] {
  --primary: #0284C7;
  --primary-hover: #0369A1;
  --primary-light: #0EA5E9;
  --primary-dark: #075985;
  --primary-glow: rgba(2, 132, 199, 0.18);

  --accent: #D97706;
  --accent-light: #B45309;
  --accent-hover: #92400E;
  --accent-dark: #78350F;
  --accent-glow: rgba(217, 119, 6, 0.25);

  --bg-dark: #F0F9FF;
  --bg-darker: #E0F2FE;
  --surface: #FFFFFF;
  --surface-card: #F8FAFC;
  --surface-hover: #F1F5F9;
  --border: #CBD5E1;
  --border-light: rgba(0, 0, 0, 0.08);

  --text: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;
  --text-dark: #0F172A;
  --text-on-primary: #FFFFFF;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 12px rgba(2, 132, 199, 0.15);
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0; padding: 0;
  font-family: var(--font-main);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
}

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  position: relative;
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-header .brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.app-header .brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.app-header .header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.header-btn:hover { background: var(--surface-hover); color: var(--primary-light); }

/* ============================================================
   PERIOD SELECTOR BAR
   ============================================================ */
.period-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.period-bar .period-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.period-bar .period-nav-btn:hover { background: var(--surface-hover); color: var(--primary-light); }
.period-bar .period-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
  text-align: center;
}

/* ============================================================
   TAB NAVIGATION (BOTTOM)
   ============================================================ */
.tab-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 4px 0 env(safe-area-inset-bottom, 4px) 0;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px 4px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  gap: 2px;
  transition: color 0.2s;
  position: relative;
}
.tab-btn .tab-icon {
  font-size: 1.3rem;
  transition: transform 0.2s, color 0.2s;
}
.tab-btn.active {
  color: var(--primary);
}
.tab-btn.active .tab-icon {
  transform: scale(1.12);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2.5px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* ============================================================
   TAB CONTENT AREA
   ============================================================ */
.tab-content {
  flex: 1;
  padding: 12px 12px 80px;
  overflow-y: auto;
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DASHBOARD — SUMMARY CARDS
   ============================================================ */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.summary-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.summary-card.full-width {
  grid-column: 1 / -1;
}
.summary-card .card-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.summary-card .card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-card .card-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}
.summary-card .card-value.income { color: var(--status-income); }
.summary-card .card-value.expense { color: var(--status-expense); }
.summary-card .card-value.pool { color: var(--primary-light); }
.summary-card .card-value.balance { color: var(--accent-light); }

/* Accent stripe for cards */
.summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.summary-card.accent-card::before {
  background: var(--gradient-accent);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .icon { font-size: 1.1rem; }
.section-action {
  font-size: 0.78rem;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  border: none;
  background: transparent;
  transition: color 0.2s;
}
.section-action:hover { color: var(--primary-light); }

/* ============================================================
   TRANSACTION LIST (Expenses / Income)
   ============================================================ */
.transaction-list { display: flex; flex-direction: column; gap: 8px; }
.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.transaction-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.transaction-item .tx-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.transaction-item .tx-icon.expense-icon {
  background: rgba(239, 68, 68, 0.15);
}
.transaction-item .tx-icon.income-icon {
  background: rgba(16, 185, 129, 0.15);
}
.transaction-item .tx-details {
  flex: 1;
  min-width: 0;
}
.transaction-item .tx-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transaction-item .tx-category {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.transaction-item .tx-amount {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}
.transaction-item .tx-amount.expense { color: var(--status-expense); }
.transaction-item .tx-amount.income { color: var(--status-income); }
.transaction-item .tx-time {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: right;
}

/* ============================================================
   POOL CARDS (Hũ Quỹ)
   ============================================================ */
.pool-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pool-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}
.pool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.pool-card .pool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pool-card .pool-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pool-card .pool-name .pool-emoji {
  font-size: 1.2rem;
}
.pool-card .pool-balance {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-light);
}
.pool-card .pool-progress {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}
.pool-card .pool-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.pool-card .pool-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================================
   BILL TRACKER CARDS
   ============================================================ */
.bill-grid { display: flex; flex-direction: column; gap: 8px; }
.bill-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}
.bill-card:hover { border-color: var(--primary); }
.bill-card .bill-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(14, 165, 233, 0.12);
  flex-shrink: 0;
}
.bill-card .bill-info { flex: 1; min-width: 0; }
.bill-card .bill-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.bill-card .bill-due {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.bill-card .bill-right {
  text-align: right;
  flex-shrink: 0;
}
.bill-card .bill-amount {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.bill-card .bill-status {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-top: 4px;
}
.bill-status.paid { background: rgba(16, 185, 129, 0.15); color: var(--status-paid); }
.bill-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--status-pending); }
.bill-status.overdue { background: rgba(239, 68, 68, 0.15); color: var(--status-overdue); }

/* ============================================================
   SETTLE UP (Cân sổ)
   ============================================================ */
.settle-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}
.settle-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.settle-header .settle-icon { font-size: 1.4rem; }
.settle-header .settle-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.settle-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.settle-member:last-child { border-bottom: none; }
.settle-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-on-primary);
  flex-shrink: 0;
}
.settle-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.settle-amount { font-size: 0.95rem; font-weight: 700; }
.settle-amount.owe { color: var(--status-expense); }
.settle-amount.owed { color: var(--status-income); }
.settle-amount.settled { color: var(--text-muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--primary); }

.btn-accent {
  background: var(--gradient-accent);
  color: var(--text-dark);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 0 16px var(--accent-glow); }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

/* ============================================================
   FLOATING ACTION BUTTON (FAB)
   ============================================================ */
.fab {
  position: fixed;
  bottom: 76px;
  right: calc(50% - 240px + 16px);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: all 0.25s;
  z-index: 150;
}
.fab:hover { transform: scale(1.08) translateY(-2px); }
.fab:active { transform: scale(0.95); }
@media (max-width: 480px) {
  .fab { right: 16px; }
}

/* ============================================================
   MODAL OVERLAY (General Purpose)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-overlay.visible {
  display: flex;
}
.modal-panel {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 16px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--surface-hover); color: var(--status-expense); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
}

/* Category chip selector in form */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.category-chip:hover { border-color: var(--primary); color: var(--text); }
.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
}

/* ============================================================
   MEMBER BADGES (Thành viên gia đình)
   ============================================================ */
.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--gradient-card-badge);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}
.member-badge .member-avatar-mini {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--text-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
}

/* ============================================================
   CHART PLACEHOLDER
   ============================================================ */
.chart-container {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-bar-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 140px;
  width: 100%;
  padding: 0 8px;
}
.chart-bar {
  flex: 1;
  max-width: 28px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
  position: relative;
}
.chart-bar.expense { background: var(--status-expense); }
.chart-bar.income { background: var(--status-income); }

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { border-color: var(--status-income); }
.toast.error { border-color: var(--status-expense); }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.confirm-overlay.visible { display: flex; }
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  animation: fadeIn 0.2s ease;
}
.confirm-box .confirm-msg {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.6;
}
.confirm-box .confirm-actions {
  display: flex;
  gap: 10px;
}
.confirm-box .confirm-actions button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.confirm-box .btn-cancel {
  background: var(--surface-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.confirm-box .btn-ok {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state .empty-title { font-size: 1rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.empty-state .empty-desc { font-size: 0.82rem; color: var(--text-dim); }

/* ============================================================
   SETTINGS LIST
   ============================================================ */
.settings-list { display: flex; flex-direction: column; gap: 2px; }
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.settings-item:hover { background: var(--surface-hover); }
.settings-item:first-child { border-radius: var(--radius-md) var(--radius-md) var(--radius-sm) var(--radius-sm); }
.settings-item:last-child { border-radius: var(--radius-sm) var(--radius-sm) var(--radius-md) var(--radius-md); }
.settings-item .si-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(14, 165, 233, 0.12);
  flex-shrink: 0;
}
.settings-item .si-label {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.settings-item .si-value {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.settings-item .si-arrow {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden { display: none !important; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-income { color: var(--status-income); }
.text-expense { color: var(--status-expense); }
.fw-bold { font-weight: 700; }
.gap-sm { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 480px) {
  #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
@media (max-width: 360px) {
  .summary-grid { grid-template-columns: 1fr; }
  .tab-btn { font-size: 0.6rem; }
  .tab-btn .tab-icon { font-size: 1.15rem; }
}

/* ============================================================
   UI UTILITY & ACCESSIBILITY CLASSES
   ============================================================ */
.select-lang {
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
}
.si-icon-danger {
  background: rgba(239, 68, 68, 0.12);
}
.si-label-danger {
  color: #EF4444;
}
.app-footer-brand {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.input-emoji-picker {
  width: 60px;
  text-align: center;
  font-size: 1.3rem;
}
.members-list-container {
  margin-bottom: 12px;
}
.add-member-row {
  display: flex;
  gap: 8px;
}
.add-member-input {
  flex: 1;
}
.add-member-btn {
  width: auto;
  padding: 10px 16px;
}
.file-restore-hidden {
  display: none;
}
.uat-banner {
  background: linear-gradient(90deg, #F59E0B, #D97706);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.5px;
  z-index: 99999;
  position: relative;
}
.uat-banner-icon {
  font-size: 16px;
}
.brand-badge-uat {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  font-size: 0.65rem;
  padding: 2px 6px;
  margin-left: 6px;
  font-weight: 700;
}

