:root {
    --bg-color: #0d0d12;
    --glass-bg: rgba(23, 23, 33, 0.7);
    --primary: #6c5ce7;
    --income: #00d2ad;
    --expense: #ff4757;
    --warning: #ffa502;
    --safe: #2ed573;
    --text-main: #ffffff;
    --text-dim: #a0a0b0;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 20px;
}

.glass-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 24px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
}

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

.logo { font-weight: 800; font-size: 1.3rem; color: #fff; }

.month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 100px;
}
.month-selector button {
    background: none; border: none; color: white; cursor: pointer; font-size: 1.1rem;
}

/* Mega Summary */
.mega-summary {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(108, 92, 231, 0.05));
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: center;
}

.mega-summary h1 { font-size: 2.8rem; font-weight: 800; margin: 8px 0; }
.mega-summary .label { color: var(--text-dim); font-size: 0.9rem; }

.progress-track {
    background: rgba(255, 255, 255, 0.05);
    height: 8px;
    border-radius: 100px;
    overflow: hidden;
    margin: 16px 0;
}
.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary);
    transition: width 1s ease-out;
}
.summary-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 1.5rem;
}

.summary-details > div {
    display: flex;
    flex-direction: column; /* 세로 배치로 변경 (라벨 아래 값) */
    align-items: center;
    gap: 6px;
}

.summary-details > div span {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 500;
}

.summary-details > div strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.badge {
    background: var(--safe);
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Category Grid */
.category-section h3 { margin-bottom: 16px; font-size: 1.1rem; }
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.cat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 16px;
}

.cat-card .header { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 10px; }
.cat-card .amount { font-weight: 700; font-size: 1.1rem; }
.cat-card .progress { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.05); margin-top: 10px; overflow: hidden;}
.cat-card .bar { height: 100%; background: var(--primary); width: 0; transition: width 0.8s ease; }

/* Bottom Section */
.bottom-section { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.chart-container { height: 180px; }

.history-box ul { list-style: none; }
.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.history-item .amt { font-weight: 700; color: var(--expense); }

@media (max-width: 600px) {
    body { padding: 12px; }
    .glass-container { padding: 16px; border-radius: 20px; }
    
    header { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 12px; 
    }
    .logo { text-align: center; }
    .month-selector { justify-content: center; width: 100%; }

    .mega-summary { padding: 16px; border-radius: 20px; }
    .mega-summary h1 { font-size: 2.2rem; }
    
    .bottom-section { grid-template-columns: 1fr; gap: 20px; }
    .category-grid { grid-template-columns: 1fr; gap: 10px; }
}
