/* ==========================================================================
   Let i know - Main Stylesheet (css/style.css)
   Clean, Modern & Beginner-Friendly Personal Finance Dashboard
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (Theme Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --primary: #4f46e5;         /* Indigo primary */
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-text: #3730a3;

  /* Status & Accent Colors */
  --success: #10b981;         /* Emerald green (for income & positive) */
  --success-light: #ecfdf5;
  --success-text: #065f46;

  --danger: #ef4444;          /* Crimson red (for expenses) */
  --danger-light: #fef2f2;
  --danger-text: #991b1b;

  --warning: #f59e0b;         /* Amber warning */
  --warning-light: #fffbeb;
  --warning-text: #92400e;

  --info: #0284c7;            /* Sky blue */
  --info-light: #f0f9ff;
  --info-text: #075985;

  /* UPI App Brand Accents */
  --gpay-color: #1a73e8;
  --phonepe-color: #5f259f;
  --paytm-color: #00b9f5;
  --bhim-color: #004d40;
  --cred-color: #18181b;

  /* Neutral Surface & Background Colors */
  --bg-app: #f8fafc;          /* Slate 50 */
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;       /* Slate 900 */
  --bg-sidebar-hover: #1e293b; /* Slate 800 */
  --border-color: #e2e8f0;     /* Slate 200 */
  --border-subtle: #f1f5f9;    /* Slate 100 */

  /* Text Colors */
  --text-main: #0f172a;        /* Slate 900 */
  --text-muted: #64748b;       /* Slate 500 */
  --text-light: #94a3b8;       /* Slate 400 */
  --text-white: #ffffff;

  /* Typography */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Layout Dimensions */
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s ease-in-out;
}

/* --------------------------------------------------------------------------
   2. Reset & Base Styles
   -------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

/* --------------------------------------------------------------------------
   3. Main App Layout (Sidebar + Content)
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  position: relative;
  overflow: hidden;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.close-sidebar-btn {
  display: none;
  color: var(--text-light);
  font-size: 1.5rem;
}

/* Sidebar Navigation Links */
.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #cbd5e1;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition);
}

.nav-link:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.nav-link.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.nav-icon {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

/* Sidebar Footer / User Profile */
.sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(0, 0, 0, 0.15);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-info .user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.user-info .user-role {
  font-size: 0.72rem;
  color: var(--text-light);
}

.reset-data-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #94a3b8;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.reset-data-btn:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: #ef4444;
}

/* Sidebar Backdrop on Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   4. Main Content Area & Topbar
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  font-size: 1.4rem;
  color: var(--text-main);
  padding: 6px;
  border-radius: var(--radius-sm);
}

.page-title-box h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.page-title-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.today-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--border-subtle);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

/* --------------------------------------------------------------------------
   5. View Routing & Container
   -------------------------------------------------------------------------- */
.content-area {
  padding: 28px 32px 60px;
  flex: 1;
}

/* Only the active view section is visible */
.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
  display: block;
}

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

/* --------------------------------------------------------------------------
   6. UI Components: Metric Cards & Dashboard
   -------------------------------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

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

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

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

.metric-icon-box.indigo { background-color: var(--primary-light); color: var(--primary); }
.metric-icon-box.emerald { background-color: var(--success-light); color: var(--success); }
.metric-icon-box.crimson { background-color: var(--danger-light); color: var(--danger); }
.metric-icon-box.amber { background-color: var(--warning-light); color: var(--warning); }
.metric-icon-box.sky { background-color: var(--info-light); color: var(--info); }
.metric-icon-box.purple { background-color: #f3e8ff; color: #8b5cf6; }

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-sub .badge-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-tag.up { background-color: var(--success-light); color: var(--success-text); }
.badge-tag.down { background-color: var(--danger-light); color: var(--danger-text); }

/* Quick Action Row */
.quick-actions-bar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-actions-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

.btn-pill {
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: var(--transition);
}

.btn-pill:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Two Column Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-action-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}

.card-action-link:hover {
  text-decoration: underline;
}

/* Spending by Category Bars */
.category-bars-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.category-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.category-name {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-amount {
  font-weight: 700;
  color: var(--text-main);
}

.category-percent {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.progress-track {
  height: 8px;
  background-color: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   7. Transactions List & Table Styles
   -------------------------------------------------------------------------- */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: #fafbfc;
  transition: var(--transition);
}

.tx-item:hover {
  background-color: #ffffff;
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.tx-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background-color: var(--bg-app);
}

.tx-details {
  display: flex;
  flex-direction: column;
}

.tx-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.tx-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.tx-right {
  text-align: right;
}

.tx-amount {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.tx-amount.expense {
  color: var(--danger);
}

.tx-amount.income {
  color: var(--success);
}

.tx-mode-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #e2e8f0;
  color: #334155;
  font-weight: 500;
}

.tx-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.btn-icon-action {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  transition: var(--transition);
  cursor: pointer;
}

.btn-icon-action:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
  transform: translateY(-1px);
}

.btn-icon-action.edit:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: #c7d2fe;
}

