/* RESET AND VARIABLES */
:root {
  --font-main: 'Outfit', 'Noto Sans KR', sans-serif;
  
  /* Color Palettes */
  --bg-dark: #070b13;
  --bg-panel: rgba(17, 25, 40, 0.6);
  --bg-sidebar: rgba(10, 16, 30, 0.85);
  --bg-card: rgba(22, 32, 54, 0.5);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  
  /* Brand/Status Colors */
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --accent-gold: #f59e0b;
  --success: #ef4444; /* Red for rise (Korean Standard) */
  --danger: #3b82f6;  /* Blue for fall (Korean Standard) */
  --hold: #64748b;    /* Grey for Hold */
  
  /* Saju Element Colors (Traditional Five Elements) */
  --color-wood: #1e3a8a;       /* Blue/Green */
  --color-wood-bg: rgba(30, 58, 138, 0.4);
  --color-fire: #7f1d1d;       /* Red */
  --color-fire-bg: rgba(127, 29, 29, 0.4);
  --color-earth: #78350f;      /* Brown/Yellow */
  --color-earth-bg: rgba(120, 53, 15, 0.4);
  --color-metal: #475569;      /* Grey/White */
  --color-metal-bg: rgba(71, 85, 105, 0.4);
  --color-water: #0f172a;      /* Dark Blue/Black */
  --color-water-bg: rgba(15, 23, 42, 0.6);
  
  /* Shadow & Blur */
  --glass-blur: blur(16px);
  --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-indigo: 0 0 15px rgba(99, 102, 241, 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* APP LAYOUT STRUCTURE */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* SIDEBAR STYLING */
.app-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
  padding: 24px;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--primary);
  background: none;
  -webkit-text-fill-color: initial;
}

.mobile-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 24px;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 8px;
}

.sidebar-nav a, .menu-item-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.sidebar-nav a:hover, .menu-item-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav li.active a, .sidebar-nav li.active .menu-item-link {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.03) 100%);
  color: var(--text-main);
  border-color: var(--border-focus);
  box-shadow: var(--glow-indigo);
}

.menu-text-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: var(--transition);
}

.menu-item-link:hover .menu-actions {
  opacity: 1;
}

.menu-edit-btn, .menu-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.menu-edit-btn:hover {
  color: var(--primary); /* Blue/Indigo hover */
}

.menu-delete-btn:hover {
  color: var(--success); /* Red hover */
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-focus);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--glow-indigo);
  transition: var(--transition);
}

.sidebar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sidebar-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
  color: var(--text-main);
  box-shadow: none;
}

.sidebar-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

/* MAIN CONTENT CONTAINER */
.app-main {
  flex: 1;
  margin-left: 280px;
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

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

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

.mobile-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.share-btn, .crawl-now-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 10px 18px;
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.share-btn:hover, .crawl-now-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-focus);
}

.crawl-now-btn i.spin {
  animation: fa-spin 1.5s infinite linear;
}

/* ARCHIVE CALENDAR TIMELINE */
.timeline-section {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 32px;
}

.section-title-wrapper {
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.calendar-timeline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.calendar-timeline::-webkit-scrollbar {
  height: 6px;
}

.calendar-timeline::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.timeline-day {
  flex: 0 0 calc(14.28% - 11px);
  min-width: 80px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.timeline-day:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.timeline-day.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: var(--primary);
  box-shadow: var(--glow-indigo);
}

.day-week {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.day-num {
  font-size: 1.1rem;
  font-weight: 700;
}

.day-month {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* VIEW PANEL LAYOUT */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.4s ease-out forwards;
}

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

/* EMPTY STATE PANEL */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: var(--glow-shadow);
  max-width: 550px;
  margin: 40px auto;
}

.empty-state.hidden {
  display: none !important;
}

.empty-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 24px;
  animation: pulse 2s infinite;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 400px;
}

.action-btn {
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--primary);
  border: none;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* SAJU STRUCTURE VIEW */
