/* ==========================================================================
   Veckopengen – Kid's Allowance & Budget App Stylesheet
   Mobile-First, Tactile, Joyful & Accessible Design
   ========================================================================== */

:root {
  --primary: #FF5A78;
  --primary-hover: #E84564;
  --primary-light: #FFEBF0;
  
  --secondary: #2EC4B6;
  --secondary-hover: #25A296;
  --secondary-light: #E2FAF8;

  --accent-gold: #FFB703;
  --accent-gold-light: #FFF8E6;
  --accent-gold-dark: #D49000;

  --warning-red: #E63946;
  --warning-light: #FDE8EA;

  --purple: #8338EC;
  --purple-light: #F1E8FD;

  --bg-page: #FFF9F5;
  --card-bg: #FFFFFF;
  --text-main: #2B2D42;
  --text-muted: #6C757D;
  --border-color: #F0E6DF;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  --shadow-soft: 0 8px 24px rgba(43, 45, 66, 0.06);
  --shadow-hover: 0 12px 32px rgba(43, 45, 66, 0.12);
  --shadow-pop: 0 14px 28px rgba(255, 90, 120, 0.28);

  --font-heading: 'Fredoka', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

body {
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden !important;
  touch-action: none !important;
  -webkit-overflow-scrolling: auto !important;
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* App Container (Mobile viewport framing) */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom) 16px;
  position: relative;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px 10px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  font-size: 2.2rem;
  background: white;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  border: 2px solid var(--border-color);
  animation: floatAvatar 3s ease-in-out infinite;
}

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

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

.user-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

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

.icon-btn {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.icon-btn:hover, .icon-btn:active {
  transform: scale(0.94);
  background: #FFF0F3;
}

.parent-btn {
  background: var(--purple-light);
  color: var(--purple);
  border-color: rgba(131, 56, 236, 0.25);
}

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 40px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

/* Balance Hero Card */
.balance-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFF5F7 100%);
  border: 2px solid #FFE0E7;
  text-align: center;
  position: relative;
  padding-top: 26px;
}

.balance-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.balance-amount {
  font-family: var(--font-heading);
  font-size: 3.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  text-shadow: 0 4px 12px rgba(255, 90, 120, 0.15);
}

.balance-currency {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.balance-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 18px;
}

/* Savings Goal in Balance Card */
.goal-container {
  background: white;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid #F5EAE5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

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

.goal-icon {
  font-size: 1.15rem;
}

.goal-ratio {
  font-weight: 800;
  color: var(--secondary);
}

.progress-bar-track {
  width: 100%;
  height: 16px;
  background: #EBF8F7;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  display: flex;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2EC4B6 0%, #48E5D6 100%);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  flex-shrink: 0;
}

.progress-fill-current {
  background: linear-gradient(90deg, #2EC4B6 0%, #48E5D6 100%);
  z-index: 1;
}

.progress-fill-allowance {
  background: repeating-linear-gradient(
    -45deg,
    #FFB703,
    #FFB703 5px,
    #FFC933 5px,
    #FFC933 10px
  );
  border-left: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
  z-index: 1;
}

.progress-fill-bonus {
  background: repeating-linear-gradient(
    -45deg,
    #8338EC,
    #8338EC 5px,
    #9D4EDD 5px,
    #9D4EDD 10px
  );
  border-left: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
  z-index: 1;
}

.progress-sparkle {
  position: absolute;
  top: 0px;
  line-height: 16px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 2;
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.goal-projection-legend {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 3px 0 1px 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.goal-projection-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  white-space: nowrap;
}

.goal-projection-legend .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.goal-projection-legend .dot-saved {
  background: #2EC4B6;
  box-shadow: 0 0 0 1.5px rgba(46, 196, 182, 0.25);
}

.goal-projection-legend .dot-allowance {
  background: #FFB703;
  box-shadow: 0 0 0 1.5px rgba(255, 183, 3, 0.25);
}

.goal-projection-legend .dot-bonus {
  background: #8338EC;
  box-shadow: 0 0 0 1.5px rgba(131, 56, 236, 0.25);
}

.goal-projection-legend .legend-item b {
  color: var(--text-main);
  font-weight: 800;
}

.goal-projection-legend .legend-item.legend-bonus b {
  color: var(--purple);
}

.goal-projection-legend .legend-item.bonus-lost-legend {
  opacity: 0.5;
}

.goal-projection-legend .legend-item.bonus-lost-legend b {
  text-decoration: line-through;
  color: var(--text-muted);
}

.goal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--secondary-hover);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 4px;
}

/* Bonus Card - Warm Gold / Yellow with Purple Bonus Accents */
.bonus-card {
  border: 2px solid var(--accent-gold);
  background: linear-gradient(135deg, #FFFDF8 0%, #FFF8E6 100%);
  box-shadow: 0 8px 24px rgba(255, 183, 3, 0.16);
  transition: all 0.3s ease;
}

.bonus-card.bonus-lost {
  border-color: #E2E8F0;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  box-shadow: var(--shadow-soft);
}

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

.bonus-icon {
  font-size: 2.2rem;
  background: white;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(255, 183, 3, 0.25);
  border: 2px solid #FDE68A;
  flex-shrink: 0;
}

.bonus-card.bonus-lost .bonus-icon {
  box-shadow: none;
  background: #E2E8F0;
  border-color: transparent;
}

.bonus-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-gold-dark);
}

