/* ============================================================
   CashFlow - Main Stylesheet
   Green + White Theme, Mobile-First
   ============================================================ */

:root {
  --cf-green:       #16a34a;
  --cf-green-light: #22c55e;
  --cf-green-pale:  #dcfce7;
  --cf-green-dark:  #15803d;
  --cf-white:       #ffffff;
  --cf-bg:          #f0fdf4;
  --cf-card-bg:     #ffffff;
  --cf-border:      #e2e8f0;
  --cf-text:        #1e293b;
  --cf-text-muted:  #64748b;
  --cf-header-h:    60px;
  --cf-sidebar-w:   240px;
  --cf-bottom-nav-h:64px;
  --cf-shadow-sm:   0 1px 4px rgba(0,0,0,.08);
  --cf-shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --cf-radius:      12px;
  --cf-radius-sm:   8px;
  --cf-income:      #22c55e;
  --cf-expense:     #ef4444;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cf-bg);
  color: var(--cf-text);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Auth Layout
   ============================================================ */
.cf-auth-body {
  background: var(--cf-white);
  min-height: 100vh;
}

.cf-auth-wrap {
  display: flex;
  min-height: 100vh;
}

.cf-auth-left {
  width: 45%;
  background: linear-gradient(135deg, var(--cf-green-dark), var(--cf-green-light));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  flex-shrink: 0;
}

.cf-auth-brand { color: white; text-align: center; }

.cf-auth-logo {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}

.cf-auth-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.cf-auth-subtitle { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }

.cf-auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  opacity: 0.95;
}

.cf-auth-feature i { color: #86efac; font-size: 1rem; }

.cf-auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.cf-auth-form-wrap { width: 100%; max-width: 440px; }

.cf-auth-logo-mobile {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--cf-green);
  font-size: 1.5rem;
}

.cf-form-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.cf-form-sub { font-size: 0.95rem; }

.cf-pw-toggle { cursor: pointer; background: var(--cf-border); border: 1px solid var(--cf-border); }
.cf-pw-toggle:hover { background: #e2e8f0; }

.cf-otp-input { font-size: 1.5rem; letter-spacing: 0.5rem; }

/* ============================================================
   Main App Layout
   ============================================================ */
.cf-body { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.cf-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--cf-header-h);
  background: var(--cf-green);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.cf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1rem;
  gap: 1rem;
}

.cf-logo-link { text-decoration: none; }
.cf-logo { color: white; font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.cf-logo i { margin-right: 4px; }

.cf-menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.cf-menu-btn:hover { background: rgba(255,255,255,.15); }

/* Search */
.cf-search-wrap { flex: 1; max-width: 400px; }
.cf-search-box { position: relative; }
.cf-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.7); }
.cf-search-input {
  width: 100%;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  color: white;
  font-size: 0.9rem;
  outline: none;
  transition: background 0.2s;
}
.cf-search-input::placeholder { color: rgba(255,255,255,.7); }
.cf-search-input:focus { background: rgba(255,255,255,.25); }

.cf-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: white;
  border-radius: var(--cf-radius-sm);
  box-shadow: var(--cf-shadow-md);
  display: none;
  z-index: 999;
  max-height: 360px;
  overflow-y: auto;
}
.cf-search-results.open { display: block; }
.cf-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--cf-text);
  border-bottom: 1px solid var(--cf-border);
}
.cf-search-result-item:hover { background: var(--cf-bg); }
.cf-search-result-item:last-child { border-bottom: none; }

/* Business badge */
.cf-biz-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 5px 10px;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.cf-biz-badge:hover { background: rgba(255,255,255,.25); }

.cf-biz-logo { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }
.cf-biz-initial {
  width: 24px; height: 24px;
  background: rgba(255,255,255,.3);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
}

.cf-biz-dropdown { min-width: 220px; }

/* Icon buttons */
.cf-icon-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: white;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}
.cf-icon-btn:hover { background: rgba(255,255,255,.25); }

.cf-notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--cf-green);
}