.btn-icon-action.delete:hover {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: #fca5a5;
}

/* --------------------------------------------------------------------------
   8. UPI History View
   -------------------------------------------------------------------------- */
.upi-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.upi-filter-bar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: var(--transition);
}

.chip-btn.active, .chip-btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  min-width: 250px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

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

.custom-table th {
  background-color: #f8fafc;
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 16px 18px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr:hover {
  background-color: #fbfcfe;
}

/* App Badges */
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.app-badge.gpay { background-color: #e8f0fe; color: #1967d2; }
.app-badge.phonepe { background-color: #f3e8fd; color: #5f259f; }
.app-badge.paytm { background-color: #e0f7fe; color: #008cb7; }
.app-badge.bhim { background-color: #e0f2f1; color: #00695c; }
.app-badge.cred { background-color: #f4f4f5; color: #18181b; }
.app-badge.cash { background-color: #ecfdf5; color: #047857; }

/* --------------------------------------------------------------------------
   9. Cash Manager View
   -------------------------------------------------------------------------- */
.cash-type-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.cash-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.cash-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cash-tab-btn.active.expense {
  background-color: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}

.cash-tab-btn.active.income {
  background-color: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

.cash-quick-amounts {
  display: flex;
  gap: 6px;
  align-items: center;
}

.quick-amt-pill {
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background-color: var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.quick-amt-pill:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

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

.input-with-currency .currency-symbol {
  position: absolute;
  left: 14px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-currency input {
  padding-left: 32px !important;
  font-weight: 700;
  font-size: 1.05rem;
}

.cash-badge-in {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #ecfdf5;
  color: #047857;
}

.cash-badge-out {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #fef2f2;
  color: #b91c1c;
}

.cash-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.denomination-table {
  width: 100%;
  margin-top: 12px;
}

.denom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.denom-row:last-child {
  border-bottom: none;
}

.denom-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  width: 120px;
}

.denom-note-pill {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #e0f2fe;
  color: #0369a1;
}

.denom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.denom-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background-color: var(--border-subtle);
  border: 1px solid var(--border-color);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.denom-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.denom-input {
  width: 60px;
  height: 32px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.denom-subtotal {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  width: 100px;
  text-align: right;
}

.denom-summary-box {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: var(--radius-md);
  border: 1px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.denom-summary-text span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #166534;
  text-transform: uppercase;
}

.denom-summary-text strong {
  font-size: 1.4rem;
  color: #15803d;
}

/* --------------------------------------------------------------------------
   10. Daily Reports View
   -------------------------------------------------------------------------- */
.date-selector-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.date-nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-nav-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.date-nav-btn:hover {
  background-color: #e2e8f0;
}

.date-input-field {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  background-color: #ffffff;
  outline: none;
}

/* --------------------------------------------------------------------------
   Daily Financial Calculation Equation Card & Cash Sub-Balance
   -------------------------------------------------------------------------- */
.daily-calc-card {
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  position: relative;
  overflow: hidden;
}

.calc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.calc-status-badge.verified {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.calc-status-badge.unbalanced {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.daily-calc-equation-wrapper {
  display: grid;
  grid-template-columns: 1.1fr auto 1fr auto 1fr auto 1fr auto 1fr auto 1.1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.calc-item-box {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  min-width: 124px;
  transition: var(--transition);
}

.calc-item-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.calc-item-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.calc-item-amount {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.calc-item-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.calc-item-box.opening {
  border-color: #cbd5e1;
  background-color: #ffffff;
}
.calc-item-box.opening .calc-item-header { color: #475569; }
.calc-item-box.opening .calc-item-amount { color: #0f172a; }

.calc-item-box.income {
  border-color: #a7f3d0;
  background-color: #f0fdf4;
}
.calc-item-box.income .calc-item-header { color: #047857; }
.calc-item-box.income .calc-item-amount { color: var(--success); }

.calc-item-box.expense {
  border-color: #fecaca;
  background-color: #fef2f2;
}
.calc-item-box.expense .calc-item-header { color: #b91c1c; }
.calc-item-box.expense .calc-item-amount { color: var(--danger); }

.calc-item-box.savings {
  border-color: #ddd6fe;
  background-color: #f5f3ff;
}
.calc-item-box.savings .calc-item-header { color: #6d28d9; }
.calc-item-box.savings .calc-item-amount { color: #7c3aed; }

.calc-item-box.transfer-in {
  border-color: #bae6fd;
  background-color: #f0f9ff;
}
.calc-item-box.transfer-in .calc-item-header { color: #0369a1; }
.calc-item-box.transfer-in .calc-item-amount { color: var(--info); }

.calc-item-box.closing {
  border-color: #818cf8;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}
.calc-item-box.closing .calc-item-header { color: #3730a3; }
.calc-item-box.closing .calc-item-amount { color: var(--primary); }

.calc-operator-sym {
  font-size: 1.25rem;
  font-weight: 800;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
}

.calc-operator-sym.equals {
  color: var(--primary);
  font-size: 1.4rem;
}

.cash-subbalance-bar {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.cash-subbalance-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cash-subbalance-details {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.cash-metric-divider {
  color: #cbd5e1;
}

.calc-audit-note {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 10px;
  padding: 8px 14px;
  background-color: #f1f5f9;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   11. Monthly Summary View
   -------------------------------------------------------------------------- */
.budget-meter-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.budget-meter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.budget-stats-row {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 18px;
}

.budget-stat-item span {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.budget-stat-item strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Weekly CSS Bar Chart */
.chart-container {
  padding-top: 16px;
}

.bar-chart-flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 200px;
  padding: 20px 20px 0;
  border-bottom: 2px solid var(--border-color);
  gap: 16px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar-value-tooltip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.bar-column {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 8px;
}

.bar-column:hover {
  filter: brightness(1.15);
}

.bar-labels-flex {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px 0;
}

.bar-label {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   12. Savings Goals View
   -------------------------------------------------------------------------- */
.savings-summary-banner {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  gap: 20px;
}

.savings-banner-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.savings-banner-text p {
  color: #c7d2fe;
  font-size: 0.88rem;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.goal-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.goal-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.goal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.goal-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.goal-category-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.goal-amounts {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.goal-current {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
}

.goal-target {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.goal-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal-date-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   13. Notes View
   -------------------------------------------------------------------------- */
.notes-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.notes-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notes-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notes-title-row h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.notes-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  background-color: #e0e7ff;
  color: var(--primary);
  border-radius: 20px;
}

.notes-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

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

.notes-search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  min-width: 280px;
  position: relative;
  transition: var(--transition);
}

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

.notes-search-wrapper input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
  color: var(--text-main);
}

.clear-search-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
  color: var(--text-muted);
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
}

.clear-search-btn:hover {
  color: var(--danger);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.note-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  position: relative;
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.note-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Note Pastel Themes */
.note-card.yellow { background-color: #fef9c3; border-color: #fef08a; }
.note-card.blue { background-color: #e0f2fe; border-color: #bae6fd; }
.note-card.green { background-color: #dcfce7; border-color: #bbf7d0; }
.note-card.purple { background-color: #f3e8ff; border-color: #e9d5ff; }

.note-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

.note-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background-color: rgba(255, 255, 255, 0.75);
  color: #334155;
  cursor: pointer;
  transition: var(--transition);
}

.note-action-btn:hover {
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.note-action-btn.edit-note-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background-color: #ffffff;
}

.note-action-btn.delete-note-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background-color: #fee2e2;
}

.note-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  line-height: 1.35;
  word-break: break-word;
}

.note-description,
.note-content {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  margin-bottom: 14px;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
  margin-top: auto;
}

.note-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 5px;
}

.note-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  background-color: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.notes-empty-state {
  text-align: center;
  padding: 48px 24px;
  background-color: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.notes-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.notes-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.notes-empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   14. Modal Dialogs & Forms
   -------------------------------------------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 1000;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 28px;
  position: relative;
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  font-size: 1.4rem;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
}

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

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  outline: none;
  background-color: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

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

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   CSV Import Modal Components
   -------------------------------------------------------------------------- */
.csv-info-box {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.csv-code-badge {
  display: inline-block;
  background-color: #e2e8f0;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  margin: 0 2px;
}

.csv-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  background-color: #fafbfc;
  cursor: pointer;
  transition: var(--transition);
}

.csv-upload-dropzone:hover, .csv-upload-dropzone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.csv-stats-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.csv-stat-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.csv-stat-pill.total {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.csv-stat-pill.valid {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.csv-stat-pill.invalid {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.csv-error-alert {
  background-color: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  max-height: 140px;
  overflow-y: auto;
}

.csv-error-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #be123c;
  margin-bottom: 6px;
}

.csv-error-list {
  list-style: none;
  padding-left: 0;
  font-size: 0.76rem;
  color: #9f1239;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.csv-error-list li {
  line-height: 1.4;
}

.imported-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: #e0f2fe;
  color: #0369a1;
  margin-left: 4px;
  text-transform: uppercase;
}

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

.toast {
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s ease;
}

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

.toast.success { border-left: 4px solid var(--success); }
.toast.info { border-left: 4px solid var(--info); }
.toast.danger { border-left: 4px solid var(--danger); }

/* --------------------------------------------------------------------------
   16. Lent & Borrowed Money Tracker View
   -------------------------------------------------------------------------- */
.lending-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.lending-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lending-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lending-title-row h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.lending-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  background-color: #fef3c7;
  color: #92400e;
  border-radius: 20px;
}

.lending-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.lending-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  background-color: var(--bg-card);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.lending-search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  min-width: 260px;
  flex: 1;
  max-width: 380px;
  transition: var(--transition);
}

.lending-search-wrapper:focus-within {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.lending-search-wrapper input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
  color: var(--text-main);
}

/* Auto-Delete Toggle Switch Container */
.auto-delete-feature-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  padding: 6px 14px;
  border-radius: var(--radius-md);
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-container input:checked + .switch-slider {
  background-color: var(--success);
}

.switch-container input:checked + .switch-slider:before {
  transform: translateX(16px);
}

.switch-text {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #92400e;
}

.switch-desc {
  font-size: 0.7rem;
  color: #b45309;
}

/* Lending Cards Grid */
.lending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.lend-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: var(--transition);
  border-left: 5px solid #d97706; /* Default amber */
}

.lend-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.lend-card.pending {
  border-left-color: #f59e0b;
}

.lend-card.partial {
  border-left-color: #3b82f6;
}

.lend-card.settled {
  border-left-color: #10b981;
  background-color: #fcfdfd;
}

.lend-card.overdue {
  border-left-color: #ef4444;
}

/* Card Header */
.lend-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lend-person-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.lend-person-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.lend-person-phone {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.lend-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.lend-badge.pending {
  background-color: #fef3c7;
  color: #92400e;
}

.lend-badge.partial {
  background-color: #dbeafe;
  color: #1e40af;
}

.lend-badge.settled {
  background-color: #d1fae5;
  color: #065f46;
}

.lend-badge.overdue {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Amount & Progress Section */
.lend-amounts-box {
  background-color: var(--bg-app);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.lend-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.lend-amount-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lend-amount-val {
  font-size: 1.25rem;
  font-weight: 800;
}

.lend-amount-val.remaining {
  color: #dc2626;
}

.lend-progress-track {
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.lend-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Metadata (Dates, Notes, Mode) */
.lend-meta-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.lend-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.lend-notes-quote {
  background-color: #f8fafc;
  border-left: 3px solid #cbd5e1;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  font-size: 0.78rem;
  color: #475569;
  margin-top: 4px;
  font-style: italic;
  word-break: break-word;
}

/* Card Actions */
.lend-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  flex-wrap: wrap;
}

.lend-btn-settle-delete {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.lend-btn-settle-delete:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(16, 185, 129, 0.3);
}

.lend-btn-repay {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #e0e7ff;
  color: var(--primary);
  border: 1px solid #c7d2fe;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.lend-btn-repay:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.lend-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.lend-icon-btn:hover {
  background-color: var(--bg-app);
  color: var(--text-main);
}

.lend-icon-btn.delete:hover {
  background-color: #fee2e2;
  color: var(--danger);
  border-color: #fca5a5;
}

/* Repayment History Dropdown */
.lend-history-accordion {
  margin-top: 10px;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}

.lend-history-toggle {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lend-history-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
}

.lend-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background-color: #f8fafc;
  border-radius: 4px;
}

/* Direction Selectors & Borrowed Themes */
.lend-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.lend-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--bg-card);
  user-select: none;
}

.lend-type-option:hover {
  border-color: #cbd5e1;
  background-color: var(--bg-app);
}

.lend-type-option.active {
  border-color: var(--primary);
  background-color: #eff6ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.lend-type-option#type-opt-borrowed.active {
  border-color: #7c3aed;
  background-color: #f5f3ff;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.type-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.type-info {
  display: flex;
  flex-direction: column;
}

.type-info strong {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.2;
}

.type-info small {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.2;
}

/* Direction Badges (Lent vs Borrowed) */
.direction-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.direction-badge.lent {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.direction-badge.borrowed {
  background-color: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

/* Card Variations for Borrowed */
.lend-card.borrowed {
  border-left-color: #7c3aed;
}

.lend-card.borrowed .lend-avatar {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.lend-card.borrowed .lend-amount-val.remaining {
  color: #7c3aed;
}

.lend-card.borrowed .lend-progress-fill {
  background: linear-gradient(90deg, #7c3aed, #6d28d9);
}

/* Net Debt Position Badges */
.badge-tag.net-positive {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
}

.badge-tag.net-negative {
  background-color: #fee2e2 !important;
  color: #991b1b !important;
}

.badge-tag.net-neutral {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}

.metric-value.net-positive {
  color: #10b981 !important;
}

.metric-value.net-negative {
  color: #ef4444 !important;
}

.metric-value.net-neutral {
  color: var(--text-main) !important;
}

/* --------------------------------------------------------------------------
   17. Authentication & Login / Sign Up System
   -------------------------------------------------------------------------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: radial-gradient(circle at 50% 10%, rgba(99, 102, 241, 0.15), transparent 70%),
              linear-gradient(135deg, #090d16 0%, #111827 50%, #090d16 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  backdrop-filter: blur(8px);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 36px 32px;
  position: relative;
  animation: authCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  justify-content: center;
  margin-bottom: 8px;
}

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

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

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

.auth-tab-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.4;
  font-weight: 500;
}

.auth-alert.danger {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-alert.success {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

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

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

.toggle-password-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 8px;
  color: var(--text-muted);
  transition: var(--transition);
}

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

.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 6px 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 10px;
}

.demo-quick-btn {
  width: 100%;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  justify-content: center;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #334155;
  transition: var(--transition);
}

.demo-quick-btn:hover {
  background-color: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

.signup-first-time-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #166534;
}

.signup-first-time-notice strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.signup-first-time-notice p {
  margin: 0;
  line-height: 1.35;
  color: #15803d;
}

/* --------------------------------------------------------------------------
   18. Onboarding Modal & Live Net Balance Summary
   -------------------------------------------------------------------------- */
.onboarding-card {
  border-top: 5px solid var(--primary);
}

.onboard-header {
  text-align: center;
  margin-bottom: 14px;
}

.onboard-summary-box {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-top: 14px;
}

.onboard-summary-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.onboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.onboard-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.onboard-summary-item span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.onboard-summary-item strong {
  font-size: 1.05rem;
  color: var(--text-main);
}

.onboard-summary-item.total strong {
  color: var(--success);
  font-size: 1.2rem;
  font-weight: 800;
}

/* Logout Button in Sidebar & Topbar */
.logout-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition);
}

.logout-btn:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: var(--danger);
}

.topbar-logout-btn {
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.topbar-logout-btn:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   19. Infinity Symbol Logo & Creator Attribution (Sai Charan Bandam)
   -------------------------------------------------------------------------- */
/* Light Watermark 'C' letter background for infinity logo */
.logo-watermark-c {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  font-size: 2.25rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.22); /* elegant light watermark transparency */
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  letter-spacing: -1.5px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.auth-brand-icon .logo-watermark-c {
  font-size: 2.75rem;
}

.brand-logo:hover .logo-watermark-c {
  color: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -52%) scale(1.06);
}

.brand-icon svg.infinity-logo-svg {
  position: relative;
  z-index: 2;
  display: block;
  stroke: #ffffff;
  stroke-width: 2.6;
  fill: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.auth-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

/* Sidebar Creator Credit Badge (Placed near logout button) */
.creator-credit-sidebar {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.22);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  transition: var(--transition);
}

.creator-credit-sidebar:hover {
  background: rgba(79, 70, 229, 0.14);
  border-color: rgba(79, 70, 229, 0.4);
}

.creator-credit-sidebar .creator-name {
  color: var(--primary);
  font-weight: 700;
}

.creator-credit-sidebar .creator-icon {
  margin-right: 3px;
  display: inline-block;
}

/* Auth Modal Creator Badge (Visible near login & signup tabs) */
.auth-creator-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--primary);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 10px;
}

.auth-creator-badge strong {
  color: var(--primary-dark, #4338ca);
  font-weight: 700;
}

/* Auth Card Footer Attribution */
.auth-footer-credit {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-footer-credit strong {
  color: var(--text-main);
  font-weight: 600;
}



