/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (SUPPORTING 4 PASTEL THEMES)
   ========================================================================== */

:root {
  /* Common variables */
  --font-title: 'Mitr', sans-serif;
  --font-body: 'Outfit', 'Sarabun', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 10px;
  --box-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --box-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.05);
  --box-shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.08);
  --sidebar-width: 280px;

  /* Couple individual colors */
  --p1-color: #a8dadc; /* Soft Blue/Teal for Partner 1 */
  --p2-color: #ff758f; /* Soft Pink for Partner 2 */
  --shared-color: #ffd166; /* Pastel Yellow for Shared */
}

/* 🌸 THEME 1: SAKURA PINK (DEFAULT) */
.theme-sakura {
  --primary-color: #ff5c8a;
  --primary-light: #fff0f3;
  --primary-hover: #ff477e;
  --accent-color: #ff9ebb;
  --bg-app: #fcfafb;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --text-main: #2b1f21;
  --text-muted: #8a7376;
  --border-color: #f3e9eb;
  --color-income: #2a9d8f;
  --color-income-light: #e8f7f5;
  --color-expense: #e76f51;
  --color-expense-light: #fdf0ec;
  --gradient-main: linear-gradient(135deg, #ff5c8a 0%, #ff85a7 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #fffefe 100%);
}

/* 🍇 THEME 2: COZY LAVENDER */
.theme-lavender {
  --primary-color: #9f86c0;
  --primary-light: #f5f0fb;
  --primary-hover: #8e70b3;
  --accent-color: #beb2c6;
  --bg-app: #f7f3fd;
  --bg-card: #ffffff;
  --bg-sidebar: #f2eafd;
  --text-main: #2e2836;
  --text-muted: #756a81;
  --border-color: #ebdffd;
  --color-income: #2a9d8f;
  --color-income-light: #e8f7f5;
  --color-expense: #e76f51;
  --color-expense-light: #fdf0ec;
  --gradient-main: linear-gradient(135deg, #9f86c0 0%, #b5e2fa 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
}

/* 🌿 THEME 3: MINTY FRESH */
.theme-mint {
  --primary-color: #2ec4b6;
  --primary-light: #e6fcf9;
  --primary-hover: #21a196;
  --accent-color: #96e0db;
  --bg-app: #f2faf9;
  --bg-card: #ffffff;
  --bg-sidebar: #ebf7f5;
  --text-main: #1f2c2a;
  --text-muted: #6c7e7b;
  --border-color: #d8f5f1;
  --color-income: #2ec4b6;
  --color-income-light: #e6fcf9;
  --color-expense: #ff9f1c;
  --color-expense-light: #fff5e6;
  --gradient-main: linear-gradient(135deg, #2ec4b6 0%, #80ed99 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #f7fcfb 100%);
}

/* 🌊 THEME 4: OCEAN BREEZE */
.theme-ocean {
  --primary-color: #3a86c8;
  --primary-light: #edf5fc;
  --primary-hover: #2a6ca6;
  --accent-color: #9ac2e6;
  --bg-app: #f3f7fb;
  --bg-card: #ffffff;
  --bg-sidebar: #eaf1f8;
  --text-main: #202b35;
  --text-muted: #6e7d8c;
  --border-color: #e0ecf7;
  --color-income: #06d6a0;
  --color-income-light: #e6faf5;
  --color-expense: #ef476f;
  --color-expense-light: #fdeced;
  --gradient-main: linear-gradient(135deg, #3a86c8 0%, #a8dadc 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}

/* ==========================================================================
   GLOBAL RESET & STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-title);
  font-weight: 500;
  letter-spacing: -0.2px;
}

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

button, input, select, textarea {
  font-family: inherit;
  outline: none;
  border: none;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.app-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  border-right: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

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

.heart-pulse {
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.menu-item i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.menu-item:hover, .menu-item.active {
  background-color: var(--bg-card);
  color: var(--primary-color);
  box-shadow: var(--box-shadow-sm);
  transform: translateX(4px);
}

.menu-item.active {
  font-weight: 500;
}

/* Sidebar Deco Card */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px 20px;
  border-radius: var(--border-radius-lg);
  position: relative;
  text-align: center;
  box-shadow: var(--box-shadow-sm);
  margin-top: auto;
}

.sidebar-card-icon {
  font-size: 2.2rem;
  color: var(--primary-color);
  opacity: 0.8;
  margin-bottom: 12px;
}

.sidebar-card-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
  font-family: var(--font-title);
  margin-bottom: 8px;
}

.sidebar-card-heart {
  color: var(--primary-color);
  font-size: 1.6rem;
  animation: beat 1s infinite alternate;
}

@keyframes beat {
  to { transform: scale(1.35); }
}

/* Main Content Area Styling */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* ==========================================================================
   TOP BAR / HEADER
   ========================================================================== */

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1001;
}

.header-greeting h2 {
  font-size: 2rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.header-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Notification badge */
.notification-badge {
  position: relative;
  width: 44px;
  height: 44px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--box-shadow-sm);
  transition: var(--transition-smooth);
}

.notification-badge:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.badge-dot {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
}

/* Sync status badge */
.sync-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: var(--box-shadow-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.sync-status-indicator:hover {
  transform: translateY(-2px);
}

.sync-status-indicator.offline {
  color: var(--text-muted);
}

.sync-status-indicator.online {
  color: var(--color-income);
  border-color: var(--color-income);
}

.sync-status-indicator.syncing i {
  animation: spin 1s infinite linear;
}

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

/* Profile Selector Dropdown */
.profile-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  cursor: pointer;
  box-shadow: var(--box-shadow-sm);
  transition: var(--transition-smooth);
  user-select: none;
}

.profile-dropdown:hover {
  transform: translateY(-2px);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-pair {
  font-size: 1.1rem;
  display: flex;
  gap: 1px;
}

.profile-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.profile-dropdown i {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Dropdown menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--box-shadow-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition-smooth);
  z-index: 1000;
}

.profile-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.dropdown-menu a:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

/* ==========================================================================
   DYNAMIC SECTIONS & ACTIVE STATES
   ========================================================================== */

.content-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

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

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title-bar h2 {
  font-size: 1.8rem;
  color: var(--text-main);
}

.section-title-bar p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   SUMMARY CARDS ROW
   ========================================================================== */

.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

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

/* Subtle background glowing */
.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
}

.summary-card.balance::before { background: var(--gradient-main); }
.summary-card.income::before { background-color: var(--color-income); }
.summary-card.expenses::before { background-color: var(--color-expense); }
.summary-card.remaining::before { background: linear-gradient(135deg, var(--color-income) 0%, var(--primary-color) 100%); }

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

.summary-card .card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.summary-card .card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.summary-card.balance .card-icon { background-color: var(--primary-light); color: var(--primary-color); }
.summary-card.income .card-icon { background-color: var(--color-income-light); color: var(--color-income); }
.summary-card.expenses .card-icon { background-color: var(--color-expense-light); color: var(--color-expense); }
.summary-card.remaining .card-icon { background-color: var(--primary-light); color: var(--primary-color); }

.summary-card .card-value {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.summary-card .card-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   DASHBOARD SUB-GRID & CARDS
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 24px;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.content-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-smooth);
}

