/* ==========================================================
   FAMILY BUDGET PWA - WARM TUSCAN PASTEL DESIGN SYSTEM
   Theme: Lucca, Italy (Sage, Terracotta, Soft Sand, Sky Blue)
   ========================================================== */

/* Color Tokens & Variables */
:root {
  /* Warm Earthy Backgrounds & Creams */
  --bg-main: #fbf8f3;
  --bg-card: rgba(255, 255, 255, 0.9);
  --border-card: rgba(224, 122, 95, 0.16);
  
  /* Text: Warm Espresso & Cocoa Browns */
  --text-primary: #3d3530;
  --text-secondary: #6e6056;
  --text-muted: #918177;
  
  /* Brand Accent Colors (Soft Friendly Pastels) */
  --accent-primary: #e07a5f;    /* Terracotta / Tuscan Clay */
  --accent-success: #789c74;    /* Tuscan Olive / Sage Green */
  --accent-danger: #d98880;     /* Dusty Rose / Soft Red */
  --accent-warning: #f4a261;    /* Golden Sun / Sandy Amber */
  
  /* Account Categories (Soft Pastel Highlights) */
  --color-joint: #83b0e1;       /* Sky Blue */
  --color-jack: #e76f51;        /* Terracotta Clay */
  --color-laura: #c3a6d8;       /* Sage Lavender */
  
  --transition-speed: 0.25s;
  --card-shadow: 0 10px 25px rgba(61, 52, 46, 0.05), 0 2px 5px rgba(61, 52, 46, 0.02);
}

/* Base Document Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    linear-gradient(rgba(251, 248, 243, 0.78), rgba(251, 248, 243, 0.78)),
    url('lucca_backdrop.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

h1, h2, h3, h4, .outfit-font {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 1.5rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(224, 122, 95, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* AUTHENTICATION VIEW */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-card);
  border-radius: 28px;
  width: 100%;
  max-width: 450px;
  padding: 3rem 2rem;
  box-shadow: var(--card-shadow);
  text-align: center;
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-area {
  margin-bottom: 2.5rem;
}

.logo-img {
  width: 96px;
  height: 96px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 6px 12px rgba(224, 122, 95, 0.25));
}

.logo-area h1 {
  font-size: 2.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.logo-area p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.login-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.google-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #ffffff;
  color: #1f2937;
  border: 1.5px solid rgba(61, 52, 46, 0.1);
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  transition: all var(--transition-speed) ease;
}

.google-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(61, 52, 46, 0.08);
  background: #fafaf9;
}

.google-icon {
  width: 20px;
  height: 20px;
}

.auth-error {
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: rgba(217, 136, 128, 0.15);
  border: 1px solid rgba(217, 136, 128, 0.3);
  border-radius: 10px;
  color: #c0392b;
  font-size: 0.85rem;
}

/* APP LAYOUT */
.main-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 0.4s ease-out;
}

.app-header {
  background: rgba(251, 248, 243, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--border-card);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-logo {
  width: 36px;
  height: 36px;
}

.brand-text h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.sync-status {
  font-size: 0.75rem;
  color: var(--accent-success);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
}

.sync-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-display-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.logout-btn {
  background: transparent;
  border: 1.5px solid rgba(61, 52, 46, 0.15);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-speed);
}

