@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: #f1f5f9;
  color: #111827;
  min-height: 100vh;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== APP SHELL ===== */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: #F8FAFC;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
  overflow-x: hidden;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== HEADER ===== */
.app-header {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  z-index: 40;
}
.app-header h1 { font-size: 18px; font-weight: 700; color: #1f2937; }
.app-header .header-left { display: flex; align-items: center; gap: 12px; }
.app-header .header-right { display: flex; align-items: center; gap: 8px; }
.app-header button { padding: 4px; color: #4b5563; line-height: 0; }
.app-header button svg { width: 22px; height: 22px; }
.app-header .menu-btn svg { color: #B91C1C; }
.app-header .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e5e7eb; border: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: center;
}

/* ===== IN-APP BROWSER WARNING ===== */
.iab-warning {
  display: none;
  position: fixed;
  top: 64px; left: 16px; right: 16px;
  background: #1e293b;
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease-out;
}
.iab-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.iab-icon {
  color: #fbbf24;
  flex-shrink: 0;
  margin-top: 2px;
}
.iab-icon svg { width: 20px; height: 20px; }
.iab-text h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: #fff; }
.iab-text p { font-size: 12px; line-height: 1.5; color: #cbd5e1; }
.iab-text strong { color: #fff; }
.iab-close {
  position: absolute;
  top: -8px; right: -8px;
  width: 24px; height: 24px;
  background: #475569;
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}


/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: 64px;
  background: #1E293B;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding-bottom: 4px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 500;
  position: relative;
  transition: color 0.15s;
}
.nav-item svg { width: 22px; height: 22px; margin-bottom: 4px; }
.nav-item.active { color: #fff; }
.nav-item.active svg { stroke-width: 2.5px; }
.nav-item .nav-indicator {
  display: none;
  position: absolute;
  bottom: 4px;
  width: 48px; height: 4px;
  background: #EF4444;
  border-radius: 999px;
}
.nav-item.active .nav-indicator { display: block; }

/* ===== MAIN CONTENT AREA ===== */
.main-content {
  padding-top: 56px;
  padding-bottom: 80px;
  padding-left: 16px;
  padding-right: 16px;
  min-height: 100vh;
}

/* ===== PROGRESS BAR ===== */
.progress-track {
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ===== CARD COLORS ===== */
.card-color-blue { background: #2563eb; }
.card-color-slate { background: #1e293b; }
.card-color-indigo { background: #6366f1; }
.card-color-emerald { background: #059669; }
.card-color-red { background: #B91C1C; }

/* ===== LOGIN PAGE ===== */
#page-login {
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 64px 24px;
  position: relative;
  overflow: hidden;
}
.login-bg-circle1 {
  position: absolute;
  top: -10%; right: -10%;
  width: 300px; height: 300px;
  background: #FFF1F2;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
}
.login-bg-circle2 {
  position: absolute;
  bottom: -10%; left: -10%;
  width: 300px; height: 300px;
  background: #eef2ff;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
}
.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
}
.login-logo { width: 96px; height: 96px; margin-bottom: 40px; }
.login-title {
  font-size: 48px;
  font-weight: 900;
  color: #1E293B;
  letter-spacing: -2px;
  text-align: center;
  margin-bottom: 16px;
}
.login-subtitle { font-size: 18px; font-weight: 700; color: #9ca3af; text-align: center; }
.login-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; position: relative; z-index: 1; }
.google-btn {
  width: 100%; height: 64px;
  background: #fff; border: 1px solid #f1f5f9;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: 18px; font-weight: 700; color: #374151;
  transition: transform 0.1s;
}
.google-btn:active { transform: scale(0.98); }
.google-logo { width: 32px; height: 32px; }
.login-terms { font-size: 11px; color: #9ca3af; text-align: center; line-height: 1.6; max-width: 280px; }
.login-terms span { color: #E11D48; text-decoration: underline; font-weight: 700; }
.login-security { display: flex; align-items: center; gap: 8px; opacity: 0.3; padding-top: 32px; }
.login-security span { font-size: 10px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 2px; }

/* ===== NOTIFICATION PERMISSION ===== */
#page-notification {
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
}
.notif-header {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #f9fafb;
}
.notif-header span { font-weight: 700; color: #1f2937; }
.notif-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  text-align: center;
}
.notif-icon-wrap {
  width: 224px; height: 224px;
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  margin-bottom: 40px;
}
.notif-bell {
  width: 128px; height: 128px;
  background: #B91C1C;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(185,28,28,0.3);
}
.notif-bell svg { width: 64px; height: 64px; color: #fff; fill: #fff; }
.notif-deco1 {
  position: absolute; top: -16px; right: -16px;
  width: 64px; height: 64px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #f9fafb;
}
.notif-deco1-inner { width: 40px; height: 24px; background: #B91C1C; border-radius: 4px; opacity: 0.2; }
.notif-deco2 {
  position: absolute; bottom: -16px; left: -16px;
  width: 56px; height: 56px;
  background: #1E293B; border-radius: 50%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
}
.notif-deco2 svg { width: 20px; height: 20px; color: #fff; }
.notif-progress {
  position: absolute; bottom: 32px;
  width: 128px; height: 8px;
  background: #f3f4f6; border-radius: 999px; overflow: hidden;
}
.notif-progress-fill { width: 66%; height: 100%; background: #B91C1C; border-radius: 999px; }
.notif-title { font-size: 30px; font-weight: 900; color: #1E293B; margin-bottom: 16px; line-height: 1.2; }
.notif-desc { color: #9ca3af; font-weight: 500; line-height: 1.7; margin-bottom: 48px; }
.notif-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin-bottom: 48px; }
.notif-card {
  background: #fff; border-radius: 16px; padding: 16px;
  border: 1px solid #f3f4f6; text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.notif-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.notif-card h4 { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 4px; }
.notif-card p { font-size: 10px; color: #9ca3af; font-weight: 500; line-height: 1.5; }
.notif-footer { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.btn-primary {
  width: 100%; height: 64px;
  background: #B91C1C;
  color: #fff;
  border-radius: 16px;
  font-size: 18px; font-weight: 900;
  box-shadow: 0 10px 30px rgba(185,28,28,0.2);
  transition: transform 0.1s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  width: 100%; height: 48px;
  color: #9ca3af; font-weight: 700; font-size: 14px;
}

/* ===== HOME PAGE ===== */
.section-gap { margin-top: 24px; }
.section-gap + .section-gap { margin-top: 0; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-3 > * + * { margin-top: 12px; }

.summary-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f9fafb;
  margin-top: 16px;
}
.summary-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.summary-top h2 { font-size: 20px; font-weight: 700; color: #1f2937; }
.summary-top p { font-size: 14px; color: #6b7280; margin-top: 4px; }
.summary-pct { text-align: right; }
.summary-pct .label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; display: block; margin-bottom: 4px; }
.summary-pct .value { font-size: 30px; font-weight: 900; color: #10B981; }
.summary-bottom {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #f9fafb;
  margin-top: 24px;
}
.summary-stat .stat-label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; display: block; margin-bottom: 4px; }
.summary-stat .stat-value { font-size: 18px; font-weight: 700; color: #1f2937; }
.summary-stat.right { text-align: right; }
.summary-stat.right .stat-value { color: #E11D48; }

.section-header { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; margin-bottom: 16px; }
.section-header h3 { font-size: 15px; font-weight: 700; color: #1f2937; }
.section-header button { color: #9ca3af; line-height: 0; }

.card-item {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f9fafb;
  position: relative;
  overflow: hidden;
}
.card-item-top { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.card-chip { width: 56px; height: 36px; border-radius: 6px; opacity: 0.8; }
.card-info { flex: 1; }
.card-name-row { display: flex; justify-content: space-between; align-items: center; }
.card-name { font-weight: 700; color: #1f2937; font-size: 15px; }
.card-badge {
  font-size: 10px; font-weight: 700; color: #E11D48;
  background: #FFF1F2; padding: 2px 8px; border-radius: 999px;
}
.card-sub { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.card-progress-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 9px; font-weight: 700; color: #d1d5db; }
.card-remaining { font-size: 11px; color: #9ca3af; margin-top: 8px; }
.card-remaining span { font-weight: 700; color: #E11D48; }

.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 16px; }
.insight-dark {
  background: #1E293B; border-radius: 16px; padding: 20px; color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.insight-light {
  background: #ECFDF5; border-radius: 16px; padding: 20px;
  border: 1px solid #D1FAE5;
}
.insight-icon { margin-bottom: 8px; line-height: 0; }
.insight-label { font-size: 10px; display: block; margin-bottom: 4px; }
.insight-dark .insight-label { color: #bfdbfe; }
.insight-light .insight-label { color: #059669; }
.insight-value { font-size: 18px; font-weight: 700; line-height: 1.2; color: #fff; }
.insight-light .insight-value { font-size: 28px; font-weight: 900; color: #065f46; }

/* ===== RECOMMEND PAGE ===== */
.search-wrap { position: relative; margin-bottom: 24px; }
.search-wrap input {
  width: 100%; height: 56px;
  padding-left: 48px; padding-right: 16px;
  background: #fff; border: 1px solid #f1f5f9;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-size: 14px; font-weight: 500; color: #374151;
}
.search-wrap input:focus { outline: none; box-shadow: 0 0 0 3px rgba(185,28,28,0.1); }
.search-wrap input::placeholder { color: #9ca3af; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #9ca3af; line-height: 0; }
.search-icon svg { width: 20px; height: 20px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px; font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s;
  border: 1px solid #f1f5f9;
  background: #fff; color: #6b7280;
}
.chip.active { background: #1E293B; color: #fff; border-color: #1E293B; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.recommend-card-wrap {
  background: #fff; border-radius: 16px; padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid rgba(225,29,72,0.2);
}
.recommend-card-inner { padding: 20px; }
.recommend-card-top { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.recommend-chip { width: 96px; height: 60px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.recommend-info { flex: 1; }
.best-badge {
  display: inline-block;
  font-size: 10px; font-weight: 900;
  background: #E11D48; color: #fff;
  padding: 2px 8px; border-radius: 6px;
  margin-right: 8px;
}
.recommend-name { font-weight: 900; color: #1f2937; font-size: 18px; }
.recommend-rate { font-size: 24px; font-weight: 900; color: #10B981; }
.recommend-rate-label { font-size: 12px; font-weight: 700; color: #9ca3af; font-style: italic; margin-left: 4px; }
.recommend-btn {
  width: 100%; height: 56px;
  background: #C2410C; color: #fff;
  border-radius: 12px; font-size: 18px; font-weight: 900;
  box-shadow: 0 4px 15px rgba(194,65,12,0.3);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 16px;
  transition: transform 0.1s;
}
.recommend-btn:active { transform: scale(0.98); }
.recommend-btn svg { width: 24px; height: 24px; }

.second-card {
  background: #fff; border-radius: 16px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f9fafb;
  display: flex; align-items: center; gap: 16px;
  opacity: 0.8;
}

/* ===== CARD MANAGE PAGE ===== */
.manage-card-item {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f9fafb;
  cursor: pointer;
  transition: transform 0.1s;
}
.manage-card-item:active { transform: scale(0.98); }
.manage-card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.manage-chip { width: 48px; height: 32px; border-radius: 6px; opacity: 0.8; }
.manage-card-name-row { display: flex; justify-content: space-between; align-items: center; flex: 1; }
.manage-pct { font-size: 11px; font-weight: 700; color: #B91C1C; }
.manage-amounts { font-size: 10px; color: #9ca3af; }

.alert-banner {
  background: #FFF1F2; border-radius: 16px; padding: 16px;
  border: 1px solid #FECDD3;
  display: flex; align-items: center; justify-content: space-between;
}
.alert-left { display: flex; align-items: center; gap: 12px; }
.alert-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #E11D48;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.alert-icon svg { width: 20px; height: 20px; }
.alert-title { font-size: 12px; font-weight: 700; color: #1f2937; }
.alert-sub { font-size: 10px; color: #6b7280; }
.alert-btn {
  background: #fff; border: 1px solid #f1f5f9;
  padding: 6px 12px; border-radius: 8px;
  font-size: 11px; font-weight: 700; color: #B91C1C;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.payment-list {
  background: #fff; border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f9fafb;
  overflow: hidden;
}
.payment-item {
  padding: 16px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid #f9fafb;
}
.payment-item:last-child { border-bottom: none; }
.payment-cat-icon {
  width: 40px; height: 40px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.payment-cat-icon svg { width: 20px; height: 20px; }
.payment-merchant { font-size: 14px; font-weight: 700; color: #1f2937; }
.payment-meta { font-size: 10px; color: #9ca3af; margin-top: 2px; }
.payment-amount { font-weight: 900; color: #1f2937; margin-left: auto; text-align: right; }
.payment-tag {
  font-size: 9px; font-weight: 700;
  background: #f3f4f6; color: #9ca3af;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase;
  display: block; margin-top: 2px;
}

/* ===== EVENTS PAGE ===== */
.events-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.event-stat-card {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f9fafb;
}
.event-stat-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.event-stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.event-stat-icon svg { width: 18px; height: 18px; }
.event-urgency { font-size: 10px; font-weight: 900; text-transform: uppercase; }
.event-stat-label { font-size: 12px; font-weight: 700; color: #9ca3af; }
.event-stat-value { font-size: 18px; font-weight: 900; color: #1f2937; line-height: 1.2; }

.event-queue-item {
  background: #fff; border-radius: 16px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f9fafb;
}
.event-item-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.event-item-left { display: flex; align-items: center; gap: 12px; }
.event-card-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: #eef2ff; display: flex; align-items: center; justify-content: center;
  color: #6366f1;
}
.event-card-icon svg { width: 20px; height: 20px; }
.event-card-name { font-weight: 700; color: #1f2937; font-size: 14px; line-height: 1.2; }
.event-issue-date { font-size: 10px; color: #9ca3af; margin-top: 2px; }
.event-dday { font-size: 12px; font-weight: 900; color: #B91C1C; display: block; }
.event-status { font-size: 9px; font-weight: 700; color: #9ca3af; text-transform: uppercase; }
.event-progress-area { margin-bottom: 16px; }
.event-progress-labels { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; color: #9ca3af; margin-bottom: 6px; text-transform: uppercase; }
.event-btns { display: flex; gap: 8px; }
.event-btn-main {
  flex: 1; height: 40px; border-radius: 8px;
  font-size: 12px; font-weight: 700; color: #fff;
  transition: transform 0.1s;
}
.event-btn-main:active { transform: scale(0.98); }
.event-btn-main.urgent { background: #B91C1C; }
.event-btn-main.normal { background: #1E293B; }
.event-btn-detail {
  height: 40px; padding: 0 16px;
  background: #fff; border: 1px solid #f1f5f9;
  border-radius: 8px; font-size: 12px; font-weight: 700; color: #6b7280;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.add-card-btn {
  width: 100%; height: 48px;
  background: #0F172A; color: #fff;
  border-radius: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.1s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.add-card-btn:active { transform: scale(0.98); }
.add-card-btn svg { width: 18px; height: 18px; }

/* ===== CALENDAR PAGE ===== */
.calendar-nav {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px; padding: 0 4px;
}
.cal-back-btn {
  position: absolute; left: 0; padding: 4px;
  color: #B91C1C; line-height: 0;
}
.cal-back-btn svg { width: 28px; height: 28px; stroke-width: 3; }
.cal-month { font-size: 30px; font-weight: 900; color: #1f2937; }
.cal-arrow-btns { position: absolute; right: 0; display: flex; gap: 4px; }
.cal-arrow-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: #fff; border: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  line-height: 0;
}
.cal-arrow-btn svg { width: 20px; height: 20px; }
.cal-total-card {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  margin-bottom: 24px;
}
.cal-total-label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 8px; }
.cal-total-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eff6ff; color: #3B82F6;
  font-size: 10px; font-weight: 900;
  padding: 2px 8px; border-radius: 999px;
  margin-bottom: 8px;
}
.cal-total-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-total-amount { font-size: 30px; font-weight: 900; color: #B91C1C; }

.calendar-grid-card {
  background: #fff; border-radius: 24px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  overflow: hidden;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 0 0;
  row-gap: 16px;
  text-align: center;
}
.cal-day-header { font-size: 11px; font-weight: 900; color: #a5b4fc; text-transform: uppercase; }
.cal-day-prev { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; }
.cal-day-prev span { font-size: 11px; font-weight: 700; color: #e5e7eb; }
.cal-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 2px; border-radius: 12px; cursor: pointer;
  transition: background 0.1s;
}
.cal-day:hover { background: #f9fafb; }
.cal-day.selected { background: #B91C1C; box-shadow: 0 4px 15px rgba(185,28,28,0.2); }
.cal-day-num { font-size: 11px; font-weight: 700; color: #9ca3af; }
.cal-day.selected .cal-day-num { color: #fff; }
.cal-day-amount { font-size: 8px; font-weight: 900; color: #B91C1C; line-height: 1.2; }
.cal-day.selected .cal-day-amount { color: rgba(255,255,255,0.8); }

.cal-tx-header { font-weight: 700; color: #1f2937; padding: 0 4px; margin-bottom: 12px; }
.cal-tx-item {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  display: flex; align-items: center; justify-content: space-between;
}
.cal-tx-left { display: flex; align-items: center; gap: 16px; }
.cal-tx-icon {
  width: 40px; height: 40px; border-radius: 16px;
  background: #eef2ff; color: #6366f1;
  display: flex; align-items: center; justify-content: center;
}
.cal-tx-icon svg { width: 20px; height: 20px; }
.cal-tx-name { font-size: 14px; font-weight: 700; color: #1f2937; line-height: 1.2; }
.cal-tx-meta { font-size: 10px; color: #9ca3af; margin-top: 2px; }
.cal-tx-amount { font-weight: 900; color: #B91C1C; }
.cal-fab {
  position: fixed; bottom: 88px; right: 16px;
  width: 56px; height: 56px;
  background: #B91C1C; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 25px rgba(185,28,28,0.3);
  z-index: 40;
  transition: transform 0.1s;
}
.cal-fab:active { transform: scale(0.9); }
.cal-fab svg { width: 28px; height: 28px; }

/* ===== CARD EDIT PAGE ===== */
#page-card-edit {
  min-height: 100vh;
  background: #F8FAFC;
  padding-bottom: 80px;
}
.edit-header {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: #fff; border-bottom: 1px solid #f1f5f9;
  z-index: 50;
}
.edit-header h1 { font-size: 18px; font-weight: 700; color: #1f2937; }
.edit-header .done-btn { font-size: 18px; font-weight: 900; color: #B91C1C; padding: 0 8px; }
.edit-header .close-btn { padding: 4px; line-height: 0; }
.edit-header .close-btn svg { width: 24px; height: 24px; color: #1f2937; }
.edit-body { padding: 80px 24px 24px; }
.edit-hint { font-size: 12px; font-weight: 500; color: #9ca3af; line-height: 1.6; margin-bottom: 24px; }
.edit-card-item {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  display: flex; align-items: center; gap: 16px;
  transition: transform 0.1s;
}
.edit-card-item:active { transform: scale(0.98); }
.edit-minus-btn { color: #B91C1C; line-height: 0; }
.edit-minus-btn svg { width: 24px; height: 24px; }
.edit-card-chip { width: 48px; height: 32px; border-radius: 6px; opacity: 0.8; }
.edit-card-name { font-size: 14px; font-weight: 700; color: #1f2937; line-height: 1.2; }
.edit-card-progress { height: 6px; background: #f9fafb; border-radius: 999px; overflow: hidden; margin-top: 6px; width: 100%; }
.edit-card-progress-fill { height: 100%; background: #1E293B; border-radius: 999px; width: 66%; }
.edit-grip { color: #d1d5db; line-height: 0; margin-left: auto; }
.edit-grip svg { width: 24px; height: 24px; }
.add-card-dashed {
  width: 100%; height: 64px;
  border: 2px dashed #e5e7eb;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: #9ca3af;
  margin-top: 16px;
  transition: background 0.15s;
}
.add-card-dashed:hover { background: #f9fafb; }
.add-card-dashed svg { width: 20px; height: 20px; color: #B91C1C; }

/* Delete Popup */
.popup-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17,24,39,0.4);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 24px;
}
.popup-overlay.open { display: flex; }
.popup-box {
  background: #fff; border-radius: 32px; padding: 32px;
  width: 100%; max-width: 320px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}
.popup-icon {
  width: 64px; height: 64px; background: #fef2f2;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  color: #B91C1C;
}
.popup-icon svg { width: 28px; height: 28px; }
.popup-title { font-size: 21px; font-weight: 900; color: #1f2937; margin-bottom: 8px; line-height: 1.2; }
.popup-desc { font-size: 12px; color: #9ca3af; font-weight: 500; line-height: 1.6; padding: 0 8px; }
.popup-btns { display: flex; gap: 12px; margin-top: 24px; }
.popup-cancel { flex: 1; height: 48px; border-radius: 12px; font-size: 14px; font-weight: 700; color: #9ca3af; }
.popup-delete {
  flex: 1; height: 48px; border-radius: 12px;
  background: #B91C1C; color: #fff;
  font-size: 14px; font-weight: 900;
  box-shadow: 0 4px 15px rgba(185,28,28,0.2);
  transition: transform 0.1s;
}
.popup-delete:active { transform: scale(0.98); }

/* ===== CARD ADD PAGE ===== */
#page-card-add {
  min-height: 100vh;
  background: #F8FAFC;
  padding-bottom: 120px;
}
.card-add-body { padding: 80px 24px 24px; }
.card-add-title { font-size: 28px; font-weight: 900; color: #1f2937; letter-spacing: -1px; }
.card-add-subtitle { font-size: 12px; font-weight: 500; color: #9ca3af; margin-top: 4px; }
.form-section {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  margin-top: 32px;
}
.form-field { margin-bottom: 20px; }
.form-field:last-child { margin-bottom: 0; }
.form-label {
  display: block; font-size: 10px; font-weight: 900;
  color: #B91C1C; text-transform: uppercase;
  margin-bottom: 8px; letter-spacing: 1px;
}
.form-label-gray {
  display: block; font-size: 10px; font-weight: 700;
  color: #9ca3af; text-transform: uppercase;
  margin-bottom: 8px;
}
.form-input {
  width: 100%; height: 48px; padding: 0 16px;
  background: #F8FAFC; border: 1px solid #f1f5f9;
  border-radius: 12px; font-size: 14px; font-weight: 700; color: #1f2937;
}
.form-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(185,28,28,0.1); }
.form-input-wrap { position: relative; }
.form-input-wrap .input-icon {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  line-height: 0; color: #B91C1C;
}
.form-input-wrap .input-icon svg { width: 18px; height: 18px; }
.form-input-wrap .input-suffix {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: #9ca3af;
}
.form-input.disabled { color: #9ca3af; background: #F8FAFC; }
.form-input.text-right { text-align: right; padding-right: 32px; }

.suggestions { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.suggestion-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; border: 1px solid;
}
.suggestion-item.active { background: #FFF1F2; border-color: #FECDD3; }
.suggestion-item.inactive { background: #fff; border-color: #f9fafb; }
.suggestion-chip { width: 24px; height: 16px; border-radius: 3px; opacity: 0.6; }
.suggestion-chip.red { background: #B91C1C; }
.suggestion-chip.dark { background: #1E293B; }
.suggestion-name { font-size: 12px; font-weight: 700; color: #1f2937; }
.suggestion-name span { color: #E11D48; }
.suggestion-sub { font-size: 9px; color: #9ca3af; }

.form-select-fake {
  width: 100%; height: 48px; padding: 0 16px;
  background: #F8FAFC; border: 1px solid #f1f5f9;
  border-radius: 12px; font-size: 14px; font-weight: 700; color: #1f2937;
  display: flex; align-items: center; justify-content: space-between;
}
.form-select-fake svg { width: 18px; height: 18px; color: #9ca3af; }

.optional-section {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  margin-top: 32px;
}
.optional-label { font-size: 12px; font-weight: 700; color: #1e3a8a; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; }

.fab-bottom {
  position: fixed; bottom: 24px;
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 48px); max-width: 382px;
  z-index: 50;
}
.fab-save {
  width: 100%; height: 64px;
  background: #B91C1C; color: #fff;
  border-radius: 16px; font-size: 18px; font-weight: 900;
  box-shadow: 0 10px 30px rgba(185,28,28,0.2);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: transform 0.1s;
}
.fab-save:active { transform: scale(0.98); }
.fab-save svg { width: 24px; height: 24px; }

/* ===== CARD DETAIL PAGE ===== */
#page-card-detail {
  min-height: 100vh;
  background: #fff;
  padding-bottom: 96px;
  padding-top: 56px;
  padding-left: 16px;
  padding-right: 16px;
}
.detail-dark-card {
  background: #1E293B; border-radius: 24px; padding: 24px;
  color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  position: relative; overflow: hidden;
  margin-top: 16px;
}
.detail-star { position: absolute; top: 24px; right: 24px; color: #fbbf24; }
.detail-star svg { width: 24px; height: 24px; fill: #fbbf24; }
.detail-premium-label { font-size: 10px; font-weight: 700; color: #93c5fd; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 4px; }
.detail-card-name { font-size: 24px; font-weight: 900; }
.detail-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.detail-amount-label { font-size: 9px; font-weight: 700; color: #6b7280; text-transform: uppercase; display: block; margin-bottom: 4px; }
.detail-amount-val { font-size: 18px; font-weight: 900; }
.detail-amounts .right { text-align: right; }
.detail-amounts .right .detail-amount-val { color: #10B981; }
.detail-progress-pct { text-align: right; font-size: 10px; font-weight: 700; color: #6b7280; margin-top: 8px; }

.chart-card {
  background: #fff; border-radius: 24px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  margin-top: 24px;
}
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.chart-title { font-size: 18px; font-weight: 900; color: #1f2937; }
.chart-icon { color: #1E293B; line-height: 0; }
.chart-icon svg { width: 24px; height: 24px; }
.bar-chart { height: 128px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 16px 8px 0; }
.bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bar { width: 24px; border-radius: 3px 3px 0 0; transition: height 1s ease; }
.bar.active { background: #1E293B; height: 96px; }
.bar.inactive { background: #f3f4f6; height: 64px; }
.bar-label { font-size: 10px; font-weight: 700; }
.bar-label.active { color: #1f2937; }
.bar-label.inactive { color: #d1d5db; }

.goal-card {
  background: #fff; border-radius: 24px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  margin-top: 24px;
}
.goal-title { font-size: 18px; font-weight: 900; color: #1f2937; margin-bottom: 24px; }
.goal-input-wrap { position: relative; margin-bottom: 16px; }
.goal-input {
  width: 100%; height: 56px; padding: 0 24px;
  background: #fff; border: 2px solid #f1f5f9;
  border-radius: 16px; font-size: 16px; font-weight: 900; color: #1f2937;
}
.goal-input:focus { outline: none; border-color: #B91C1C; }
.goal-edit-icon { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); color: #9ca3af; line-height: 0; }
.goal-edit-icon svg { width: 20px; height: 20px; }
.goal-info {
  background: #eff6ff; border-radius: 16px; padding: 16px;
  display: flex; gap: 12px; border: 1px solid #dbeafe;
  margin-bottom: 16px;
}
.goal-info-icon { color: #3b82f6; line-height: 0; flex-shrink: 0; }
.goal-info-icon svg { width: 20px; height: 20px; }
.goal-info-text { font-size: 11px; color: #1d4ed8; font-weight: 500; line-height: 1.6; }
.goal-save-btn {
  width: 100%; height: 64px;
  background: #B91C1C; color: #fff;
  border-radius: 16px; font-size: 21px; font-weight: 900;
  box-shadow: 0 4px 15px rgba(185,28,28,0.2);
  transition: transform 0.1s;
}
.goal-save-btn:active { transform: scale(0.98); }

/* ===== PAYMENT HISTORY EDIT PAGE ===== */
#page-payment-edit {
  min-height: 100vh;
  background: #fff;
  padding-bottom: 96px;
  padding-top: 56px;
}
.pay-edit-body { padding: 16px; }
.pay-summary-card {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f1f5f9;
  margin-top: 8px;
}
.pay-summary-left { display: flex; align-items: center; gap: 12px; }
.pay-summary-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: #eff6ff; display: flex; align-items: center; justify-content: center; color: #3b82f6;
}
.pay-summary-icon svg { width: 20px; height: 20px; }
.pay-summary-title { font-size: 14px; font-weight: 700; color: #1f2937; line-height: 1.2; }
.pay-summary-sub { font-size: 10px; color: #9ca3af; font-weight: 500; }
.pay-add-btn { display: flex; align-items: center; gap: 4px; color: #B91C1C; font-weight: 900; font-size: 12px; }
.pay-add-btn svg { width: 16px; height: 16px; stroke-width: 3; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 16px 0; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 8px 24px; border-radius: 999px;
  font-size: 12px; font-weight: 900;
  white-space: nowrap; border: 1px solid;
  transition: all 0.15s;
}
.filter-chip.active { background: #B91C1C; color: #fff; border-color: #B91C1C; box-shadow: 0 4px 10px rgba(185,28,28,0.2); }
.filter-chip.inactive { background: #fff; color: #6b7280; border-color: #f1f5f9; }
.pay-item {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  display: flex; align-items: center; gap: 16px;
}
.pay-item-icon { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.pay-item-icon svg { width: 24px; height: 24px; }
.pay-item-name { font-weight: 700; color: #1f2937; line-height: 1.2; }
.pay-item-meta { font-size: 10px; color: #9ca3af; font-weight: 500; margin-top: 2px; }
.pay-item-amount { font-weight: 900; color: #1f2937; font-size: 18px; margin-left: auto; }
.pay-item-tag { font-size: 9px; font-weight: 900; background: #f9fafb; color: #d1d5db; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; display: block; text-align: right; margin-top: 2px; }
.unclassified {
  background: #E6F4F1; border-radius: 16px; padding: 16px;
  border: 1px solid #BEE3DB;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
}
.unclassified-icon { width: 48px; height: 48px; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center; color: #E11D48; }
.unclassified-icon svg { width: 24px; height: 24px; }
.unclassified-amount { font-weight: 900; color: #B91C1C; font-size: 18px; }
.unclassified-btn { font-size: 9px; font-weight: 900; background: #E11D48; color: #fff; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; }
.history-section-date { font-size: 14px; font-weight: 900; color: #1f2937; padding: 0 4px; margin-bottom: 12px; }
.history-group { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb; }
.history-item { padding: 16px; display: flex; align-items: center; gap: 16px; }
.history-item + .history-item { border-top: 1px solid #f9fafb; }

/* ===== EXPENSE INPUT PAGE ===== */
#page-expense {
  min-height: 100vh;
  background: #fff;
  padding-bottom: 96px;
  padding-top: 56px;
  padding-left: 16px;
  padding-right: 16px;
}
.amount-section { text-align: center; padding: 16px 0; }
.amount-label { font-size: 10px; font-weight: 900; color: #B91C1C; text-transform: uppercase; letter-spacing: 3px; display: block; margin-bottom: 8px; }
.amount-input {
  font-size: 48px; font-weight: 900; color: #1f2937;
  text-align: center; border: none; background: transparent;
  width: 100%; outline: none;
}
.amount-won { font-size: 28px; font-weight: 900; color: #1f2937; }
.expense-form {
  background: #fff; border-radius: 24px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f9fafb;
  margin-top: 32px;
}
.expense-field { margin-bottom: 24px; }
.expense-field:last-child { margin-bottom: 0; }
.expense-label { display: block; font-size: 10px; font-weight: 900; color: #9ca3af; text-transform: uppercase; margin-bottom: 8px; }
.expense-select-fake {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; background: #F8FAFC; border-radius: 16px;
  border: 1px solid #f9fafb;
}
.expense-select-left { display: flex; align-items: center; gap: 12px; }
.expense-card-color { width: 32px; height: 20px; background: #B91C1C; border-radius: 4px; opacity: 0.6; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.expense-select-fake span { font-size: 14px; font-weight: 700; color: #1f2937; }
.expense-select-fake svg { width: 18px; height: 18px; color: #9ca3af; }
.expense-date-fake {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; background: #F8FAFC; border-radius: 16px;
  border: 1px solid #f1f5f9;
}
.expense-date-left { display: flex; align-items: center; gap: 12px; color: #B91C1C; }
.expense-date-left svg { width: 18px; height: 18px; }
.expense-date-left span { font-size: 14px; font-weight: 700; color: #1f2937; }
.expense-categories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.expense-categories::-webkit-scrollbar { display: none; }
.expense-cat-chip {
  padding: 10px 20px; border-radius: 12px;
  font-size: 12px; font-weight: 900; white-space: nowrap;
  transition: all 0.15s;
}
.expense-cat-chip.active { background: #1E293B; color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.expense-cat-chip.inactive { background: #fff; color: #9ca3af; border: 1px solid #f1f5f9; }
.expense-merchant-wrap { position: relative; }
.expense-merchant-input {
  width: 100%; height: 56px; padding: 0 16px;
  background: #F8FAFC; border-radius: 16px; border: 1px solid #f1f5f9;
  font-size: 14px; font-weight: 700; color: #1f2937;
}
.expense-merchant-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(185,28,28,0.1); }
.expense-merchant-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #d1d5db; line-height: 0; }
.expense-merchant-icon svg { width: 18px; height: 18px; }
.receipt-btn {
  width: 100%; height: 64px;
  background: #fff; border: 2px dashed #e5e7eb;
  border-radius: 24px; display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 14px; font-weight: 700; color: #9ca3af;
  margin-top: 24px;
  transition: background 0.15s;
}
.receipt-btn:hover { background: #f9fafb; }
.receipt-btn svg { width: 24px; height: 24px; color: #B91C1C; }
.expense-confirm-wrap { margin-top: 24px; }
.expense-confirm-btn {
  width: 100%; height: 64px;
  background: #B91C1C; color: #fff;
  border-radius: 16px; font-size: 18px; font-weight: 900;
  box-shadow: 0 10px 30px rgba(185,28,28,0.2);
  transition: transform 0.1s;
}
.expense-confirm-btn:active { transform: scale(0.98); }

/* ===== UTILITY ===== */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-red { color: #B91C1C; }
.text-green { color: #10B981; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.text-gray { color: #6b7280; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-xxs { font-size: 10px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* --- 페이지 레이아웃 최종 정리 --- */

/* 1. 모든 페이지는 기본적으로 아예 없었던 것처럼 숨김 */
.page {
    display: none !important; /* 공간 차지 안 함 */
}

/* 2. active 클래스가 붙은 페이지만 정상적으로 보여줌 */
.page.active {
    display: block !important; 
    width: 100%;
    max-width: 430px;
    margin: 0 auto; /* 수평 중앙 정렬 */
    min-height: 100vh;
    background: white;
}

/* 3. 님 디자인 특성상 내부가 flex일 수 있으니 보정 */
#page-login.active, 
#page-notification.active, 
#page-main.active {
    display: flex !important;
    flex-direction: column;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%) translateY(-100%);
  width: 100%; max-width: 430px;
  background: #fff;
  z-index: 60;
  padding: 10px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-overlay.visible {
  transform: translateX(-50%) translateY(0);
}
.search-bar-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 10px 14px;
}
.search-input {
  flex: 1;
  border: none; background: none;
  font-size: 15px; font-weight: 500; color: #1f2937;
  outline: none;
}
.search-input::placeholder { color: #9ca3af; }
.search-close-btn { line-height: 0; padding: 2px; flex-shrink: 0; }

/* ===== NOTIFICATION DROPDOWN ===== */
.notif-dropdown {
  position: fixed;
  top: 56px; left: 50%; transform: translateX(-50%) translateY(-8px);
  width: 100%; max-width: 430px;
  background: #fff;
  z-index: 55;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-bottom: 1px solid #f1f5f9;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.notif-dropdown.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.notif-dd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 10px;
  border-bottom: 1px solid #f9fafb;
}
.notif-dd-header span { font-size: 15px; font-weight: 700; color: #1f2937; }
.notif-dd-header button { line-height: 0; padding: 4px; }
.notif-dd-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px 20px;
  color: #9ca3af;
}
.notif-dd-empty p { font-size: 13px; font-weight: 500; color: #9ca3af; }

/* ===== CARD SORT MODE ===== */
.sort-mode-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px 16px !important;
  background: #fff8f8 !important;
  border-color: #FECDD3 !important;
}
.sort-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.sort-btn-up, .sort-btn-down {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  color: #B91C1C;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.1s;
}
.sort-btn-up:disabled, .sort-btn-down:disabled {
  color: #d1d5db;
  cursor: not-allowed;
}
.sort-btn-up:not(:disabled):active,
.sort-btn-down:not(:disabled):active { background: #fef2f2; }
.sort-grip { flex-shrink: 0; line-height: 0; }

#page-payment-edit.active {
    padding-bottom: 80px;
}

/* ===== GOOGLE MOCK SIGN-IN MODAL ===== */
.google-mock-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 16px;
}
.google-mock-overlay.open {
  display: flex;
}
.google-mock-box {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 380px;
  padding: 36px 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  color: #202124;
}
.google-mock-logo-wrap {
  margin-bottom: 16px;
}
.google-mock-logo {
  display: block;
}
.google-mock-header-text {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}
.google-mock-title {
  font-size: 24px;
  font-weight: 400;
  color: #202124;
  margin-top: 10px;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.google-mock-subtitle {
  font-size: 14px;
  color: #1a73e8;
  margin-bottom: 24px;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
}
.google-mock-subtitle:hover {
  text-decoration: underline;
}
.google-mock-accounts {
  border-top: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  margin-bottom: 24px;
  max-height: 250px;
  overflow-y: auto;
}
.google-mock-account-item {
  display: flex;
  align-items: center;
  padding: 12px 4px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f4;
  transition: background 0.15s;
}
.google-mock-account-item:last-child {
  border-bottom: none;
}
.google-mock-account-item:hover {
  background: #f8f9fa;
}
.google-mock-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  margin-right: 12px;
}
.google-mock-avatar-other {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #dadce0;
  color: #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}
.google-mock-account-info {
  display: flex;
  flex-direction: column;
}
.google-mock-account-name {
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
}
.google-mock-account-email {
  font-size: 12px;
  color: #5f6368;
}
.google-mock-other-text {
  font-size: 14px;
  font-weight: 500;
  color: #1a73e8;
}
.google-mock-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #757575;
  margin-top: 8px;
}
.google-mock-lang {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.google-mock-lang:hover {
  color: #202124;
}
.google-mock-links {
  display: flex;
  gap: 16px;
}
.google-mock-links a {
  color: #757575;
  text-decoration: none;
}
.google-mock-links a:hover {
  color: #202124;
  text-decoration: underline;
}
