/* ==========================================================================
   💍 甜蜜备婚全能助手 - Design System & Custom CSS
   Style: Elegant Champagne Gold & Soft Rose Pink Glassmorphism
   ========================================================================== */

:root {
  /* Color Palette */
  --primary-rose: #e84393;
  --rose-light: #fd79a8;
  --rose-soft: #fff0f5;
  --primary-gold: #d4af37;
  --gold-light: #f9e79f;
  --gold-dark: #b7950b;
  
  --color-success: #00b894;
  --color-warning: #fdcb6e;
  --color-danger: #d63031;
  --color-info: #0984e3;
  
  --bg-gradient: linear-gradient(135deg, #fff5f5 0%, #fff0f6 50%, #f7f1e3 100%);
  --card-bg: rgba(255, 255, 255, 0.82);
  --card-bg-hover: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.9);
  
  --text-main: #2d3436;
  --text-muted: #636e72;
  --text-light: #8b969a;
  
  --font-serif: 'Playfair Display', 'Cinzel', 'Noto Sans SC', serif;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --shadow-sm: 0 4px 12px rgba(232, 67, 147, 0.06);
  --shadow-md: 0 8px 24px rgba(232, 67, 147, 0.12);
  --shadow-lg: 0 16px 38px rgba(212, 175, 55, 0.18);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
}

/* Background Animations */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: floatBlob 18s infinite alternate ease-in-out;
}

.blob-1 {
  width: 450px;
  height: 450px;
  background: #ffb6c1;
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: #ffe4b5;
  bottom: -150px;
  right: -100px;
  animation-delay: -6s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: #f8c291;
  top: 40%;
  left: 30%;
  animation-delay: -12s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

#petalCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Layout Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Top Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 3px; /* 极简贴合间距 */
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.brand-icon i {
  color: var(--primary-rose) !important; /* 纯粉红色爱心 */
  font-size: 1.3rem; /* 与文字大小精准一致 */
  line-height: 1;
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-rose), #b7950b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-text .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

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

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1.5px solid rgba(39, 174, 96, 0.4);
  font-size: 0.85rem;
  box-shadow: 0 2px 10px rgba(39, 174, 96, 0.12);
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.user-profile-badge:hover {
  border-color: #27ae60;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.online-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #27ae60;
  box-shadow: 0 0 6px rgba(39, 174, 96, 0.8);
  animation: pulseGreen 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

.user-profile-badge button {
  background: rgba(235, 77, 75, 0.08);
  border: 1px solid rgba(235, 77, 75, 0.2);
  border-radius: 6px;
  color: #eb4d4b;
  cursor: pointer;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
  margin-left: 4px;
}

.user-profile-badge button:hover {
  background: #eb4d4b;
  color: white;
}

#userProfileName {
  display: inline-block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  flex: 1;
  min-width: 130px;
  padding: 12px 18px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--primary-rose);
  background: rgba(232, 67, 147, 0.05);
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--primary-rose), #fd79a8);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(232, 67, 147, 0.3);
}

.nav-tab {
  position: relative;
}

.nav-tab .badge {
  background: linear-gradient(135deg, var(--primary-rose), #ff7675);
  color: white;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(232, 67, 147, 0.4);
  line-height: 1;
}

.nav-tab.active .badge {
  background: white;
  color: var(--primary-rose);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Tab Content Transitions */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

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

/* Hero Card (Countdown Header) */
.hero-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 240, 245, 0.85));
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-rose), var(--primary-gold), var(--primary-rose));
}

.hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.couples-names {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 1px;
}

.wedding-location {
  font-size: 0.95rem;
  color: var(--primary-rose);
  font-weight: 500;
}