.logout-btn:hover {
  background: rgba(61, 52, 46, 0.05);
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.install-btn {
  background: var(--accent-primary);
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: opacity var(--transition-speed);
  margin-left: 0.5rem;
}

.install-btn:hover {
  opacity: 0.9;
}

/* DASHBOARD CONTAINER */
.dashboard-container {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* METRICS GRID (Educational Soft Gradients) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-speed);
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-card h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Metric-specific warm backgrounds */
.gradient-income {
  background: linear-gradient(135deg, #f3f9f4 0%, #e1f0e4 100%);
  border-color: rgba(120, 156, 116, 0.25);
}
.gradient-income .metric-value { color: var(--accent-success); }

.gradient-bills {
  background: linear-gradient(135deg, #fdf5f5 0%, #f7e2e0 100%);
  border-color: rgba(217, 136, 128, 0.25);
}
.gradient-bills .metric-value { color: #c05c54; }

.gradient-start {
  background: linear-gradient(135deg, #f2f7fc 0%, #e1eef9 100%);
  border-color: rgba(131, 176, 225, 0.3);
}
.gradient-start .metric-value { color: #4671a3; }

.gradient-remaining {
  background: linear-gradient(135deg, #fdfaf2 0%, #fbf0d8 100%);
  border-color: rgba(244, 162, 97, 0.25);
}
.gradient-remaining .metric-value { color: #d67a36; }

.gradient-remaining.deficit {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  border-color: var(--accent-danger);
}
.gradient-remaining.deficit .metric-value {
  color: var(--accent-danger);
}

/* DASHBOARD BODY */
.dashboard-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* GENERAL CARD STYLING */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-card);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1.5px solid rgba(224, 122, 95, 0.08);
  padding-bottom: 0.75rem;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-weight: 600;
  background: rgba(224, 122, 95, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(224, 122, 95, 0.25);
}

/* INPUTS & FORM CONTROLS (Soft & Creamy) */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

input[type="text"], input[type="number"], select, input[type="date"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1.5px solid rgba(61, 52, 46, 0.12);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(61, 52, 46, 0.02);
  transition: all var(--transition-speed);
}

input:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3.5px rgba(224, 122, 95, 0.15);
  background: #ffffff;
}

.form-field {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.col-half {
  flex: 1;
}

.currency-input-wrap {
  position: relative;
}

.currency-input-wrap span {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
}

.currency-input-wrap input {
  padding-left: 1.8rem;
}

/* BUTTONS (Tactile & Playful) */
button {
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(224, 122, 95, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 15px rgba(224, 122, 95, 0.3);
}
.btn-primary:active {
  transform: translateY(0.5px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1.5px solid rgba(61, 52, 46, 0.15);
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
}
.btn-secondary:hover {
  background: rgba(61, 52, 46, 0.04);
  color: var(--text-primary);
}

.btn-success {
  background: var(--accent-success);
  color: white;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(120, 156, 116, 0.2);
}
.btn-success:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 15px rgba(120, 156, 116, 0.3);
}

.btn-danger {
  background: var(--accent-danger);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
}
.btn-danger:hover {
  opacity: 0.9;
}

.btn-full {
  width: 100%;
}

/* SPECIAL FORMS: SPEND TRACKER */
.nlp-input-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.nlp-input-wrapper input {
  flex: 1;
}

.account-toggle-row {
  align-items: center;
  justify-content: space-between;
}

.account-toggle-group {
  display: flex;
  background: #ffffff;
  border: 1.5px solid rgba(61, 52, 46, 0.12);
  padding: 0.25rem;
  border-radius: 14px;
}

.account-toggle-group input[type="radio"] {
  display: none;
}

.account-toggle-group label.toggle-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-speed);
  border: 1px solid transparent;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Selected Account Toggles */
#acct-joint:checked ~ label[for="acct-joint"] {
  background: rgba(131, 176, 225, 0.15);
  color: #3b7cbd;
  border-color: rgba(131, 176, 225, 0.3);
}

#acct-jack:checked ~ label[for="acct-jack"] {
  background: rgba(244, 162, 97, 0.15);
  color: #d67a36;
  border-color: rgba(244, 162, 97, 0.3);
}

#acct-laura:checked ~ label[for="acct-laura"] {
  background: rgba(195, 166, 216, 0.15);
  color: #936fb2;
  border-color: rgba(195, 166, 216, 0.3);
}

.account-toggle-group input[type="radio"]:checked + label {
  background: var(--accent-terracotta);
  color: #ffffff;
  border-color: var(--accent-terracotta);
}

/* CONFIRM OVERLAY / DIALOG MODAL */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 52, 46, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.confirm-modal {
  background: #ffffff;
  border: 1.5px solid rgba(224, 122, 95, 0.2);
  border-radius: 28px;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(61, 52, 46, 0.15);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-modal h3 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}

.confirm-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.confirm-field {
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.confirm-input {
  background: #fdfcf9;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ACTIVE FIXED BILLS LIST */
.bills-list-container {
  margin-top: 1.5rem;
}

.bills-list-container h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.bills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid rgba(61, 52, 46, 0.06);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(61, 52, 46, 0.01);
}

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

.bill-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.bill-amount-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bill-amt {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--text-primary);
}

.btn-icon-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
  transition: color var(--transition-speed);
}
.btn-icon-del:hover {
  color: var(--accent-danger);
}

/* CHARTS ROW (Side-by-Side Light Grid) */
.charts-row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 240px;
}

/* LEDGER & TRANSACTION TABLES */
.ledger-table-wrap, .transactions-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

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

th {
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid rgba(61, 52, 46, 0.08);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(61, 52, 46, 0.04);
  vertical-align: middle;
}

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

.empty-list-msg, .empty-table-msg {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem;
}

/* Badges inside tables */
.acct-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(61, 52, 46, 0.06);
  color: var(--text-secondary);
}

.acct-badge.joint { background: rgba(131, 176, 225, 0.15); color: #3b7cbd; }
.acct-badge.jack { background: rgba(244, 162, 97, 0.15); color: #d67a36; }
.acct-badge.laura { background: rgba(195, 166, 216, 0.15); color: #936fb2; }

.pm-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.pm-badge.cash { background: rgba(120, 156, 116, 0.12); color: var(--accent-success); }
.pm-badge.joint-account { background: rgba(131, 176, 225, 0.12); color: #3b7cbd; }
.pm-badge.jack-personal { background: rgba(244, 162, 97, 0.12); color: #d67a36; }
.pm-badge.laura-personal { background: rgba(195, 166, 216, 0.12); color: #936fb2; }
.pm-badge.amex { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.pm-badge.jack-credit-card { background: rgba(100, 116, 139, 0.12); color: #475569; }
.pm-badge.laura-credit-card { background: rgba(168, 85, 247, 0.12); color: #7c3aed; }

.freq-badge {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
}
.status-badge.paid { background: rgba(120, 156, 116, 0.15); color: var(--accent-success); }
.status-badge.pending { background: rgba(244, 162, 97, 0.15); color: #d67a36; }

.amt-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--text-primary);
}

.tx-cat {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* CSV IMPORT & RECONCILIATION STYLES */
.csv-tabs {
  display: flex;
  background: #ffffff;
  border: 1.5px solid rgba(61, 52, 46, 0.12);
  padding: 0.25rem;
  border-radius: 14px;
  margin-bottom: 1.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-speed);
}

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

.tab-btn.active {
  background: rgba(61, 52, 46, 0.05);
  color: var(--text-primary);
  border-color: rgba(61, 52, 46, 0.08);
}

.panel-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.45;
}

.file-input {
  cursor: pointer;
  background: #ffffff;
  padding: 0.5rem;
  font-size: 0.85rem;
}

.file-input::-webkit-file-upload-button {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 0.75rem;
  box-shadow: 0 2px 5px rgba(224, 122, 95, 0.15);
  transition: opacity var(--transition-speed);
}
.file-input::-webkit-file-upload-button:hover {
  opacity: 0.9;
}

.csv-preview-container {
  margin-top: 1.5rem;
  border-top: 1.5px solid rgba(61, 52, 46, 0.06);
  padding-top: 1.25rem;
}

.csv-preview-container h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.reconcile-instructions {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.csv-preview-table-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid rgba(61, 52, 46, 0.08);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  background: #ffffff;
}

.csv-preview-table-wrap table {
  font-size: 0.85rem;
}

.csv-preview-table-wrap th {
  padding: 0.6rem;
  border-bottom-width: 1.5px;
}

.csv-preview-table-wrap td {
  padding: 0.6rem;
}

.btn-add-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-success);
  color: white;
  border: none;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(120, 156, 116, 0.3);
  transition: all var(--transition-speed);
}

.btn-add-circle:hover {
  transform: scale(1.15);
  box-shadow: 0 5px 12px rgba(120, 156, 116, 0.4);
}

.btn-add-circle.added {
  background: var(--text-muted);
  cursor: default;
  box-shadow: none;
  transform: none;
  color: rgba(255,255,255,0.4);
}

/* TOAST MESSAGE SYSTEM */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #3d3530;
  border: 1.5px solid var(--accent-primary);
  box-shadow: 0 10px 30px rgba(61, 52, 46, 0.15);
  padding: 0.85rem 1.75rem;
  border-radius: 14px;
  z-index: 9999;
  display: flex;
  align-items: center;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all var(--transition-speed);
}

.toast span {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
}

/* UTILITIES */
.hidden {
  display: none !important;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(120, 156, 116, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(120, 156, 116, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(120, 156, 116, 0); }
}

/* ==========================================
   MONTH NAVIGATION & NEW CHART STYLES
   ========================================== */
.month-navigation-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 0.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.month-navigation-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  text-align: center;
  flex: 1;
}

.nav-arrow-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid rgba(61, 52, 46, 0.12);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all var(--transition-speed);
  box-shadow: 0 2px 4px rgba(61, 52, 46, 0.02);
}

.nav-arrow-btn:hover {
  background: rgba(61, 52, 46, 0.04);
  color: var(--text-primary);
  border-color: rgba(61, 52, 46, 0.2);
}

.charts-column-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.main-chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sub-charts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.chart-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.75px;
  border-left: 3px solid var(--accent-primary);
  padding-left: 0.5rem;
}

.chart-container-large {
  position: relative;
  width: 100%;
  height: 260px;
  background: #ffffff;
  border: 1.5px solid rgba(61, 52, 46, 0.06);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: inset 0 2px 5px rgba(61, 52, 46, 0.01);
}

.charts-column-layout .chart-container {
  background: #ffffff;
  border: 1.5px solid rgba(61, 52, 46, 0.06);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: inset 0 2px 5px rgba(61, 52, 46, 0.01);
}

/* ==========================================
   NAVIGATION BAR & SECTION SWITCHING
   ========================================== */
.app-nav-bar {
  display: flex;
  gap: 0.6rem;
  background: rgba(251, 248, 243, 0.92);
  border-bottom: 1.5px solid var(--border-card);
  padding: 0.6rem 1.5rem;
  justify-content: center;
  position: sticky;
  top: 73px;
  z-index: 99;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 10px rgba(61, 52, 46, 0.02);
}

.nav-tab {
  background: transparent;
  border: 1.5px solid transparent;
  padding: 0.55rem 1.25rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-speed) ease;
}

.nav-tab:hover {
  background: rgba(61, 52, 46, 0.04);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(224, 122, 95, 0.22);
}

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease-out;
}

.two-column-setup {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* YTD Breakdown styles */
.ytd-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.education-bubble-card {
  background: linear-gradient(135deg, #fffcf4 0%, #fef2d9 100%) !important;
  border-color: rgba(244, 162, 97, 0.28) !important;
}

.education-content p {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.edu-tips {
  background: rgba(255, 255, 255, 0.6);
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px dashed rgba(244, 162, 97, 0.4);
}

.edu-tips strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: #d67a36;
}

.edu-tips ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.edu-tips li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.edu-tips li::before {
  content: '🌟';
  font-size: 0.75rem;
  line-height: 1.2;
}

/* ==========================================
   DESKTOP MEDIA QUERIES (GRID ENHANCEMENTS)
   ========================================== */
@media (min-width: 992px) {
  .dashboard-container {
    padding: 2rem;
    gap: 2rem;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  
  .dashboard-body {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .two-column-setup {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .left-col {
    flex: 4;
    max-width: 450px;
  }
  
  .right-col {
    flex: 7;
  }
  
  .sub-charts-grid {
    flex-direction: row;
  }
}

/* Progress Bars for Future Plans */
.plan-item {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(61, 52, 46, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(61, 52, 46, 0.01);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(61, 52, 46, 0.03);
}

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

.plan-title-text {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.plan-del-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.plan-del-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.plan-progress-container {
  height: 12px;
  background: rgba(61, 52, 46, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  margin: 0.6rem 0;
}

.plan-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #d67a36, var(--accent-success));
  border-radius: 6px;
  transition: width 0.4s ease;
}

.plan-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.plan-remaining {
  font-weight: 600;
  color: #c05c54;
}

/* Configuration Lists Manager */
.config-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.config-item-li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1.5px solid rgba(61, 52, 46, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

.config-item-li:hover {
  background: rgba(255, 255, 255, 0.8);
}

.btn-delete-config {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-delete-config:hover {
  opacity: 1;
  transform: scale(1.1);
}

.config-list-wrap {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

/* --- Mobile Device Experience Simplification --- */
@media (max-width: 768px) {
  /* Hide navigation bar tabs on mobile to force single-page focus */
  .app-nav-bar {
    display: none !important;
  }
  
  /* Hide desktop-only insights, configuration forms, and committed bill managers */
  .bills-mgmt-card,
  .bills-list-card,
  .charts-card,
  .ledger-card {
    display: none !important;
  }
  
  /* Adjust metrics layout to fit small screens compactly */
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .metric-card {
    padding: 0.75rem;
  }
  
  .metric-value {
    font-size: 1.35rem;
  }
}