.content-card:hover {
  box-shadow: var(--box-shadow-md);
}

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

.card-section-header h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.header-actions-link {
  display: flex;
  align-items: center;
  gap: 14px;
}

.view-all-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.view-all-link:hover {
  color: var(--primary-color);
}

/* ==========================================================================
   SAVINGS GOALS (เป้าหมายของเรา)
   ========================================================================== */

.goals-list-compact {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.goal-item-compact {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
  position: relative;
  cursor: pointer;
}

.goal-img-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: var(--box-shadow-sm);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.goal-item-compact:hover .goal-img-circle {
  transform: scale(1.08) rotate(6deg);
}

.goal-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.goal-title-lbl {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

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

.goal-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.goal-saved-val {
  font-weight: 600;
  color: var(--text-main);
}

.goal-percent-val {
  color: var(--primary-color);
  font-weight: 600;
}

.progress-bar-wrapper {
  height: 8px;
  background-color: var(--primary-light);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-main);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Empty Goal Placeholder */
.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.empty-placeholder i {
  font-size: 2.2rem;
  color: var(--accent-color);
}

/* ==========================================================================
   RECENT TRANSACTIONS (รายการล่าสุด)
   ========================================================================== */

.transactions-list-compact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-item-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--primary-light);
  border-radius: var(--border-radius-md);
  transition: var(--transition-smooth);
}