.wedding-quote {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

/* Countdown Clock */
.countdown-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.unit-box {
  background: linear-gradient(135deg, #ffffff, #fff5f8);
  border: 2px solid var(--primary-gold);
  border-radius: var(--radius-md);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary-rose);
  box-shadow: var(--shadow-md);
  letter-spacing: 0;
}

.unit-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.countdown-divider {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin-top: -24px;
}

.wedding-date-tag {
  display: inline-block;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-dark);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.btn-celebrate {
  background: linear-gradient(135deg, var(--primary-gold), #f39c12);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  transition: var(--transition);
}

.btn-celebrate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.metric-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
}

.metric-icon.gold { background: linear-gradient(135deg, #f6d365, #fda085); }
.metric-icon.rose { background: linear-gradient(135deg, #ff758c, #ff7eb3); }
.metric-icon.green { background: linear-gradient(135deg, #55efc4, #00b894); }
.metric-icon.purple { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }

.metric-info {
  flex: 1;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

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

/* Progress Bar Components */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-gold), #f39c12);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.progress-bar-fill.rose {
  background: linear-gradient(90deg, var(--primary-rose), #fd79a8);
}

.flex-grow { flex: 1; }

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.dashboard-grid.gap-lg { gap: 28px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.glass-card:hover {
  background: var(--card-bg-hover);
  box-shadow: var(--shadow-md);
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 12px;
}

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

.card-title h3 i {
  color: var(--primary-rose);
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary-rose);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-text:hover {
  text-decoration: underline;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.title-area h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.title-area p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  border: none;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-rose), #fd79a8);
  color: white;
  box-shadow: 0 4px 14px rgba(232, 67, 147, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(232, 67, 147, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--primary-gold), #f39c12);
  color: white;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4);
}

.btn-outline {
  background: white;
  color: var(--text-main);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--primary-rose);
  color: var(--primary-rose);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #ff7675);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(214, 48, 49, 0.3);
}

.btn-circle {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  background: white;
  color: var(--primary-rose);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.btn-circle:hover {
  transform: rotate(15deg) scale(1.05);
}

/* Filters Card */
.filters-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

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

.filter-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Pills */
.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: white;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.pill:hover {
  border-color: var(--primary-rose);
  color: var(--primary-rose);
}

.pill.active {
  background: var(--primary-rose);
  color: white;
  border-color: var(--primary-rose);
  font-weight: 500;
}

/* Form Controls */
.form-control {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: white;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-rose);
  box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.15);
}

/* Search Box Styling */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-box i {
  position: absolute;
  left: 14px;
  color: var(--primary-rose);
  font-size: 0.95rem;
  pointer-events: none;
  transition: var(--transition);
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(232, 67, 147, 0.2);
  background: rgba(255, 255, 255, 0.95);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}

.search-box input::placeholder {
  color: var(--text-light);
  font-size: 0.86rem;
}

.search-box input:focus {
  border-color: var(--primary-rose);
  background: white;
  box-shadow: 0 0 0 4px rgba(232, 67, 147, 0.15);
}

.search-box input:focus + i,
.search-box input:focus ~ i {
  color: var(--primary-rose);
  transform: scale(1.1);
}

/* Checklist Status Bar */
.checklist-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

/* Checklist Items Grid */
.checklist-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.chk-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.chk-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-rose);
}

.chk-card.completed {
  opacity: 0.75;
  background: rgba(250, 250, 250, 0.9);
}

.chk-card.completed .chk-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.chk-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding-right: 80px;
}

.chk-meta {
  position: absolute;
  top: 16px;
  right: 16px;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--primary-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
  transition: var(--transition);
}

.chk-card.completed .custom-checkbox {
  background: var(--primary-rose);
  color: white;
}

.chk-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-main);
  flex: 1;
  line-height: 1.35;
}

.chk-notes-col {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 4px 0;
}

/* Tags & Badges Protection */
.tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap !important;
  display: inline-block !important;
  line-height: 1.2;
}