/* User avatar */
.cf-avatar-btn {
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 50%;
  width: 36px; height: 36px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}
.cf-user-avatar { width: 100%; height: 100%; object-fit: cover; }
.cf-user-initial {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: white;
}

/* Notification Dropdown */
.cf-notif-dropdown {
  width: 340px;
  padding: 0;
  border-radius: var(--cf-radius);
  box-shadow: var(--cf-shadow-md);
}
.cf-notif-header, .cf-notif-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--cf-border);
}
.cf-notif-footer { border-top: 1px solid var(--cf-border); border-bottom: none; justify-content: center; }
.cf-notif-footer a { color: var(--cf-green); text-decoration: none; font-size: 0.9rem; }
.cf-notif-list { max-height: 300px; overflow-y: auto; }

/* ============================================================
   Sidebar
   ============================================================ */
.cf-sidebar {
  position: fixed;
  left: 0;
  top: var(--cf-header-h);
  bottom: 0;
  width: var(--cf-sidebar-w);
  background: var(--cf-card-bg);
  border-right: 1px solid var(--cf-border);
  overflow-y: auto;
  z-index: 900;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

@media (min-width: 992px) {
  .cf-sidebar { transform: translateX(0); }
}

.cf-sidebar.open { transform: translateX(0); }
.cf-sidebar-inner { display: flex; flex-direction: column; padding: 1rem 0.75rem; flex: 1; gap: 2px; }

.cf-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 850;
}
.cf-overlay.show { display: block; }

.cf-nav { list-style: none; padding: 0; margin: 0; }
.cf-nav-item { }
.cf-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--cf-radius-sm);
  text-decoration: none;
  color: var(--cf-text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s;
}
.cf-nav-link i { font-size: 1.1rem; width: 20px; flex-shrink: 0; }
.cf-nav-link:hover { background: var(--cf-green-pale); color: var(--cf-green); }
.cf-nav-link.active { background: var(--cf-green-pale); color: var(--cf-green); font-weight: 600; }
.cf-nav-divider { border-top: 1px solid var(--cf-border); margin: 8px 0; }

/* ============================================================
   Main Content
   ============================================================ */
.cf-main {
  margin-top: var(--cf-header-h);
  padding-bottom: calc(var(--cf-bottom-nav-h) + 1rem);
  min-height: calc(100vh - var(--cf-header-h));
  transition: margin-left 0.3s;
}

@media (min-width: 992px) {
  .cf-main { margin-left: var(--cf-sidebar-w); padding-bottom: 2rem; }
}

.cf-page { padding: 1.25rem; }

@media (min-width: 768px) { .cf-page { padding: 1.5rem 2rem; } }

/* Page header */
.cf-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cf-page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.cf-page-sub { font-size: 0.9rem; margin: 0.15rem 0 0; }
.cf-back-link { display: inline-flex; align-items: center; color: var(--cf-green); font-size: 0.875rem; text-decoration: none; margin-bottom: 4px; }

/* Alert top */
.cf-alert-top { border-radius: 0; margin: 0; border: none; border-bottom: 1px solid rgba(0,0,0,.05); }

/* ============================================================
   Cards
   ============================================================ */
.cf-card {
  background: var(--cf-card-bg);
  border-radius: var(--cf-radius);
  box-shadow: var(--cf-shadow-sm);
  border: 1px solid var(--cf-border);
  overflow: hidden;
}

.cf-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--cf-border);
  background: var(--cf-card-bg);
}
.cf-card-title { font-weight: 600; margin: 0; font-size: 0.95rem; }
.cf-card-body { padding: 1.25rem; }

/* ============================================================
   Stat Cards
   ============================================================ */
.cf-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cf-card-bg);
  border-radius: var(--cf-radius);
  padding: 1rem;
  box-shadow: var(--cf-shadow-sm);
  border: 1px solid var(--cf-border);
}