.tx-item-compact:hover {
  transform: translateX(4px);
}

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

.tx-icon-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.tx-item-compact.income {
  background-color: var(--color-income-light);
}

.tx-item-compact.income .tx-icon-pill {
  background-color: var(--color-income);
  color: white;
}

.tx-item-compact.expense {
  background-color: var(--color-expense-light);
}

.tx-item-compact.expense .tx-icon-pill {
  background-color: var(--color-expense);
  color: white;
}

.tx-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx-title-lbl {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

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

.tx-right-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-amount-lbl {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
}

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

.tx-payer-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  background-color: rgba(255,255,255,0.75);
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* ==========================================================================
   FINANCIAL CALENDAR (ปฏิทินการเงิน)
   ========================================================================== */

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.btn-calendar-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-calendar-arrow:hover {
  background-color: var(--primary-color);
  color: white;
}

.calendar-current-month {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  min-width: 120px;
  text-align: center;
}

.btn-calendar-today {
  padding: 4px 10px;
  border-radius: 12px;
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-calendar-today:hover {
  background-color: var(--primary-color);
  color: white;
}

.calendar-grid-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(72px, auto);
  gap: 8px;
}

.calendar-day-cell {
  background-color: var(--primary-light);
  border-radius: var(--border-radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  border: 1.5px solid transparent;
}

.calendar-day-cell:hover {
  background-color: white;
  border-color: var(--accent-color);
  transform: scale(1.05);
  box-shadow: var(--box-shadow-sm);
}

.calendar-day-cell.inactive {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.calendar-day-cell.today {
  background-color: var(--primary-color) !important;
  color: white;
  border-color: var(--primary-hover);
}

.calendar-day-cell.today .day-number {
  font-weight: 700;
}

.calendar-day-cell.selected {
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: var(--box-shadow-sm);
}

.day-number {
  font-size: 1rem;
  font-weight: 600;
}

/* Dots or text indicators on day cell for finance transactions */
.day-financials {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin-top: 4px;
}

.day-amt-tag {
  font-family: var(--font-title);
  font-size: 0.62rem;
  width: 100%;
  text-align: center;
  border-radius: 4px;
  padding: 1px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-amt-tag.inc {
  background-color: var(--color-income-light);
  color: var(--color-income);
}

.day-amt-tag.exp {
  background-color: var(--color-expense-light);
  color: var(--color-expense);
}

.calendar-day-cell.today .day-amt-tag.inc { background-color: rgba(255,255,255,0.2); color: white; }
.calendar-day-cell.today .day-amt-tag.exp { background-color: rgba(255,255,255,0.25); color: white; }

/* Selected Date breakdown section below calendar */
.selected-date-panel {
  background-color: var(--bg-app);
  border-radius: var(--border-radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border-color);
}

#tab-dashboard .selected-date-panel {
  display: none !important;
}

.selected-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.selected-date-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

.selected-date-balance {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.selected-date-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.selected-date-tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 6px 0;
}

.selected-date-tx-row .tx-type-lbl {
  color: var(--text-muted);
}

.selected-date-tx-row.income .val-lbl { color: var(--color-income); font-weight: 600; }
.selected-date-tx-row.expense .val-lbl { color: var(--color-expense); font-weight: 600; }

/* Tip card design */
.tip-card {
  background-color: var(--primary-light);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--box-shadow-sm);
  position: relative;
  overflow: hidden;
}

.tip-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tip-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.tip-text-block h4 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.tip-text-block p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tip-heart {
  font-size: 1.2rem;
  color: var(--primary-color);
  opacity: 0.65;
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ==========================================================================
   DONUT CHART & CATEGORIES (รายจ่ายร่วมกัน)
   ========================================================================== */

.chart-value-summary {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 8px;
}

.donut-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.donut-chart-svg-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
}

.donut-chart {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.donut-chart-slice {
  fill: transparent;
  stroke-width: 12;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.donut-chart-slice:hover {
  stroke-width: 15;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.donut-center-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.donut-center-val {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
}

.chart-legend-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.legend-item:hover {
  background-color: var(--primary-light);
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label-col {
  display: flex;
  flex-direction: column;
}

.legend-name {
  color: var(--text-main);
  font-weight: 500;
}

.legend-amt {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* ==========================================================================
   SAVINGS ACCOUNTS (เงินเก็บของเรา)
   ========================================================================== */

.savings-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.savings-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background-color: var(--primary-light);
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.savings-account-item:hover {
  background-color: white;
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-sm);
}

.sa-left-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sa-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  background-color: white;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--box-shadow-sm);
}

.savings-account-item:nth-child(2) .sa-icon-box { color: var(--p2-color); }
.savings-account-item:nth-child(3) .sa-icon-box { color: var(--color-income); }

.sa-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sa-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

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

.sa-balance-val {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Quote Card bottom */
.quote-card {
  background: var(--gradient-card);
  border: 1px dashed var(--accent-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
}

.quote-card .quote-text {
  font-family: var(--font-title);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  font-style: italic;
  margin-bottom: 12px;
}

.quote-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* ==========================================================================
   TABLES & TRANSACTION MANAGEMENT SECTION
   ========================================================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 24px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-sm);
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-group select {
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.filter-group select:hover {
  border-color: var(--accent-color);
}

.filter-group-search {
  margin-left: auto;
  position: relative;
  min-width: 250px;
}

.filter-group-search input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.filter-group-search input:focus {
  border-color: var(--primary-color);
  background-color: white;
}

.filter-group-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.table-card {
  padding: 8px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.tx-table th, .tx-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.tx-table th {
  font-family: var(--font-title);
  color: var(--text-muted);
  font-weight: 500;
  background-color: var(--primary-light);
}

.tx-table tbody tr {
  transition: var(--transition-smooth);
}

.tx-table tbody tr:hover {
  background-color: var(--primary-light);
}

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

.tx-amount-col {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
}

.tx-amount-col.inc { color: var(--color-income); }
.tx-amount-col.exp { color: var(--color-expense); }

/* Table Action Buttons */
.btn-icon-table {
  width: 28px;
  height: 28px;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.btn-icon-table.edit {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.btn-icon-table.edit:hover {
  background-color: var(--primary-color);
  color: white;
}

.btn-icon-table.delete {
  background-color: #ffeef0;
  color: #ff4d6d;
}

.btn-icon-table.delete:hover {
  background-color: #ff4d6d;
  color: white;
}

/* ==========================================================================
   GOALS VIEW (FULL)
   ========================================================================== */

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

.goal-card-full {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-smooth);
  position: relative;
}

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

.goal-card-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 6px;
}

.goal-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.goal-card-emoji {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-light);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow-sm);
}

.goal-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.goal-card-info h3 {
  font-size: 1.1rem;
  color: var(--text-main);
}

.goal-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.goal-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background-color: var(--bg-app);
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.goal-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.goal-metric .val {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   SAVINGS VIEW (FULL)
   ========================================================================== */

.savings-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}

.savings-card-full {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-smooth);
}

.savings-card-full:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-md);
}

.sc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sc-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-md);
  background-color: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.savings-card-full:nth-child(2) .sc-icon { background-color: #ffeef1; color: var(--p2-color); }
.savings-card-full:nth-child(3) .sc-icon { background-color: var(--color-income-light); color: var(--color-income); }

.sc-name {
  font-size: 1.1rem;
  font-weight: 500;
}

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

.sc-balance {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 10px;
}

/* Transfer Money styling */
.transfer-card {
  background: var(--gradient-card);
}

.transfer-form .form-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.transfer-form .form-group {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transfer-form .form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.transfer-form .form-group select,
.transfer-form .form-group input {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background-color: white;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.transfer-form .form-group select:focus,
.transfer-form .form-group input:focus {
  border-color: var(--primary-color);
}

.form-group-arrow {
  align-self: center;
  font-size: 1.5rem;
  color: var(--accent-color);
  padding-bottom: 8px;
}

.form-group-submit {
  align-self: flex-end;
}

/* ==========================================================================
   REPORTS & OVERVIEW CHARTS
   ========================================================================== */

.reports-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.report-box {
  display: flex;
  gap: 40px;
  padding: 20px 0;
  align-items: center;
}

.report-chart-section {
  flex-shrink: 0;
}

.report-details-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-month-title {
  font-size: 1.2rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
}

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

.report-table th, .report-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.report-table th {
  color: var(--text-muted);
  font-weight: 500;
}

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

.report-percentage-badge {
  font-family: var(--font-title);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.analysis-tips {
  display: flex;
  flex-direction: column;
  gap: 14px;
  line-height: 1.6;
  font-size: 0.9rem;
}

.analysis-tip-item {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary-color);
}

.analysis-tip-item.alert {
  background-color: var(--color-expense-light);
  border-left-color: var(--color-expense);
}

/* Overview Bar Chart */
.bar-chart-col {
  width: 40px;
  background-color: var(--primary-light);
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: var(--transition-smooth);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 10px;
}

.bar-chart-col:hover {
  background-color: var(--primary-color);
}

.bar-value-label {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  pointer-events: none;
}

.bar-chart-col::before {
  content: attr(data-value);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-main);
  color: white;
  font-size: 0.65rem;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  pointer-events: none;
  white-space: nowrap;
}

.bar-chart-col:hover::before {
  opacity: 1;
  visibility: visible;
  top: -34px;
}

.bar-chart-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 40px;
  text-align: center;
}

/* ==========================================================================
   SETTINGS & CLOUD SYNC
   ========================================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

.settings-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-form .form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.settings-form .form-group input {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.settings-form .form-group input:focus {
  border-color: var(--primary-color);
  background-color: white;
}

/* Theme picker dots */
.theme-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.theme-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-opt:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.theme-opt.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.theme-name {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Sync Panel Layout */
.sync-panel-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 20px;
}

.sync-setup-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sync-input-group {
  display: flex;
  gap: 10px;
}

.sync-input-group input {
  flex-grow: 1;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 0.9rem;
}

.sync-input-group input[readonly] {
  background-color: var(--border-color);
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sync-actions-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 20px;
}

.sync-connection-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-indicator-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.offline { background-color: var(--text-muted); }
.status-dot.online { background-color: var(--color-income); animation: glow-green 1.5s infinite alternate; }

@keyframes glow-green {
  to { box-shadow: 0 0 8px var(--color-income); }
}

.status-label {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 500;
}

.sync-connection-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sync-buttons-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Backup files styling */
.backup-restore-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backup-restore-panel h4 {
  font-family: var(--font-title);
  font-size: 1rem;
}

.backup-restore-panel p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.backup-buttons {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   BUTTONS & FORMS
   ========================================================================== */

.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-primary-sm, .btn-secondary-sm-label {
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
  background-color: var(--primary-color);
  color: white;
}

.btn-primary-sm:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary-sm-label {
  padding: 10px 18px;
  font-size: 0.85rem;
  border-radius: var(--border-radius-sm);
  background-color: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.btn-secondary-sm-label:hover {
  background-color: var(--primary-color);
  color: white;
}

.btn-text {
  background: none;
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

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

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 10px rgba(255, 117, 143, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(255, 117, 143, 0.35);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-success {
  background-color: var(--color-income-light);
  color: var(--color-income);
  border: 1px solid var(--color-income);
}

.btn-success:hover:not(:disabled) {
  background-color: var(--color-income);
  color: white;
  transform: translateY(-2px);
}

.btn-success:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   MODAL POPUPS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(61, 47, 49, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

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

.modal-container {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--box-shadow-lg);
  transform: translateY(30px);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-backdrop.open .modal-container {
  transform: translateY(0);
}

.modal-container.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--text-main);
}

.modal-close {
  background: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--primary-color);
}

/* Modal Form Styles */
#form-transaction, #form-goal, #form-deposit-goal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-group input,
.form-group select {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-color);
  background-color: white;
}

/* Radio button toggles for income/expense */
.form-group-row-toggle {
  display: flex;
  gap: 12px;
}

.toggle-btn-label {
  flex: 1;
  cursor: pointer;
}

.toggle-btn-label input {
  display: none;
}

.toggle-btn {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: var(--border-radius-md);
  border: 1.5px solid var(--border-color);
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 500;
  background-color: var(--bg-app);
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.toggle-btn-label input:checked + .toggle-btn.bg-income {
  border-color: var(--color-income);
  background-color: var(--color-income-light);
  color: var(--color-income);
}

.toggle-btn-label input:checked + .toggle-btn.bg-expense {
  border-color: var(--color-expense);
  background-color: var(--color-expense-light);
  color: var(--color-expense);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

/* Deposit goal card info */
.deposit-goal-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--primary-light);
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.deposit-icon {
  font-size: 2rem;
}

.deposit-meta h4 {
  font-family: var(--font-title);
  font-size: 1rem;
}

.deposit-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   APP FOOTER
   ========================================================================== */

.app-footer {
  text-align: center;
  padding: 20px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  margin-top: auto;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE ADAPTABILITY)
   ========================================================================== */

@media (max-width: 1200px) {
  .summary-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .reports-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-brand {
    margin-bottom: 20px;
    justify-content: center;
  }
  
  .sidebar-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  
  .menu-item {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  
  .sidebar-card {
    display: none; /* Hide decorative card on tablet/mobile sidebar */
  }
  
  .main-content {
    margin-left: 0;
    padding: 20px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .sync-panel-content {
    grid-template-columns: 1fr;
  }

  .goals-grid, .savings-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .summary-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .goals-grid, .savings-cards-grid {
    grid-template-columns: 1fr;
  }

  .calendar-days {
    grid-auto-rows: minmax(46px, auto);
    gap: 4px;
  }

  .day-number {
    font-size: 0.75rem;
  }

  .day-amt-tag {
    font-size: 0.55rem;
  }

  .chart-legend-list {
    grid-template-columns: 1fr;
  }

  .transfer-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group-arrow {
    transform: rotate(90deg);
    padding: 0;
  }
}

/* ==========================================================================
   SCHEDULE NOTES & NOTIFICATION DROPDOWN STYLES
   ========================================================================== */

.notification-badge {
  position: relative;
}

.notification-badge.open .noti-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.noti-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.noti-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  text-align: left;
}

.noti-item:hover {
  background-color: var(--primary-light);
}

.noti-item:last-child {
  border-bottom: none;
}

.noti-item-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 20px;
}

.noti-item-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.noti-item-delete {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.noti-item-delete:hover {
  color: var(--color-expense);
}

.noti-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Tabs for selected date details */
.selected-date-tab {
  border: none;
  background: none;
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  transition: var(--transition-smooth);
}

.selected-date-tab.active {
  color: var(--primary-color) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-color) !important;
}

/* Date notes list */
.note-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.note-item-row:hover {
  background-color: white;
  border-color: var(--accent-color);
}

.note-text-lbl {
  font-weight: 500;
  color: var(--text-main);
}

.btn-note-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition-smooth);
}

.btn-note-delete:hover {
  color: var(--color-expense);
}

/* Calendar day cell note indicator */
.day-note-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary-color);
}
.calendar-day-cell.today .day-note-indicator {
  background-color: white;
}

.day-note-emoji {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.95rem;
  line-height: 1;
  z-index: 2;
}

/* ==========================================================================
   GOOGLE CALENDAR STYLE POPOVER
   ========================================================================== */

.calendar-popover {
  position: absolute;
  width: 300px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  padding: 20px;
  z-index: 99999;
  animation: popoverFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.popover-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.popover-close-btn:hover {
  color: var(--primary-color);
}

.popover-date-header {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.popover-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.popover-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.popover-note-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background-color: var(--primary-light);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
}

.popover-form {
  display: flex;
  gap: 6px;
}

.popover-form input {
  flex-grow: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  background-color: var(--bg-app);
}

.popover-form input:focus {
  border-color: var(--primary-color);
  background-color: white;
}

.popover-footer-bal {
  display: none !important;
}