.bonus-card.bonus-lost .bonus-heading {
  color: var(--text-muted);
}

.bonus-subheading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #6D28D9;
  background: #FAF5FF;
  border: 1.5px solid rgba(131, 56, 236, 0.3);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(131, 56, 236, 0.1);
  width: fit-content;
  margin-top: 2px;
}

.bonus-card.bonus-lost .bonus-subheading {
  background: #F1F5F9;
  color: #94A3B8;
  border-color: #CBD5E1;
  box-shadow: none;
}

.bonus-desc {
  font-size: 0.88rem;
  color: #78350F;
  line-height: 1.45;
  margin-bottom: 14px;
  font-weight: 600;
}

.bonus-card.bonus-lost .bonus-desc {
  color: #64748B;
}

.bonus-highlight {
  color: var(--purple);
  font-weight: 800;
}

/* Saturday Bonus Pot Meter (Simplified for 9yo) */
.bonus-pot-wrap {
  background: white;
  border: 1.5px solid rgba(255, 183, 3, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(255, 183, 3, 0.08);
}

.bonus-card.bonus-lost .bonus-pot-wrap {
  border-color: #E2E8F0;
  box-shadow: none;
}

.pot-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.84rem;
}

.pot-title {
  color: #78350F;
  font-weight: 700;
}

.bonus-card.bonus-lost .pot-title {
  color: #64748B;
}

.pot-title strong {
  font-weight: 800;
  color: #B45309;
}

