:root {
    --bg-color: #0b0e14;
    --card-bg: #1a1f26;
    --text-primary: #f0f2f5;
    --text-secondary: #a0aec0;
    --border-color: #2d3748;
    --accent-color: #a5b4fc;
}

body.pure-dark {
    --bg-color: #000000;
    --card-bg: #0a0a0a;
    --border-color: #1a1a1a;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Pretendard', sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.7;
}

/* Header */
.header {
    background: rgba(11, 14, 20, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 2rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

.header-left { display: flex; align-items: center; gap: 1.5rem; }
.main-nav ul { display: flex; list-style: none; gap: 2rem; }
.nav-link { text-decoration: none; color: var(--text-secondary); font-size: 0.95rem; font-weight: 600; transition: 0.3s; }
.nav-link:hover, .nav-link.active { color: white; }
.title { font-size: 1.4rem; font-weight: 900; background: linear-gradient(135deg, #a5b4fc, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Sidebar */
.main-layout { display: flex; }
.sidebar {
    width: 320px;
    background: rgba(26, 31, 38, 0.5);
    border-right: 1px solid var(--border-color);
    height: calc(100vh - 70px);
    position: sticky;
    top: 70px;
    padding: 1.5rem;
    overflow-y: auto;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
body.sidebar-closed .sidebar { width: 0; padding: 0; visibility: hidden; opacity: 0; }

.content-area { flex: 1; padding: 2rem; min-width: 0; }

/* Dashboard Grids - 겹침 방지 핵심 */
.dashboard-grid { 
    display: grid; 
    gap: 2rem; 
    margin-bottom: 4rem;
    grid-template-columns: repeat(auto-fill, minmax(550px, 1fr)); /* 최소 폭 확보로 겹침 방지 */
}

.sub-grid { 
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); 
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 550px; /* 고정 높이로 레이아웃 안정화 */
    overflow: hidden;
}

.chart-card.mini { height: 450px; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-shrink: 0; }
.chart-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

.chart-container { 
    flex-grow: 1; 
    width: 100%; 
    height: 100%; /* 부모 카드에 꽉 맞춤 */
    border-radius: 12px; 
    overflow: hidden;
}

/* Blog Content Rich (AdSense Optimized) */
.content-rich { max-width: 1100px; margin: 0 auto; }
.blog-feed { display: flex; flex-direction: column; gap: 3rem; margin-top: 2rem; }
.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 3.5rem;
    transition: 0.3s;
}
.article-card h2 { font-size: 2rem; margin-bottom: 1.5rem; color: white; }
.article-card h3 { font-size: 1.3rem; margin: 2rem 0 1rem; color: var(--accent-color); border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.article-card p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; text-align: justify; }
.post-date { color: var(--accent-color); font-weight: 800; display: block; margin-bottom: 1rem; letter-spacing: 1px; }

.section-label { font-size: 0.8rem; letter-spacing: 2px; color: var(--text-secondary); margin-bottom: 2rem; border-left: 4px solid var(--accent-color); padding-left: 1rem; }

.footer { padding: 5rem 2rem; border-top: 1px solid var(--border-color); text-align: center; color: var(--text-secondary); font-size: 0.9rem; }

@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .chart-card { height: 500px; }
}