.saju-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.saju-pillars-card, .daeun-card {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--glow-shadow);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 24px;
}

/* Traditional 4 Pillars Grid Alignment */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.pillar-column {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.pillar-column.highlight {
  border-color: var(--border-focus);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0.01) 100%);
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.pillar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Stem / Branch colored cards */
.stem-card, .branch-card {
  width: 100%;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stem-card .hanja, .branch-card .hanja {
  font-size: 1.5rem;
  font-weight: 700;
}

.stem-card .korean, .branch-card .korean {
  font-size: 0.85rem;
  margin-top: 2px;
  opacity: 0.85;
}

.stem-card .sipsin, .branch-card .sipsin {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.pillar-info {
  margin-top: 10px;
  width: 100%;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pillar-info .jigangan {
  color: var(--text-muted);
}

.pillar-info .unseong {
  font-weight: 600;
  color: var(--accent-gold);
}

/* ELEMENT COLORS */
.el-목 { background-color: var(--color-wood-bg) !important; border-color: rgba(96, 165, 250, 0.3) !important; color: #93c5fd !important; }
.el-화 { background-color: var(--color-fire-bg) !important; border-color: rgba(248, 113, 113, 0.3) !important; color: #fca5a5 !important; }
.el-토 { background-color: var(--color-earth-bg) !important; border-color: rgba(234, 179, 8, 0.3) !important; color: #fef08a !important; }
.el-금 { background-color: var(--color-metal-bg) !important; border-color: rgba(226, 232, 240, 0.3) !important; color: #ffffff !important; }
.el-수 { background-color: var(--color-water-bg) !important; border-color: rgba(71, 85, 105, 0.5) !important; color: #e2e8f0 !important; }

/* DAEUN TIMELINE CARD */
.daeun-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.daeun-list::-webkit-scrollbar {
  height: 6px;
}

.daeun-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.daeun-item {
  flex: 0 0 100px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.daeun-item.active {
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.daeun-age {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.daeun-age .active-label {
  display: block;
  font-size: 0.65rem;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

.daeun-chars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.daeun-char {
  padding: 4px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.daeun-sipsins {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* FORTUNE TABS & INTERPRETATION PANELS */
.fortune-section {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--glow-shadow);
}

.fortune-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.fortune-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.fortune-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.fortune-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.02) 100%);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.fortune-tab-panel {
  display: none;
}

.fortune-tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.fortune-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

.fortune-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.fortune-relation-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(165, 180, 252, 0.2);
}

.fortune-scores {
  display: flex;
  gap: 20px;
}

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

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

.stars {
  display: flex;
  gap: 3px;
  color: var(--accent-gold);
  font-size: 0.85rem;
}

.fortune-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #cbd5e1;
}

/* NEWS FEED LIST CARDS */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-card {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--glow-shadow);
}

.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.news-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.news-source {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.news-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.news-card-title a {
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

.news-card-title a:hover {
  color: #a5b4fc;
}

.news-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.news-card-footer {
  display: flex;
  justify-content: flex-end;
}

.news-read-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  border-radius: 8px;
  transition: var(--transition);
}

.news-read-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* FINANCIAL WATCHLIST STOCKS & COINS GRID */
.financial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.fin-card {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--glow-shadow);
}

.fin-card:hover {
  border-color: var(--border-focus);
}

.fin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.fin-name-wrap {
  display: flex;
  flex-direction: column;
}

.fin-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.fin-symbol {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Recommendation Banner inside stock/coin */
.fin-rec-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.rec-BUY {
  background: rgba(239, 68, 68, 0.15); /* Red light */
  color: var(--success);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.rec-SELL {
  background: rgba(59, 130, 246, 0.15); /* Blue light */
  color: var(--danger);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.rec-HOLD {
  background: rgba(100, 116, 139, 0.15);
  color: var(--hold);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.fin-prices {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}

.fin-price {
  font-size: 1.5rem;
  font-weight: 700;
}

.fin-change {
  font-size: 0.95rem;
  font-weight: 600;
}

.up-trend { color: var(--success); }
.down-trend { color: var(--danger); }

/* Sparks SVG Sparkline graph */
.chart-container {
  height: 80px;
  width: 100%;
  margin-bottom: 20px;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.up {
  stroke: var(--success);
}

.chart-line.down {
  stroke: var(--danger);
}

.chart-line.hold {
  stroke: var(--hold);
}

.chart-area {
  opacity: 0.15;
}

.chart-area.up {
  fill: var(--success);
}

.chart-area.down {
  fill: var(--danger);
}

.chart-area.hold {
  fill: var(--hold);
}

.fin-analysis {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid var(--border-light);
}

.analysis-metrics {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  padding-bottom: 6px;
}

.metric-item {
  color: var(--text-muted);
}

.metric-item span {
  color: var(--text-main);
  font-weight: 600;
}

.analysis-reason {
  color: #cbd5e1;
}

/* MODAL OVERLAYS & DIALOGS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: var(--glass-blur);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

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

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

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

.form-group input, .form-group select {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-note {
  font-size: 0.75rem;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.08);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.btn-cancel {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  padding: 10px 20px;
  border-radius: 10px;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel:hover {
  background: rgba(255,255,255,0.1);
}

.btn-submit {
  background: var(--primary);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

/* GENERAL UTILITY STYLES */
.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--primary); }

.hidden {
  display: none !important;
}

/* loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 11, 19, 0.8);
  backdrop-filter: var(--glass-blur);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: loading-spin 1s infinite linear;
}

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

.loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

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

.toast {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 20px;
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideIn 0.3s ease-out;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

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

/* RESPONSIVE DESIGN - MOBILE COMFORT */
@media (max-width: 1024px) {
  .financial-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  
  .app-sidebar.active {
    transform: translateX(0);
    box-shadow: 20px 0 40px rgba(0,0,0,0.8);
  }
  
  .mobile-close-btn {
    display: block;
  }
  
  .app-main {
    margin-left: 0;
    padding: 24px;
  }
  
  .mobile-toggle-btn {
    display: block;
  }
  
  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  
  .timeline-day {
    flex: 0 0 75px;
  }
  
  .fortune-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .fortune-scores {
    width: 100%;
    justify-content: space-between;
  }
}

/* SHARED MODE STYLES */
body.shared-mode .app-sidebar {
  display: none !important;
}
body.shared-mode .app-main {
  margin-left: 0 !important;
  padding: 20px !important;
}
body.shared-mode .main-header {
  display: none !important;
}
body.shared-mode .timeline-section {
  display: none !important;
}
body.shared-mode .saju-content, body.shared-mode .news-list {
  max-width: 1000px;
  margin: 0 auto;
}

/* SIDEBAR COLLAPSED STATE */
.desktop-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.desktop-toggle-btn:hover {
  color: var(--text-main);
}

.app-sidebar.collapsed {
  width: 80px;
  padding: 24px 12px;
}

.app-sidebar.collapsed .logo-text {
  display: none;
}

.app-sidebar.collapsed .sidebar-header {
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.app-sidebar.collapsed .menu-text-wrap span {
  display: none;
}

.app-sidebar.collapsed .menu-actions {
  display: none !important;
}

.app-sidebar.collapsed .menu-item-link {
  justify-content: center;
  padding: 12px 0;
}

.app-sidebar.collapsed .menu-item-link i {
  font-size: 1.2rem;
  margin: 0;
}

.app-sidebar.collapsed .sidebar-btn span {
  display: none;
}

.app-sidebar.collapsed .sidebar-btn i {
  margin: 0;
  font-size: 1.2rem;
}

.app-main.expanded {
  margin-left: 80px;
}

@media (max-width: 900px) {
  .desktop-toggle-btn {
    display: none !important;
  }
}