.tag-stage { background: #e3f2fd; color: #1976d2; }
.tag-cat { background: #f3e5f5; color: #7b1fa2; white-space: nowrap !important; }
.tag-high { background: #ffebee; color: #c62828; font-weight: 700; }
.tag-cost { background: #e8f5e9; color: #2e7d32; }

.status-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap !important;
  display: inline-block !important;
  line-height: 1.2;
}

.chk-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chk-actions button {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.chk-actions button:hover { color: var(--primary-rose); }
.chk-actions button.del:hover { color: var(--color-danger); }

/* Budget Overview Grid */
.budget-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.budget-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

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

.b-icon.gold { background: linear-gradient(135deg, #f6d365, #fda085); }
.b-icon.rose { background: linear-gradient(135deg, #ff758c, #ff7eb3); }
.b-icon.green { background: linear-gradient(135deg, #55efc4, #00b894); }
.b-icon.blue { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.b-icon.purple { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }

.b-details { flex: 1; }
.b-title { font-size: 0.85rem; color: var(--text-muted); }
.b-amount { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.b-sub-amount { font-size: 0.82rem; margin-top: 2px; }

.text-green { color: var(--color-success); font-weight: 600; }
.text-rose { color: var(--primary-rose); font-weight: 600; }
.text-danger { color: var(--color-danger); font-weight: 700; }

/* Chart Containers */
.chart-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.chart-container.mini-chart {
  max-width: 170px;
  height: 170px;
  margin: 0 auto;
  position: relative;
}

.chart-container.gift-chart-box {
  max-width: 200px;
  height: 200px;
  margin: 0 auto;
  position: relative;
}

.custom-chart-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 14px auto 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.legend-item-2col {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
}

.legend-color-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.chart-container.large-chart { height: 320px; }

.category-stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.cat-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

/* Custom Table Style */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.custom-table th {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(232, 67, 147, 0.02);
}

.status-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge.paid { background: #e8f5e9; color: #2e7d32; }
.status-badge.deposit { background: #fff8e1; color: #f57f17; }
.status-badge.pending { background: #ffebee; color: #c62828; }

/* Data Management Cards */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.data-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: white;
}

/* Corner Export Button */
.btn-corner-export {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(246, 211, 101, 0.25));
  border: 1px solid var(--primary-gold);
  color: var(--gold-dark);
}

.btn-corner-export:hover {
  background: linear-gradient(135deg, var(--primary-gold), #f39c12);
  color: white;
}

/* Export Modal Cards Grid */
.export-options-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.export-option-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.export-option-card.gold { border-left: 4px solid var(--primary-gold); }
.export-option-card.green { border-left: 4px solid var(--color-success); }
.export-option-card.blue { border-left: 4px solid var(--color-info); }

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

.export-option-card.gold .opt-icon { background: linear-gradient(135deg, #f6d365, #fda085); }
.export-option-card.green .opt-icon { background: linear-gradient(135deg, #55efc4, #00b894); }
.export-option-card.blue .opt-icon { background: linear-gradient(135deg, #74b9ff, #0984e3); }

.opt-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.opt-info p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-group-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Print Header Default Hidden in Web View */
.print-doc-header {
  display: none;
}

/* ==========================================================================
   🖨️ PDF & Print Styles (@media print)
   ========================================================================== */
@media print {
  /* Print-only clean document header */
  .print-doc-header {
    display: block !important;
    margin-bottom: 16px !important;
  }
  .print-doc-header h2 {
    font-size: 16pt !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin-bottom: 4px !important;
  }
  .print-doc-header p {
    font-size: 9.5pt !important;
    color: #333333 !important;
    margin-bottom: 8px !important;
  }
  .print-doc-header hr {
    border: 0 !important;
    border-bottom: 2px solid #222222 !important;
    margin: 0 0 12px 0 !important;
  }

  /* Hide non-printable elements & web app decorations */
  .bg-decorations,
  .app-header,
  .nav-tabs,
  .header-buttons,
  .btn,
  .btn-celebrate,
  .filters-card,
  .modal-overlay,
  .app-footer,
  .chk-actions,
  .search-box,
  .section-header,
  .hero-card,
  .budget-summary-grid,
  .gift-summary-grid,
  .chart-container,
  .custom-chart-legend,
  .custom-checkbox,
  .card-title {
    display: none !important;
  }

  .status-badge {
    display: inline-block !important;
    padding: 0 !important;
    background: transparent !important;
    color: #000000 !important;
    font-weight: 700 !important;
    border: none !important;
    font-size: 9.5pt !important;
  }

  .dashboard-grid {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
  }

  .app-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  /* Show targeted tab or seamlessly print all */
  .tab-content {
    display: block !important;
    opacity: 1 !important;
  }

  body[data-print-target="tab-checklist"] .tab-content:not(#tab-checklist) {
    display: none !important;
  }
  body[data-print-target="tab-budget"] .tab-content:not(#tab-budget) {
    display: none !important;
  }
  body[data-print-target="tab-gifts"] .tab-content:not(#tab-gifts) {
    display: none !important;
  }

  /* Strip card styling */
  .glass-card,
  .hero-card,
  .metric-card,
  .budget-card,
  .table-container {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}

/* Web view chk-index hide */
.chk-index {
  display: none;
}
.print-chk-table-header {
  display: none;
}

/* Line-by-line Checklist print layout (5-Column Grid, 1 item per row, strictly aligned) */
@media print {
  .print-chk-table-header {
    display: grid !important;
    grid-template-columns: 35px 220px 100px 1fr 65px !important;
    gap: 8px !important;
    padding: 8px 0 !important;
    border-bottom: 2px solid #222222 !important;
    border-top: 1px solid #dddddd !important;
    font-weight: 700 !important;
    font-size: 9.5pt !important;
    color: #000000 !important;
    align-items: center !important;
    background: #f4f4f4 !important;
    padding-left: 4px !important;
  }

  .checklist-items-grid {
    display: block !important;
    width: 100% !important;
  }

  .chk-card {
    display: grid !important;
    grid-template-columns: 35px 220px 100px 1fr 65px !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
    padding: 8px 0 8px 4px !important;
    border: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    page-break-inside: avoid;
    position: static !important;
  }

  .chk-index {
    display: inline-block !important;
    font-size: 9.5pt !important;
    font-weight: 600 !important;
    color: #333333 !important;
    white-space: nowrap !important;
  }

  .chk-header {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding-right: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .chk-title {
    font-size: 10pt !important;
    color: #000000 !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }

  .chk-meta {
    position: static !important;
    display: block !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  .chk-meta .tag {
    border: 1px solid #888888 !important;
    color: #222222 !important;
    background: transparent !important;
    padding: 1px 6px !important;
    font-size: 8.5pt !important;
    white-space: nowrap !important;
    border-radius: 4px !important;
  }

  .chk-notes-col {
    display: block !important;
    font-size: 8.5pt !important;
    color: #555555 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .chk-footer {
    display: block !important;
    font-size: 9.5pt !important;
    font-weight: 600 !important;
    color: #222222 !important;
    white-space: nowrap !important;
  }

  /* Override Mobile Responsive Cards back to Clean Standard HTML Table in Print Mode */
  .table-responsive {
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  table.custom-table,
  #giftsTable,
  #expensesTable {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 8px !important;
    font-size: 9.5pt !important;
  }

  table.custom-table thead,
  #giftsTable thead,
  #expensesTable thead {
    display: table-header-group !important;
    background: #f4f4f4 !important;
  }

  table.custom-table tbody,
  #giftsTable tbody,
  #expensesTable tbody {
    display: table-row-group !important;
  }

  table.custom-table tr,
  table.custom-table tr.table-row-card,
  #giftsTable tr.table-row-card,
  #expensesTable tr.table-row-card {
    display: table-row !important;
    border: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    page-break-inside: avoid;
  }

  table.custom-table th,
  #giftsTable th,
  #expensesTable th {
    display: table-cell !important;
    background: #f4f4f4 !important;
    color: #000000 !important;
    border-bottom: 2px solid #222222 !important;
    border-top: 1px solid #dddddd !important;
    padding: 7px 8px !important;
    font-size: 9.5pt !important;
    font-weight: 700 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  table.custom-table td,
  #giftsTable td,
  #expensesTable td {
    display: table-cell !important;
    padding: 8px 8px !important;
    border: none !important;
    border-bottom: 1px solid #e8e8e8 !important;
    font-size: 9.5pt !important;
    color: #000000 !important;
    background: transparent !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
  }

  table.custom-table th.td-actions,
  table.custom-table th.no-print,
  table.custom-table td.td-actions,
  #giftsTable th.td-actions,
  #giftsTable th.no-print,
  #giftsTable td.td-actions,
  #expensesTable th.no-print,
  #expensesTable td.td-actions,
  .mobile-label,
  .no-print,
  .td-actions,
  .chk-actions {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

.text-center { text-align: center; }
.margin-top-md { margin-top: 16px; }
.margin-top-lg { margin-top: 28px; }

/* Modals System (Fixed Invisible Overlay Bug) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none !important;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
  visibility: visible !important;
  z-index: 999999 !important;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #fff5f8, #fff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--primary-rose);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-row {
  display: flex;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Reusable Custom Confirmation Modal Styling */
.confirm-modal-card {
  max-width: 420px !important;
  text-align: center;
  padding: 30px 24px !important;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18) !important;
}

.confirm-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px auto;
  transition: var(--transition);
}

.confirm-icon-wrapper.danger {
  background: #fff0f0;
  color: #e74c3c;
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.22);
}

.confirm-icon-wrapper.warning {
  background: #fffdf0;
  color: #f39c12;
  box-shadow: 0 6px 18px rgba(243, 156, 18, 0.22);
}

.confirm-title {
  font-size: 1.25rem;
  font-family: var(--font-serif);
  color: var(--text-main);
  margin-bottom: 10px;
  font-weight: 700;
}

.confirm-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.confirm-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-modal-footer .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.9rem;
  justify-content: center;
  border-radius: var(--radius-md);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #ff7675) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.35) !important;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c0392b, #e74c3c) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.45) !important;
}

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

.toast {
  background: var(--text-main);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

.toast.success { background: #00b894; }
.toast.info { background: var(--primary-rose); }
.toast.warning { background: #fdcb6e; color: #2d3436; }

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

/* Footer */
.app-footer {
  text-align: center;
  padding-top: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mobile-label {
  display: none;
}

/* Mobile Responsive Media Queries */
@media screen and (max-width: 768px) {
  .mobile-label {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: normal;
    margin-right: 4px;
  }

  .desktop-only {
    display: none !important;
  }

  /* Force Full Viewport Width Container */
  .app-container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 12px 12px 40px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Force 100% Single Column Layouts on Mobile */
  .dashboard-grid,
  .metrics-grid,
  .data-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 14px !important;
  }

  .hero-card,
  .glass-card,
  .metric-card {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Budget Summary 2 Columns Grid */
  .budget-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .budget-card {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px !important;
  }

  /* Transform Tables into Beautiful Mobile Cards (Full 100% Width Fit) */
  .table-responsive {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .custom-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .custom-table thead {
    display: none !important;
  }

  .custom-table tbody {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .custom-table tr.table-row-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    gap: 6px;
    position: relative !important;
  }

  /* Unified Card Action Buttons on Mobile (Horizontal Row at Card Bottom) */
  .table-row-card .td-actions {
    position: static !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(0, 0, 0, 0.08) !important;
    width: 100% !important;
  }

  .table-row-card .chk-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
  }

  .table-row-card .chk-actions button {
    width: 34px !important;
    height: 34px !important;
    border-radius: var(--radius-full) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    background: rgba(245, 246, 250, 0.9) !important;
    color: var(--text-main) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    cursor: pointer;
    transition: var(--transition);
  }

  .table-row-card .chk-actions button.del {
    color: var(--color-danger) !important;
    background: #fff0f0 !important;
    border-color: rgba(255, 118, 117, 0.2) !important;
  }

  .custom-table tr.table-row-card td {
    padding: 2px 0;
    border: none;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
  }

  .custom-table tr.table-row-card td.td-cat {
    margin-bottom: 2px;
  }

  .custom-table tr.table-row-card td.td-title {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 6px;
  }

  .custom-table tr.table-row-card td.td-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    padding-top: 8px;
    margin-top: 6px;
  }

  /* Compact Side-by-Side Mobile Layout for Gifts Cards */
  #giftsTable tr.table-row-card {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 6px 12px !important;
    padding: 14px 16px !important;
  }

  #giftsTable tr.table-row-card td.td-title {
    grid-column: 1 !important;
    grid-row: 1 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin: 0 !important;
    align-self: center !important;
  }

  #giftsTable tr.table-row-card td.td-cat {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
  }

  #giftsTable tr.table-row-card td.td-rel {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    margin: 0 !important;
  }

  #giftsTable tr.table-row-card td.td-amount {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
  }

  #giftsTable tr.table-row-card td.td-date {
    grid-column: 1 !important;
    grid-row: 3 !important;
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    margin: 0 !important;
  }

  #giftsTable tr.table-row-card td.td-notes {
    grid-column: 2 !important;
    grid-row: 3 !important;
    justify-self: end !important;
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    max-width: 170px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
  }

  #giftsTable tr.table-row-card td.td-notes:empty {
    display: none !important;
  }

  #giftsTable tr.table-row-card td.td-actions {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    margin-top: 4px !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(0, 0, 0, 0.08) !important;
    width: 100% !important;
    justify-content: flex-end !important;
  }

  /* Compact Side-by-Side Mobile Layout for Expenses Cards */
  #expensesTable tr.table-row-card {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 6px 12px !important;
    padding: 14px 16px !important;
  }

  #expensesTable tr.table-row-card td.td-title {
    grid-column: 1 !important;
    grid-row: 1 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin: 0 !important;
    align-self: center !important;
  }

  #expensesTable tr.table-row-card td.td-cat {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
  }

  #expensesTable tr.table-row-card td.td-status {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: center !important;
    margin: 0 !important;
  }

  #expensesTable tr.table-row-card td.td-amount {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
  }

  #expensesTable tr.table-row-card td.td-deposit {
    grid-column: 1 !important;
    grid-row: 3 !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
  }

  #expensesTable tr.table-row-card td.td-pending {
    grid-column: 2 !important;
    grid-row: 3 !important;
    justify-self: end !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
  }

  #expensesTable tr.table-row-card td.td-index {
    display: none !important;
  }

  #expensesTable tr.table-row-card td.td-actions {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    margin-top: 4px !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(0, 0, 0, 0.08) !important;
    width: 100% !important;
    justify-content: flex-end !important;
  }
}

/* Mobile Responsive - Part 2: Layout Adjustments */
@media screen and (max-width: 768px) {
  .app-container {
    padding: 12px 12px 40px;
  }
  
  /* Top Header compact single line layout */
  .app-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 8px;
  }
  
  .brand {
    gap: 3px !important;
  }
  
  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
  }
  
  .hide-text-mobile {
    display: none !important;
  }
  
  .btn-icon-mobile {
    padding: 8px 10px !important;
  }
  
  #userProfileName {
    max-width: 80px;
  }
  
  .brand-icon i {
    font-size: 1.15rem !important;
  }
  
  .brand-text h1 {
    font-size: 1.15rem !important;
    line-height: 1.1;
  }
  
  .brand-text .subtitle {
    font-size: 0.72rem;
    display: none; /* Hide subtitle on tiny mobile screens */
  }
  
  .header-actions {
    gap: 6px;
  }

  .header-actions .btn {
    padding: 7px 10px;
    font-size: 0.8rem;
  }
  
  .btn-circle {
    width: 36px;
    height: 36px;
  }

  /* 💍 FULL MOBILE NAVIGATION (5 Tabs perfectly auto-fitted, 0 overflow) */
  .nav-tabs {
    display: flex;
    width: 100%;
    gap: 2px;
    padding: 4px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.85);
    overflow: hidden;
  }

  .nav-tab {
    flex: 1 1 0%; /* Equal 20% width for all 5 tabs */
    min-width: 0; /* Prevent flex overflow */
    padding: 8px 2px;
    flex-direction: column;
    gap: 3px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: center;
    position: relative;
  }

  .nav-tab i {
    font-size: 1.1rem;
    margin: 0;
  }

  .nav-tab .tab-text {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
  }

  .nav-tab .badge {
    position: absolute;
    top: 2px;
    left: calc(50% + 9px);
    font-size: 0.65rem;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border: 1px solid #ffffff;
    box-shadow: 0 2px 5px rgba(232, 67, 147, 0.3);
  }

  /* Hero Card Compact Adjustment */
  .hero-card {
    padding: 22px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
  }

  .couples-names {
    font-size: 1.6rem;
  }

  .wedding-location {
    font-size: 0.82rem;
  }

  .wedding-quote {
    font-size: 0.9rem;
    margin-bottom: 18px;
  }

  /* Countdown Units on Mobile */
  .countdown-container {
    gap: 6px;
    margin-bottom: 18px;
  }

  .countdown-unit {
    flex: 1;
    max-width: 65px;
  }

  .unit-box {
    width: 100%;
    height: 54px;
    font-size: 1.5rem;
    border-width: 1.5px;
    border-radius: var(--radius-sm);
  }

  .unit-label {
    font-size: 0.75rem;
    margin-top: 4px;
  }

  .countdown-divider {
    font-size: 1.3rem;
    margin-top: -18px;
  }

  .wedding-date-tag {
    padding: 6px 14px;
    font-size: 0.82rem;
    margin-bottom: 14px;
    word-break: break-all;
  }

  .btn-celebrate {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  /* Metrics Grid */
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .metric-card {
    padding: 14px;
    gap: 12px;
  }

  .metric-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .metric-value {
    font-size: 1.25rem;
  }

  /* Dashboard Grid */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .glass-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .title-area h2 {
    font-size: 1.3rem;
  }

  .title-area p {
    font-size: 0.82rem;
  }

  .header-buttons {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  .header-buttons .btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 120px !important;
    padding: 8px 10px !important;
    font-size: 0.82rem !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .header-buttons .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.82rem;
    justify-content: center;
  }

  /* Filters Row */
  .filters-card {
    padding: 12px;
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .pill-group {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .pill-group::-webkit-scrollbar { display: none; }

  .pill {
    padding: 5px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .form-control {
    width: 100%;
  }

  /* Budget Summary Grid */
  .budget-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }

  .budget-card {
    padding: 12px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  .b-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .b-amount {
    font-size: 1.15rem;
  }

  .b-title {
    font-size: 0.78rem;
  }

  .b-sub-amount {
    font-size: 0.72rem;
  }

  /* Table Horizontal Scrolling */
  .table-responsive {
    margin: 0 -16px;
    padding: 0 16px;
    width: calc(100% + 32px);
  }

  .custom-table {
    min-width: 580px; /* Ensure table remains readable via smooth scroll */
  }

  .custom-table th, .custom-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  /* Modal Cards */
  .modal-card {
    max-width: 95%;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-body {
    padding: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 10px;
  }

  .chart-container.large-chart {
    height: 250px;
  }
}


@media screen and (max-width: 768px) { .user-profile-badge { padding: 4px 8px !important; gap: 4px !important; } }
