/* =========================================================================
   天彩帖 (Cheonchae-cheop) — Global Stylesheet
   Heaven's Palette Saju Analysis Program
   ========================================================================= */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;700;900&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* =========================================================================
   CSS Custom Properties
   ========================================================================= */
:root {
  /* Background */
  --bg-top:            #F0EBE1;
  --bg-bottom:         #E8E0D0;
  --bg-nav:            #EDE5D5;
  --bg-card:           rgba(255, 255, 255, 0.85);
  --bg-card-solid:     #FFFFFF;

  /* Text */
  --text-primary:      #3D2E1F;
  --text-secondary:    #8B7D6B;
  --text-muted:        #B0A08A;

  /* Accent / Gold */
  --gold:              #C4A265;
  --gold-dark:         #8B7355;
  --gold-light:        #D4BE8A;
  --gradient-gold:     linear-gradient(135deg, #C4A265, #8B7355);
  --gradient-gold-h:   linear-gradient(135deg, #D4B275, #9B8365);

  /* Borders & Shadows */
  --border:            #D4C5A9;
  --border-light:      #E8DCC8;
  --shadow-sm:         0 2px 8px rgba(61, 46, 31, 0.06);
  --shadow-md:         0 4px 16px rgba(61, 46, 31, 0.08);
  --shadow-lg:         0 8px 32px rgba(61, 46, 31, 0.12);
  --shadow-card:       0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(61, 46, 31, 0.13);

  /* Alert / Warning */
  --alert-warning-bg:    #FFF5F2;
  --alert-warning-border:#F5D0C5;
  --alert-warning-text:  #8B4A3A;

  /* Ohaeng (Five Elements) */
  --fire:   #E74C3C;
  --water:  #2196F3;
  --wood:   #4CAF50;
  --metal:  #555555;
  --earth:  #DAA520;

  /* Score Colors */
  --score-high-bg:     #E8F5E9;
  --score-high-text:   #2E7D32;
  --score-mid-bg:      #FFF8E1;
  --score-mid-text:    #B8860B;
  --score-low-bg:      #FFEBEE;
  --score-low-text:    #C62828;

  /* Layout */
  --max-width:    1040px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    20px;
  --radius-pill:  999px;

  /* Transitions */
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --transition:   0.25s var(--ease);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(170deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  line-height: 1.6;
  /* Subtle dot/cross pattern texture */
  background-image:
    radial-gradient(circle, rgba(180,160,120,0.08) 1px, transparent 1px),
    linear-gradient(170deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-size: 20px 20px, 100% 100%;
}

a {
  color: var(--gold-dark);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--gold);
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* =========================================================================
   Typography
   ========================================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Serif KR', serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.brand-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 2.5rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
}

.brand-title-sm {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* =========================================================================
   Layout Container
   ========================================================================= */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: 1.5rem 0;
}

/* =========================================================================
   Section Divider (golden gradient line)
   ========================================================================= */
.section-divider {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-dark), var(--gold), transparent);
  margin: 2rem 0;
  opacity: 0.5;
}

/* =========================================================================
   Section Header Pill / Badge
   ========================================================================= */
.section-header-pill {
  display: inline-block;
  background: rgba(200, 180, 140, 0.15);
  border: 1px solid rgba(180, 160, 120, 0.3);
  border-radius: 24px;
  padding: 8px 24px;
  letter-spacing: 0.15em;
  font-size: 14px;
  color: var(--gold-dark);
  font-weight: 500;
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-header-pill-wrapper {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* =========================================================================
   1. Login Page
   ========================================================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(170deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  padding: 2rem;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.login-card .brand-title {
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.login-input-group {
  position: relative;
  margin-bottom: 1rem;
}

.login-input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: center;
  letter-spacing: 0.1em;
}

.login-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.login-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 162, 101, 0.15);
}

.login-error {
  color: var(--alert-warning-text);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: none;
}

.login-error.visible {
  display: block;
}

/* =========================================================================
   2. Navigation Tabs (Two-row sticky tab bar)
   ========================================================================= */
.nav-tabs-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-light);
  padding: 0.5rem 0;
}