.pot-unspent-pill {
  font-size: 0.8rem;
  font-weight: 800;
  color: #6D28D9;
  background: #FAF5FF;
  border: 1.5px solid rgba(131, 56, 236, 0.25);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.bonus-card.bonus-lost .pot-unspent-pill {
  color: #64748B;
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.bonus-pot-bar {
  height: 28px;
  background: #F8FAFC;
  border: 1.5px solid #FDE68A;
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
  position: relative;
}

.bonus-card.bonus-lost .bonus-pot-bar {
  border-color: #CBD5E1;
}

.pot-fill {
  height: 100%;
  background: linear-gradient(90deg, #8338EC 0%, #A855F7 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.4s ease;
  overflow: hidden;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.pot-spent {
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #FEE2E2,
    #FEE2E2 7px,
    #FECACA 7px,
    #FECACA 14px
  );
  color: #991B1B;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.4s ease;
  overflow: hidden;
  min-width: 0;
  border-right: 1.5px dashed #F87171;
}

.bonus-card.bonus-lost .pot-spent {
  background: repeating-linear-gradient(
    -45deg,
    #F1F5F9,
    #F1F5F9 7px,
    #CBD5E1 7px,
    #CBD5E1 14px
  );
  color: #475569;
  border-right: none;
}

.pot-fill-text {
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  padding: 0 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pot-spent-text {
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  padding: 0 8px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.bonus-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.countdown-badge {
  color: #92400E;
  white-space: nowrap;
}

.bonus-card.bonus-lost .countdown-badge {
  color: #64748B;
}

.next-allowance-calc {
  background: transparent;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: #92400E;
  border: 1.5px solid #FBBF24;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.bonus-card.bonus-lost .next-allowance-calc {
  background: transparent;
  color: #64748B;
  border-color: #CBD5E1;
  box-shadow: none;
}

/* Main Action Bar: BUY */
.action-cta-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.btn-buy {
  width: 100%;
  background: linear-gradient(135deg, #FF5A78 0%, #FF85A1 100%);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 18px 24px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.5px;
}

.btn-buy:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 36px rgba(255, 90, 120, 0.4);
}

.btn-buy:active {
  transform: translateY(1px) scale(0.98);
}

.btn-buy-icon {
  font-size: 1.6rem;
  animation: bounceBag 2s ease infinite;
}

@keyframes bounceBag {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(-6deg); }
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  background: #EFE6DF;
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-btn.active {
  background: white;
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/* Tab Views */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Calendar Card */
.calendar-card {
  padding: 16px 12px;
}

/* Goal Target Forecast Banner */
.calendar-goal-banner {
  background: linear-gradient(135deg, #FFFDF8 0%, #FBF5FF 100%);
  border: 1.5px solid #EADBFF;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-main);
  flex-wrap: wrap;
  gap: 4px;
}

.goal-banner-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}

.goal-banner-balance {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.goal-banner-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 330px) {
  .goal-banner-pills {
    grid-template-columns: 1fr;
  }
}

.cal-forecast-btn {
  background: white;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.cal-forecast-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

.cal-forecast-btn.btn-bonus-forecast {
  border-color: #D8B4FE;
  background: #FAF5FF;
}

.cal-forecast-btn.btn-bonus-forecast:hover {
  border-color: #8338EC;
  background: #F3E8FF;
}

.cal-forecast-btn.btn-bonus-forecast .forecast-date {
  color: #6D28D9;
}

.cal-forecast-btn.btn-nobonus-forecast {
  border-color: #99F6E4;
  background: #F0FDFA;
}

.cal-forecast-btn.btn-nobonus-forecast:hover {
  border-color: #2EC4B6;
  background: #CCFBF1;
}

.cal-forecast-btn.btn-nobonus-forecast .forecast-date {
  color: #0E7490;
}

.forecast-btn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.forecast-btn-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.forecast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-bonus {
  background: #8338EC;
}

.dot-nobonus {
  background: #2EC4B6;
}

.forecast-date {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.forecast-chip {
  font-size: 0.82rem;
  flex-shrink: 0;
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.cal-nav-btn {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-nav-btn:hover, .cal-nav-btn:active {
  background: var(--primary-light);
  color: var(--primary);
}

.calendar-month-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.calendar-weekdays .sat-col {
  color: var(--accent-gold-dark);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  min-height: 52px;
  background: white;
  border: 1px solid #F1E9E4;
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.cal-day:hover {
  background: #FFF5F7;
  border-color: var(--primary);
}

.cal-day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.cal-day.is-today {
  border: 2px solid var(--primary);
  background: #FFF8F9;
}

.cal-day.is-selected {
  background: #FFE8EE;
  border-color: var(--primary);
  transform: scale(1.04);
  box-shadow: 0 4px 10px rgba(255, 90, 120, 0.2);
  z-index: 2;
}

.cal-day.is-saturday {
  background: #FFFDF8;
}

.cal-day-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
}

.cal-day.is-saturday .cal-day-num {
  color: var(--accent-gold-dark);
}

.cal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.cal-dot {
  font-size: 0.65rem;
  line-height: 1;
}

/* Calendar Goal Target Day Highlights */
.cal-day.goal-target-with-bonus {
  background: linear-gradient(135deg, #FFFDF8 0%, #F5EDFF 100%);
  border: 2px solid #8338EC;
  box-shadow: 0 0 0 1px rgba(131, 56, 236, 0.2);
}

.cal-day.goal-target-no-bonus {
  background: linear-gradient(135deg, #FFFDF8 0%, #E6F8F6 100%);
  border: 2px solid #2EC4B6;
  box-shadow: 0 0 0 1px rgba(46, 196, 182, 0.2);
}

.cal-day.goal-target-both {
  background: linear-gradient(135deg, #FFF7ED 0%, #FCE7F3 100%);
  border: 2px solid #EC4899;
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.25);
}

.cal-goal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 4px;
  font-weight: 800;
  white-space: nowrap;
  animation: pulseGoal 2.5s infinite ease-in-out;
  cursor: pointer;
}

.cal-goal-chip.chip-bonus {
  background: rgba(131, 56, 236, 0.12);
  border: 1px solid rgba(131, 56, 236, 0.35);
  color: #8338EC;
}

.cal-goal-chip.chip-nobonus {
  background: rgba(46, 196, 182, 0.15);
  border: 1px solid rgba(46, 196, 182, 0.4);
  color: #0E7490;
}

.cal-goal-chip.chip-both {
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.35);
  color: #BE185D;
}

.cal-goal-chip.mini {
  animation: none;
  font-size: 0.65rem;
  padding: 0 2px;
}

@keyframes pulseGoal {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

/* Calendar Mini Legend */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #EDE5DF;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Milestone Banner in Day Details Drawer */
.day-milestone-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.day-milestone-banner.milestone-bonus {
  background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
  border: 1.5px solid #D8B4FE;
}

.day-milestone-banner.milestone-nobonus {
  background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 100%);
  border: 1.5px solid #99F6E4;
}

.day-milestone-banner.milestone-both {
  background: linear-gradient(135deg, #FDF2F8 0%, #FCE7F3 100%);
  border: 1.5px solid #FBCFE8;
}

.milestone-badge-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.milestone-text h4 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 3px 0;
}

.milestone-text p {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.milestone-text strong {
  color: var(--text-main);
}

/* Day Details Drawer Card */
.day-details-card {
  margin-top: 12px;
  border: 2px solid #F0E6DF;
}

.day-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
}

.day-details-header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
}

.day-details-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.day-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FAFAFC;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid #ECECEC;
  transition: all 0.2s;
}

.tx-item:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

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

.tx-icon-bubble {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: white;
  border: 1px solid #EAEAEA;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  flex-shrink: 0;
}

.tx-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.tx-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
  word-break: break-word;
}

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

.tx-amount {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.tx-amount.positive {
  color: #10B981;
}

.tx-amount.negative {
  color: #EF4444;
}

.tx-amount.bonus-amount {
  color: var(--purple) !important;
}

.tx-item.tx-type-bonus {
  background: #FAF8FF;
  border-color: #EDE4FC;
}

.tx-icon-bubble.tx-icon-bonus {
  background: var(--purple-light);
  border-color: #DDD0F8;
}

.parent-tx-item.tx-type-bonus {
  background: #FAF8FF;
  border-color: #EDE4FC;
}

.text-bonus {
  color: var(--purple) !important;
  font-weight: 800;
}

.empty-state {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 16px 0;
}

/* History Filter Pills */
.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: #F1E9E4;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-pill.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(255, 90, 120, 0.25);
}

.filter-pill[data-filter="bonus"].active {
  background: var(--purple);
  box-shadow: 0 4px 10px rgba(131, 56, 236, 0.3);
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Categories Progress Bars */
.card-subtitle {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

.cat-bar-track {
  width: 100%;
  height: 10px;
  background: #F1E9E4;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(30, 32, 48, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  animation: fadeIn 0.2s ease;
  overscroll-behavior: contain;
  touch-action: none;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: 28px 28px 0 0;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.22);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px 20px 28px;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

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

.modal-emoji {
  font-size: 1.8rem;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
}

.modal-close {
  background: #F1E9E4;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

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

.form-row .form-group {
  flex: 1;
}

input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  background: white;
  transition: border-color 0.2s;
  outline: none;
}

input:focus {
  border-color: var(--primary);
}

.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-input-wrap input {
  padding-right: 48px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-heading);
}

.amount-suffix {
  position: absolute;
  right: 16px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Quick Amount Chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.amount-chip {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.amount-chip:hover, .amount-chip:active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Category Picker Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cat-btn {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-btn .cat-icon {
  font-size: 1.6rem;
}

.cat-btn .cat-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.cat-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.04);
}

.cat-btn.active .cat-label {
  color: var(--primary);
}

/* Modal Footers & Buttons */
.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-primary {
  flex: 2;
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 90, 120, 0.35);
}

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

.btn-secondary {
  flex: 1;
  background: #F1E9E4;
  color: var(--text-main);
}

.btn-block {
  width: 100%;
}

/* WARNING MODAL SPECIFIC STYLES */
.warning-card {
  border-top: 6px solid #FFB703;
  text-align: center;
}

.warning-hero {
  margin-bottom: 16px;
}

.warning-pig-icon {
  font-size: 3.5rem;
  display: block;
  animation: shakeWarning 0.6s ease-in-out;
}

@keyframes shakeWarning {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.warning-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  color: #D49000;
  margin-top: 4px;
}

.warning-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.warning-callout {
  background: #FAF5FF;
  border: 2px dashed #C084FC;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.warning-callout p {
  font-size: 0.95rem;
  font-weight: 700;
  color: #581C87;
  line-height: 1.4;
}

.warning-callout strong {
  color: var(--purple);
}

.warning-explanation {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.bonus-comparison {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.comp-box {
  flex: 1;
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.comp-keep {
  background: #ECFDF5;
  border: 1px solid #10B981;
}

.comp-lose {
  background: #FEF2F2;
  border: 1px solid #EF4444;
}

.comp-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.comp-val {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
}

.comp-keep .comp-val {
  color: #10B981;
}

.comp-lose .comp-val {
  color: #EF4444;
}

.comp-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.warning-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-success-big {
  width: 100%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 16px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-success-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.45);
}

.btn-success-big .btn-emoji {
  font-size: 1.8rem;
}

.btn-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.btn-text-wrap strong {
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.btn-text-wrap small {
  font-size: 0.78rem;
  opacity: 0.9;
}

.btn-danger-link {
  background: none;
  border: none;
  color: #DC2626;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  padding: 6px;
}

/* ======================== PIN MODAL STYLES (POLISHED) ======================== */
.pin-card {
  text-align: center;
  padding: 24px 20px 24px;
  max-width: 380px;
  margin: auto;
  border-radius: 28px;
}

.pin-shield-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: var(--purple-light);
  color: var(--purple);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 4px 14px rgba(131, 56, 236, 0.18);
}

.pin-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}

.pin-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 270px;
  margin: 4px auto 14px;
  line-height: 1.35;
}

.pin-dots-container {
  display: flex;
  justify-content: center;
  margin: 8px 0 20px;
}

.pin-dots {
  display: flex;
  gap: 16px;
  align-items: center;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 2px solid #D1D5DB;
  background: #F9FAFB;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-dot.filled {
  background: var(--purple);
  border-color: var(--purple);
  transform: scale(1.18);
  box-shadow: 0 0 12px rgba(131, 56, 236, 0.4);
}

.pin-dots.error {
  animation: pinShake 0.4s ease;
}

.pin-dots.error .pin-dot {
  background: #EF4444;
  border-color: #EF4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 270px;
  margin: 0 auto;
}

.pin-key {
  height: 58px;
  background: #F8F9FA;
  border: 1.5px solid #E9ECEF;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-key:hover {
  background: #EDF2F7;
  border-color: #CBD5E1;
}

.pin-key:active {
  background: var(--purple-light);
  border-color: var(--purple);
  transform: scale(0.92);
}

.key-digit {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.key-sub {
  font-size: 0.6rem;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 1.5px;
}

.pin-action {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
}

.pin-clear {
  color: #EF4444;
}

.pin-back {
  color: var(--text-muted);
}

.pin-footer {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pin-hint-chip {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748B;
  background: #F1F5F9;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.pin-hint-chip.hidden {
  display: none !important;
}

.pin-cancel-btn {
  background: none;
  border: none;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  transition: all 0.15s;
}

.pin-cancel-btn:hover {
  color: var(--text-main);
  background: #F1F5F9;
}

/* ======================== UNIFIED PARENT DIALOG ======================== */
.parent-dialog-card {
  height: 88vh;
  height: 88dvh;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  overflow: hidden !important;
  padding: 20px 20px 0 20px;
}

.parent-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}

.parent-view.hidden {
  display: none !important;
}

#parent-view-pin {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 24px;
}

#parent-view-content {
  overflow: hidden;
}

.parent-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

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

.icon-subtle-btn {
  background: #F1F3F5;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-main);
}

.icon-subtle-btn:hover, .icon-subtle-btn:active {
  background: #E2E8F0;
  transform: scale(0.94);
}

.parent-header-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-light);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-top: 2px;
}

/* Segmented Tab Navigation */
.parent-nav-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  background: #F1F3F5;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.parent-tab-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.parent-tab-btn.active {
  background: white;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-weight: 800;
}

/* Parent Tab Content Body - ONLY THIS AREA SCROLLS */
.parent-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-bottom: 24px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.parent-body::-webkit-scrollbar {
  width: 5px;
}

.parent-body::-webkit-scrollbar-track {
  background: transparent;
}

.parent-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* Tab Content Transitions */
.ptab-content {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.2s ease;
}

.ptab-content.active {
  display: flex;
}

/* Subview Navigation Header (Settings, Simulator, History) */
.subview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  border-bottom: 1.5px solid var(--border-color);
  margin-bottom: 4px;
}

.btn-back-link {
  background: #F1F3F5;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-back-link:hover, .btn-back-link:active {
  background: #E2E8F0;
  transform: translateX(-2px);
}

.subview-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-subview {
  background: #F1E9E4;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-close-subview:hover, .btn-close-subview:active {
  background: #E2D9D3;
  color: var(--text-main);
}

.settings-footer {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Balance Banner */
.parent-balance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #FFEBF0 0%, #FFF5F7 100%);
  border: 1.5px solid #FFD1DC;
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

.p-banner-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.p-banner-val {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

/* Gift Form Layout & Spacing */
#form-parent-gift {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

#form-parent-gift .form-group label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Quick Reward Presets */
.gift-presets-group {
  margin-top: 6px;
}

.gift-presets-group label {
  margin-bottom: 2px;
}

.gift-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.gift-reason-group {
  margin-top: 6px;
}

.gift-reason-group label {
  margin-bottom: 2px;
}

.gift-preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.gift-preset-btn:hover, .gift-preset-btn:active {
  background: var(--secondary-light);
  border-color: var(--secondary);
  color: var(--secondary);
  transform: translateY(-1px);
}

.preset-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.preset-text {
  line-height: 1.2;
}

.btn-gift-action {
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(46, 196, 182, 0.35);
  background: var(--secondary);
}

.btn-gift-action:hover {
  background: var(--secondary-hover);
}

/* Parent Cards */
.p-card {
  background: #FAF9F8;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  border-bottom: 1px dashed #E5E7EB;
  padding-bottom: 6px;
}

.rule-hint {
  font-size: 0.78rem;
  color: #374151;
  background: #EFF6FF;
  border-left: 3px solid #3B82F6;
  padding: 8px 10px;
  border-radius: 4px;
  line-height: 1.4;
}

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

.goal-preview-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFF5F7 100%);
  border: 1.5px solid #FFE0E7;
}

.goal-preview-box {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Avatar Picker */
.avatar-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-opt {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background: white;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-opt.active {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.12);
}

/* Saturday Payout Simulator Box */
.simulate-card {
  background: #FFFBF0;
  border-color: #FDE68A;
}

.sim-status-box {
  background: white;
  border: 1.5px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}

.sim-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.sim-label {
  color: var(--text-muted);
  font-weight: 600;
}

.sim-val {
  font-weight: 700;
  color: var(--text-main);
}

.status-green {
  color: #10B981 !important;
}

.status-purple {
  color: var(--purple) !important;
  font-weight: 800;
}

.status-red {
  color: #EF4444 !important;
}

#setting-bonus:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(131, 56, 236, 0.15);
}

.sim-val.highlight {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: #D97706;
  font-weight: 800;
}

/* Transaction List in Parent Dashboard */
.parent-tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.parent-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.parent-tx-item button {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.parent-tx-item button:active {
  background: #DC2626;
  color: white;
}

/* Emoji Picker in Goal Modal */
.emoji-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emoji-opt {
  width: 44px;
  height: 44px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.emoji-opt.active {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.1);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2B2D42;
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  z-index: 2000;
  animation: popToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.toast.hidden {
  display: none;
}

@keyframes popToast {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==================== BACKUPS & PERSISTENCE STYLES ==================== */
.p-card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-primary-small {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 92, 141, 0.3);
  transition: all 0.2s;
  white-space: nowrap;
}

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

.backup-status-card {
  background: linear-gradient(135deg, #F0FBF7 0%, #E6F8F2 100%);
  border: 1.5px solid #A8EDD3;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.backup-status-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.backup-status-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.backup-status-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #12634C;
  margin: 0 0 2px 0;
}

.backup-status-sub {
  font-size: 0.78rem;
  color: #2D7A62;
  margin: 0;
  line-height: 1.3;
}

.backup-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid rgba(168, 237, 211, 0.6);
}

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

.meta-label {
  font-size: 0.68rem;
  color: #6C757D;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-val {
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 700;
}

.meta-val code {
  background: #EAECEF;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
}

.meta-val.highlight {
  color: #12634C;
  font-weight: 800;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 10px;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFAFA;
  border: 1px solid #ECECEC;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: all 0.2s;
  gap: 10px;
}

.backup-item:hover {
  background: white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

.backup-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.backup-item-icon {
  font-size: 1.3rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: white;
  border: 1px solid #EAEAEA;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.backup-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.backup-item-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.backup-type-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.backup-type-daily {
  background: #E6F8F2;
  color: #12634C;
}

.backup-type-manual {
  background: #FFF3D6;
  color: #8A6100;
}

.backup-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-action-sm {
  border: none;
  background: white;
  border: 1px solid #D9D9D9;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
}

.btn-action-sm:hover {
  background: #F1F3F5;
  border-color: #BDBDBD;
}

.btn-action-sm.btn-restore:hover {
  background: #FFF3D6;
  border-color: #F59E0B;
  color: #B45309;
}