.cf-stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.cf-stat-balance .cf-stat-icon { background: var(--cf-green-pale); color: var(--cf-green); }
.cf-stat-income .cf-stat-icon  { background: #dcfce7; color: #16a34a; }
.cf-stat-expense .cf-stat-icon { background: #fee2e2; color: #dc2626; }
.cf-stat-net .cf-stat-icon     { background: #dbeafe; color: #2563eb; }

.cf-stat-info { display: flex; flex-direction: column; min-width: 0; }
.cf-stat-label { font-size: 0.78rem; color: var(--cf-text-muted); font-weight: 500; white-space: nowrap; }
.cf-stat-value { font-size: 1.1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Transactions
   ============================================================ */
.cf-txn-list { }
.cf-txn-date-divider {
  padding: 6px 16px;
  background: var(--cf-bg);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cf-text-muted);
  border-bottom: 1px solid var(--cf-border);
}

.cf-txn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cf-border);
  text-decoration: none;
  color: var(--cf-text);
  transition: background 0.15s;
  cursor: pointer;
}
.cf-txn-item:hover { background: var(--cf-bg); }
.cf-txn-item:last-child { border-bottom: none; }
.cf-txn-item-full { cursor: default; }
.cf-txn-item-full:hover { background: var(--cf-bg); }

.cf-txn-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.cf-txn-in  { background: #dcfce7; color: #16a34a; }
.cf-txn-out { background: #fee2e2; color: #dc2626; }

.cf-txn-details { flex: 1; min-width: 0; }
.cf-txn-remark { display: block; font-weight: 500; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-txn-meta { font-size: 0.78rem; color: var(--cf-text-muted); }
.cf-txn-meta-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

.cf-txn-amount { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.cf-txn-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cf-txn-actions { display: flex; gap: 4px; }

.cf-action-btn {
  background: none;
  border: 1px solid var(--cf-border);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.8rem;
  color: var(--cf-text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.cf-action-btn:hover { background: var(--cf-bg); color: var(--cf-text); }
.cf-action-btn.text-danger:hover { background: #fee2e2; border-color: #fca5a5; }

/* ============================================================
   Ledger List (dashboard)
   ============================================================ */
.cf-ledger-list { }
.cf-ledger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--cf-border);
  text-decoration: none;
  color: var(--cf-text);
  transition: background 0.15s;
}
.cf-ledger-item:hover { background: var(--cf-bg); }
.cf-ledger-item:last-child { border-bottom: none; }

.cf-ledger-color { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.cf-ledger-info { flex: 1; min-width: 0; }
.cf-ledger-name { display: block; font-weight: 500; font-size: 0.9rem; }
.cf-ledger-type { display: block; }
.cf-ledger-balance { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* Ledger Cards */
.cf-ledger-card { position: relative; }
.cf-ledger-card-accent { height: 4px; position: absolute; top: 0; left: 0; right: 0; }
.cf-ledger-card-name { font-size: 1rem; font-weight: 600; }
.cf-ledger-stats { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.cf-ledger-stat { display: flex; flex-direction: column; }

/* ============================================================
   Business Cards
   ============================================================ */
.cf-biz-card { transition: box-shadow 0.2s; }
.cf-biz-card:hover { box-shadow: var(--cf-shadow-md); }
.cf-biz-active { border-color: var(--cf-green) !important; border-width: 2px !important; }

.cf-biz-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  border-bottom: 1px solid var(--cf-border);
}
.cf-biz-card-body { padding: 1rem; }
.cf-biz-logo-lg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.cf-biz-initial-lg {
  width: 44px; height: 44px;
  background: var(--cf-green-pale);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: var(--cf-green);
  flex-shrink: 0;
}
.cf-biz-info { flex: 1; min-width: 0; }
.cf-biz-name { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }

.cf-add-biz-card {
  border: 2px dashed var(--cf-border);
  display: flex; align-items: center; justify-content: center;
  min-height: 140px;
  transition: border-color 0.2s;
}
.cf-add-biz-card:hover { border-color: var(--cf-green); }

/* ============================================================
   Bottom Navigation (Mobile)
   ============================================================ */
.cf-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--cf-bottom-nav-h);
  background: var(--cf-card-bg);
  border-top: 1px solid var(--cf-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 800;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}

.cf-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--cf-text-muted);
  font-size: 0.7rem;
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  transition: color 0.15s;
}
.cf-bottom-item i { font-size: 1.3rem; }
.cf-bottom-item.active, .cf-bottom-item:hover { color: var(--cf-green); }
.cf-bottom-fab-placeholder { width: 64px; flex-shrink: 0; }

/* ============================================================
   Floating Action Button
   ============================================================ */
.cf-fab {
  position: fixed;
  bottom: calc(var(--cf-bottom-nav-h) / 2 + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 50%);
  width: 56px; height: 56px;
  background: var(--cf-green);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(22,163,74,.4);
  cursor: pointer;
  z-index: 810;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cf-fab:hover { transform: translate(-50%, 50%) scale(1.08); box-shadow: 0 6px 20px rgba(22,163,74,.5); }

@media (min-width: 992px) {
  .cf-fab { display: none; }
}

/* ============================================================
   Filter Chips
   ============================================================ */
.cf-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cf-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  background: var(--cf-card-bg);
  border: 1px solid var(--cf-border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cf-text-muted);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.cf-chip:hover { border-color: var(--cf-green); color: var(--cf-green); }
.cf-chip.active { background: var(--cf-green); color: white; border-color: var(--cf-green); }

/* ============================================================
   Activity Feed
   ============================================================ */
.cf-activity-feed { }
.cf-activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--cf-border);
}
.cf-activity-item:last-child { border-bottom: none; }
.cf-activity-dot {
  width: 8px; height: 8px;
  background: var(--cf-green);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.cf-activity-content { flex: 1; }
.cf-activity-text { display: block; font-size: 0.85rem; }
.cf-activity-time { font-size: 0.75rem; }

/* ============================================================
   Tables
   ============================================================ */
.cf-table { }
.cf-table thead th {
  background: var(--cf-bg);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--cf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--cf-border);
  padding: 10px 16px;
}
.cf-table tbody td { padding: 12px 16px; vertical-align: middle; font-size: 0.9rem; }
.cf-table tbody tr:hover { background: var(--cf-bg); }

.cf-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* ============================================================
   Type Toggle (Cash In/Out)
   ============================================================ */
.cf-type-toggle {
  display: flex;
  gap: 0;
  border-radius: var(--cf-radius-sm);
  overflow: hidden;
  border: 2px solid var(--cf-border);
}
.cf-type-btn {
  flex: 1;
  background: var(--cf-card-bg);
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--cf-text-muted);
  transition: all 0.2s;
}
.cf-type-btn:first-child { border-right: 1px solid var(--cf-border); }
.cf-type-btn.active[data-type="cash_in"] { background: var(--cf-green); color: white; }
.cf-type-btn.active[data-type="cash_out"] { background: #ef4444; color: white; }

/* ============================================================
   Recurring Box
   ============================================================ */
.cf-recurring-box {
  background: var(--cf-bg);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  padding: 1rem;
}

/* ============================================================
   Color Picker
   ============================================================ */
.cf-color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.cf-color-option { cursor: pointer; }
.cf-color-option input { display: none; }
.cf-color-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: block;
  border: 3px solid transparent;
  transition: transform 0.15s;
}
.cf-color-option input:checked + .cf-color-dot {
  border-color: var(--cf-text);
  transform: scale(1.1);
}

/* ============================================================
   Logo Upload
   ============================================================ */
.cf-logo-upload-wrap {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 2px dashed var(--cf-border);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.cf-logo-placeholder { text-align: center; }
.cf-logo-preview { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cf-logo-upload-btn {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.5);
  color: white;
  text-align: center;
  padding: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   Members
   ============================================================ */
.cf-member-avatar {
  width: 36px; height: 36px;
  background: var(--cf-green-pale);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: var(--cf-green);
  flex-shrink: 0;
}

/* ============================================================
   Profile
   ============================================================ */
.cf-profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--cf-green-pale);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cf-profile-initials { font-size: 1.5rem; font-weight: 700; color: var(--cf-green); }

.cf-history-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--cf-border);
  gap: 10px;
}
.cf-history-item:last-child { border-bottom: none; }

/* ============================================================
   Reports / Legend
   ============================================================ */
.cf-category-legend { }
.cf-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--cf-border);
}
.cf-legend-item:last-child { border-bottom: none; }
.cf-legend-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cf-legend-label { flex: 1; }
.cf-legend-value { font-weight: 600; }