.nav-tabs-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

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

.nav-tabs-row {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.25rem 0;
}

.nav-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
  border: none;
  cursor: pointer;
  min-width: 64px;
}

.nav-tab-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-tab-label {
  font-size: 0.75rem;
  line-height: 1.2;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.5);
}

.nav-tab.active {
  color: #fff;
  background: var(--gradient-gold);
  box-shadow: 0 2px 8px rgba(196, 162, 101, 0.3);
  font-weight: 700;
  border-radius: var(--radius-md);
}

/* =========================================================================
   3. Header
   ========================================================================= */
.header {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.header-brand .brand-title-sm {
  line-height: 1;
}

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

/* =========================================================================
   4. Cards (Generic)
   ========================================================================= */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
  margin-bottom: 24px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.card-lg {
  padding: 36px;
}

.card-sm {
  padding: 20px 24px;
}

/* =========================================================================
   5. Info Cards (4-column birth info pillars)
   ========================================================================= */
.info-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.info-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.info-card-hanja {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.info-card-hangul {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.info-card-element {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  margin-top: 0.4rem;
  font-weight: 500;
}

.info-card-element.fire  { background: #FDE8E4; color: var(--fire);  }
.info-card-element.water { background: #E3F2FD; color: var(--water); }
.info-card-element.wood  { background: #E8F5E9; color: var(--wood);  }
.info-card-element.metal { background: #F0F0F0; color: var(--metal); }
.info-card-element.earth { background: #FFF8E1; color: var(--earth); }

/* =========================================================================
   6. 6대 운세 레이더 (3x2 Score Grid)
   ========================================================================= */
.fortune-radar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.fortune-radar-cell {
  padding: 1.25rem 1rem;
  text-align: center;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.fortune-radar-cell:nth-child(3n) {
  border-right: none;
}

.fortune-radar-cell:nth-child(n+4) {
  border-bottom: none;
}

.fortune-radar-score {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.fortune-radar-label {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Score color variants */
.fortune-radar-cell.score-high {
  background: var(--score-high-bg);
}
.fortune-radar-cell.score-high .fortune-radar-score,
.fortune-radar-cell.score-high .fortune-radar-label {
  color: var(--score-high-text);
}

.fortune-radar-cell.score-mid {
  background: var(--score-mid-bg);
}
.fortune-radar-cell.score-mid .fortune-radar-score,
.fortune-radar-cell.score-mid .fortune-radar-label {
  color: var(--score-mid-text);
}

.fortune-radar-cell.score-low {
  background: var(--score-low-bg);
}
.fortune-radar-cell.score-low .fortune-radar-score,
.fortune-radar-cell.score-low .fortune-radar-label {
  color: var(--score-low-text);
}

/* =========================================================================
   7. Radar Chart (Canvas)
   ========================================================================= */
.radar-chart {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.radar-chart canvas {
  max-width: 100%;
}

/* =========================================================================
   8. 오행 균형 분석 (Five Element Balance Bars)
   ========================================================================= */
.element-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.element-bar-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.element-bar-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 50px;
  flex-shrink: 0;
}

.element-bar-track {
  flex: 1;
  height: 12px;
  background: #E0D8CC;
  border-radius: 6px;
  overflow: hidden;
}

.element-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s var(--ease);
}

.element-bar-fill.fire  { background: var(--fire);  }
.element-bar-fill.water { background: var(--water); }
.element-bar-fill.wood  { background: var(--wood);  }
.element-bar-fill.metal { background: var(--metal); }
.element-bar-fill.earth { background: var(--earth); }

.element-bar-percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.element-analysis {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(200, 180, 140, 0.08);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.element-analysis-icon {
  margin-right: 0.35rem;
}

/* =========================================================================
   9. Score Bars (역량 분석 / Capability Analysis)
   ========================================================================= */
.score-bar {
  margin-bottom: 1.25rem;
}

.score-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.score-bar-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.score-bar-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.score-bar-track {
  height: 10px;
  background: #E0D8CC;
  border-radius: 6px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--gradient-gold);
  transition: width 0.8s var(--ease);
}

.score-bar-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* =========================================================================
   10. Keywords Tags (rounded border pills)
   ========================================================================= */
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.keyword-tag {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(180, 160, 120, 0.4);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gold-dark);
  background: rgba(200, 180, 140, 0.1);
  white-space: nowrap;
  transition: background var(--transition);
}

.keyword-tag:hover {
  background: rgba(200, 180, 140, 0.2);
}

/* =========================================================================
   11. 2026 Year Fortune + 용신 (Side-by-Side Cards)
   ========================================================================= */
.year-yongsin-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.year-fortune-card,
.yongsin-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 28px;
}

.yongsin-card-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.yongsin-element-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.yongsin-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
}

.yongsin-tag.fire  { background: #FDE8E4; color: var(--fire);  }
.yongsin-tag.water { background: #E3F2FD; color: var(--water); }
.yongsin-tag.wood  { background: #E8F5E9; color: var(--wood);  }
.yongsin-tag.metal { background: #F0F0F0; color: var(--metal); }
.yongsin-tag.earth { background: #FFF8E1; color: var(--earth); }

/* =========================================================================
   12. 오늘 운세 (Today's Fortune)
   ========================================================================= */
.today-fortune-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.today-fortune-date {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.today-fortune-pillar {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.today-score-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #5D4E3C;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif KR', serif;
  font-size: 1.25rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(93, 78, 60, 0.3);
}

.today-fortune-desc {
  padding: 1rem 1.25rem;
  background: rgba(200, 180, 140, 0.08);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* 3 columns: 금전운/애정운/건강운 */
.today-sub-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.today-sub-score {
  text-align: center;
  padding: 1rem 0.5rem;
  background: rgba(200, 180, 140, 0.06);
  border-radius: var(--radius-md);
}

.today-sub-score-icon {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.today-sub-score-value {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
}

.today-sub-score-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* 2x2 Lucky items grid */
.today-lucky-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.today-lucky-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.today-lucky-icon {
  font-size: 1.25rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.today-lucky-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.today-lucky-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* =========================================================================
   13. 대운 Section (Decade Fortune)
   ========================================================================= */
.daeun-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.daeun-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #5D4E3C;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif KR', serif;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(93, 78, 60, 0.3);
}

.daeun-content {
  flex: 1;
}

.daeun-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.daeun-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.daeun-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* =========================================================================
   14. 월별 운기 — Bar Chart
   ========================================================================= */
.monthly-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0;
  justify-content: space-between;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  min-height: 200px;
}

.monthly-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 0.35rem;
}

.monthly-bar-score {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.monthly-bar {
  width: 70%;
  max-width: 40px;
  border-radius: 6px 6px 0 0;
  background: #D8CCBA;
  transition: height 0.6s var(--ease);
  min-height: 8px;
}

.monthly-bar.current {
  background: var(--wood);
}

.monthly-bar.highlight {
  background: var(--gold);
}

.monthly-bar-month {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* =========================================================================
   15. 월별 운기 — Expandable Cards
   ========================================================================= */
.monthly-expand-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.monthly-expand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background var(--transition);
}

.monthly-expand-header:hover {
  background: rgba(200, 180, 140, 0.06);
}

.monthly-expand-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.monthly-expand-icon {
  font-size: 1.1rem;
}

.monthly-expand-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.monthly-expand-type {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.monthly-expand-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 0.5rem;
}

.monthly-expand-score-badge.score-high {
  background: var(--score-high-bg);
  color: var(--score-high-text);
}

.monthly-expand-score-badge.score-mid {
  background: var(--score-mid-bg);
  color: var(--score-mid-text);
}

.monthly-expand-score-badge.score-low {
  background: var(--score-low-bg);
  color: var(--score-low-text);
}

.monthly-expand-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  margin-left: 0.75rem;
}

.monthly-expand-card.open .monthly-expand-arrow {
  transform: rotate(180deg);
}

.monthly-expand-body {
  padding: 0 1.25rem 1.25rem;
  display: none;
}

.monthly-expand-card.open .monthly-expand-body {
  display: block;
}

.monthly-expand-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Mini score bars inside monthly expand */
.monthly-mini-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.monthly-mini-score {
  text-align: center;
}

.monthly-mini-score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.monthly-mini-score-bar {
  height: 6px;
  background: #E0D8CC;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.monthly-mini-score-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-gold);
}

.monthly-mini-score-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-dark);
}

/* =========================================================================
   16. Monthly Grid (legacy 4-column)
   ========================================================================= */
.monthly-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.monthly-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.monthly-card-month {
  font-family: 'Noto Serif KR', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.monthly-card-score {
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.monthly-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.monthly-card-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-pill);
  margin-top: 0.5rem;
  overflow: hidden;
}

.monthly-card-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gradient-gold);
}

/* =========================================================================
   17. Warning Box
   ========================================================================= */
.warning-box {
  background: var(--alert-warning-bg);
  border: 1px solid var(--alert-warning-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-bottom: 24px;
}

.warning-box-icon {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.warning-box-text {
  font-size: 0.875rem;
  color: var(--alert-warning-text);
  line-height: 1.6;
}

/* =========================================================================
   18. PDF Download Button
   ========================================================================= */
.btn-pdf-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 480px;
  margin: 2rem auto;
  padding: 1rem 2rem;
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--gold-dark);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-pdf-download:hover {
  background: rgba(196, 162, 101, 0.08);
  border-color: var(--gold-dark);
}

.btn-pdf-download-icon {
  font-size: 1.2rem;
}

/* =========================================================================
   19. Footer
   ========================================================================= */
.footer {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  margin-top: 2rem;
}

.footer-brand {
  font-family: 'Noto Serif KR', serif;
  font-size: 2.5rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.35rem;
}

.footer-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--gold-dark);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer-tagline strong {
  color: var(--text-primary);
  font-weight: 700;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* =========================================================================
   20. Logout Button (Fixed bottom-right)
   ========================================================================= */
/* btn-logout styles moved to user.html inline */

/* =========================================================================
   21. Buttons — Primary (golden gradient)
   ========================================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--gradient-gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(196, 162, 101, 0.3);
}

.btn-primary:hover {
  background: var(--gradient-gold-h);
  box-shadow: 0 4px 12px rgba(196, 162, 101, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* =========================================================================
   22. Buttons — Secondary (outlined)
   ========================================================================= */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: transparent;
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: rgba(196, 162, 101, 0.08);
  border-color: var(--gold-dark);
}

/* =========================================================================
   23. Buttons — Ghost
   ========================================================================= */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost:hover {
  background: rgba(196, 162, 101, 0.08);
  color: var(--text-primary);
}

/* =========================================================================
   24. Admin Layout
   ========================================================================= */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-card-solid);
  border-right: 1px solid var(--border-light);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .brand-title-sm {
  margin-bottom: 2rem;
  display: block;
  padding: 0 0.5rem;
}

.admin-main {
  padding: 2rem;
  background: linear-gradient(170deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

/* =========================================================================
   25. Admin Tabs
   ========================================================================= */
.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
}

.admin-tab:hover {
  background: rgba(196, 162, 101, 0.08);
  color: var(--text-primary);
}

.admin-tab.active {
  background: var(--gradient-gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196, 162, 101, 0.3);
}

.admin-tab-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* =========================================================================
   26. Stat Cards
   ========================================================================= */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-card-value {
  font-family: 'Noto Serif KR', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
}

.stat-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* =========================================================================
   27. Coupon Form
   ========================================================================= */
.coupon-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}

.coupon-form .form-group {
  margin-bottom: 1rem;
}

.coupon-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.coupon-form input[type="text"],
.coupon-form input[type="tel"],
.coupon-form input[type="number"],
.coupon-form select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.coupon-form input:focus,
.coupon-form select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 162, 101, 0.12);
}

/* =========================================================================
   28. Delivery Toggle
   ========================================================================= */

/* =========================================================================
   29. Data Table
   ========================================================================= */
.data-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: rgba(200, 180, 140, 0.1);
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 0.875rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(228, 220, 200, 0.5);
}

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

.data-table tr:hover td {
  background: rgba(200, 180, 140, 0.04);
}

/* =========================================================================
   30. Badges (status pills)
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-active {
  background: var(--score-high-bg);
  color: var(--score-high-text);
}

.badge-expired {
  background: var(--score-low-bg);
  color: var(--score-low-text);
}

.badge-pending {
  background: var(--score-mid-bg);
  color: var(--score-mid-text);
}

/* =========================================================================
   31. Pagination
   ========================================================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.pagination-btn:hover {
  background: rgba(196, 162, 101, 0.08);
  border-color: var(--gold);
}

.pagination-btn.active {
  background: var(--gradient-gold);
  color: #fff;
  border-color: transparent;
}

/* =========================================================================
   32. Toast / Notification
   ========================================================================= */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: #fff;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* =========================================================================
   33. Loading Spinner
   ========================================================================= */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.loading-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* =========================================================================
   34. Empty State
   ========================================================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* =========================================================================
   35. Tab Panel (show/hide content sections)
   ========================================================================= */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s var(--ease);
}

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

/* =========================================================================
   36. Utility Classes
   ========================================================================= */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-full { width: 100%; }
.hidden { display: none; }

.font-serif { font-family: 'Noto Serif KR', serif; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.text-gold { color: var(--gold-dark); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* =========================================================================
   37. Responsive — Tablet (<1024px)
   ========================================================================= */
@media (max-width: 1024px) {
  .info-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .fortune-radar-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .year-yongsin-row {
    flex-direction: column;
  }

  .admin-layout {
    grid-template-columns: 200px 1fr;
  }

  .today-sub-scores {
    grid-template-columns: repeat(3, 1fr);
  }

  .monthly-mini-scores {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================================
   38. Responsive — Mobile (<640px)
   ========================================================================= */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .card-lg {
    padding: 24px 16px;
  }

  .info-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

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

  .fortune-radar-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fortune-radar-cell:nth-child(3n) {
    border-right: 1px solid var(--border-light);
  }

  .fortune-radar-cell:nth-child(2n) {
    border-right: none;
  }

  .fortune-radar-cell:nth-child(n+5) {
    border-bottom: none;
  }

  .fortune-radar-cell:nth-child(n+4) {
    border-bottom: 1px solid var(--border-light);
  }

  .year-yongsin-row {
    flex-direction: column;
    gap: 16px;
  }

  .today-sub-scores {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .today-lucky-grid {
    grid-template-columns: 1fr;
  }

  .monthly-mini-scores {
    grid-template-columns: repeat(2, 1fr);
  }

  .monthly-bar-chart {
    min-height: 150px;
  }

  .monthly-bar {
    max-width: 24px;
  }

  .monthly-bar-score {
    font-size: 0.6rem;
  }

  .daeun-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .nav-tab {
    padding: 0.4rem 0.6rem;
    min-width: 52px;
  }

  .nav-tab-icon {
    font-size: 1rem;
  }

  .nav-tab-label {
    font-size: 0.65rem;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: -100%;
    width: 260px;
    z-index: 200;
    transition: left var(--transition);
  }

  .admin-sidebar.open {
    left: 0;
  }

  .brand-title {
    font-size: 2rem;
  }

  .section-header-pill {
    font-size: 12px;
    padding: 6px 18px;
    letter-spacing: 0.1em;
  }

  .btn-pdf-download {
    max-width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }

  /* btn-logout handled in user.html */

  .footer-brand {
    font-size: 2rem;
  }

  .today-score-badge {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  .daeun-badge {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
  }
}

/* =========================================================================
   39. Print Styles
   ========================================================================= */
@media print {
  body {
    background: #fff;
    background-image: none;
  }

  .nav-tabs-wrapper,
  .btn-logout,
  .btn-pdf-download,
  .header {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .footer {
    border-top: 1px solid #ddd;
    padding-top: 1rem;
  }
}