/* ============================================================
   Notifications
   ============================================================ */
.cf-notif-full-list { }
.cf-notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cf-border);
  position: relative;
}
.cf-notif-item:last-child { border-bottom: none; }
.cf-notif-item.unread { background: var(--cf-green-pale); }

.cf-notif-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cf-notif-transaction { background: #dbeafe; color: #2563eb; }
.cf-notif-reminder    { background: #fef9c3; color: #d97706; }
.cf-notif-member      { background: #ede9fe; color: #7c3aed; }
.cf-notif-system      { background: var(--cf-green-pale); color: var(--cf-green); }

.cf-notif-body { flex: 1; }
.cf-notif-title { font-weight: 600; font-size: 0.9rem; }
.cf-notif-msg { margin-top: 2px; }
.cf-notif-time { margin-top: 4px; }
.cf-notif-dot {
  width: 8px; height: 8px;
  background: var(--cf-green);
  border-radius: 50%;
  position: absolute;
  top: 16px; right: 16px;
}

/* ============================================================
   Modal
   ============================================================ */
.cf-modal { border-radius: var(--cf-radius); overflow: hidden; }
.cf-modal-header {
  background: var(--cf-green);
  color: white;
  border-bottom: none;
}
.cf-modal-header .modal-title { color: white; }

/* ============================================================
   PWA - Offline Bar
   ============================================================ */
.cf-offline-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1e293b;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 0.85rem;
  z-index: 9999;
  display: none;
}

/* PWA Install button */
.cf-pwa-install { padding: 0.5rem; }

/* ============================================================
   Badges
   ============================================================ */
.badge-income { background: #dcfce7; color: #16a34a; }
.badge-expense { background: #fee2e2; color: #dc2626; }
.badge-ledger { background: #dbeafe; color: #2563eb; }
.badge-owner  { background: #fef9c3; color: #92400e; }
.badge-admin  { background: #ede9fe; color: #5b21b6; }
.badge-editor { background: #dbeafe; color: #1d4ed8; }
.badge-viewer { background: #f1f5f9; color: #475569; }

/* ============================================================
   Empty States
   ============================================================ */
.cf-empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.cf-empty-page {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--cf-card-bg);
  border-radius: var(--cf-radius);
  border: 1px solid var(--cf-border);
}

/* ============================================================
   PWA Install Prompt
   ============================================================ */
#pwaInstallBtn { padding: 0.75rem; border-top: 1px solid var(--cf-border); margin-top: auto; }

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cf-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   Utilities
   ============================================================ */
.object-fit-cover { object-fit: cover; }
.cf-submit-btn { font-weight: 600; letter-spacing: 0.02em; }

/* ============================================================
   Party Avatars
   ============================================================ */
.cf-party-avatar {
  width: 36px; height: 36px;
  background: #ede9fe;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: #7c3aed;
  flex-shrink: 0;
}
.cf-party-avatar-lg {
  width: 72px; height: 72px;
  background: #ede9fe;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.4rem; color: #7c3aed;
}

/* Print styles */
@media print {
  .cf-header, .cf-sidebar, .cf-bottom-nav, .cf-fab { display: none !important; }
  .cf-main { margin: 0 !important; padding: 0 !important; }
  .cf-card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 576px) {
  .cf-stat-value { font-size: 0.95rem; }
  .cf-page-title { font-size: 1.25rem; }
  .cf-card-header { padding: 0.75rem 1rem; }
  .cf-card-body { padding: 1rem; }
}
