:root {
    --primary-color: #10b981;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 1100px;
    width: 100%;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 30px;
}

.header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 { margin: 0; font-size: 24px; }

.filter-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    gap: 10px;
    background-color: #f9fafb;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.filter-section input[type="date"],
.filter-section select {
    padding: 8px; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    font-family: inherit;
    font-size: 14px;
    background-color: white;
    outline: none;
    color: var(--text-main);
}

button.primary-btn {
    background-color: var(--primary-color); color: white; border: none; padding: 9px 16px;
    border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
button.primary-btn:hover { background-color: #059669; }

button.edit-btn {
    background-color: #f3f4f6; color: #374151; border: 1px solid #d1d5db; padding: 6px 12px;
    border-radius: 6px; font-size: 13px; cursor: pointer; transition: 0.2s;
}
button.edit-btn:hover { background-color: #e5e7eb; }

button.delete-btn {
    background-color: #fee2e2; color: #ef4444; border: 1px solid #fca5a5; padding: 6px 12px;
    border-radius: 6px; font-size: 13px; cursor: pointer; transition: 0.2s; margin-left: 4px;
}
button.delete-btn:hover { background-color: #fecaca; }

.summary-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 40px; display: none; 
}

.summary-box { background-color: #f9fafb; padding: 20px; border-radius: 12px; border: 1px solid var(--border-color); }
.summary-box h3 { margin-top: 0; margin-bottom: 15px; font-size: 15px; color: var(--text-muted); border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.total-big { font-size: 28px; font-weight: 700; color: var(--primary-color); margin: 0; text-align: right; }

.summary-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.summary-table td { padding: 8px 0; border-bottom: 1px dashed #e5e7eb; }
.summary-table td:last-child { text-align: right; font-weight: 600; color: #374151; }
.summary-table tr:last-child td { border-bottom: none; }

table.main-table { width: 100%; border-collapse: collapse; text-align: left; }
.main-table th, .main-table td { padding: 16px 12px; border-bottom: 1px solid var(--border-color); }
.main-table th { background-color: #f9fafb; font-weight: 600; color: var(--text-muted); font-size: 14px; }
.main-table td { font-size: 15px; }
.amount { font-weight: 600; color: var(--primary-color); text-align: right; }
.tag { background-color: #e5e7eb; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }

#loading { text-align: center; padding: 40px; color: var(--text-muted); }

.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); justify-content: center; align-items: center; z-index: 1000;
}
.modal {
    background-color: white; padding: 30px; border-radius: 16px; width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.modal h2 { margin-top: 0; margin-bottom: 20px; font-size: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; color: #374151; }
.form-group input, .form-group select {
    width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px;
    box-sizing: border-box; font-family: inherit; font-size: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.cancel-btn { background-color: white; border: 1px solid #d1d5db; padding: 9px 16px; border-radius: 6px; cursor: pointer; }

/* --- 아래부터 새로 추가하는 네비게이션 및 차트 스타일 --- */
.top-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}
.top-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 8px;
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
    transition: 0.2s;
}
.top-nav a:hover {
    background-color: #e5e7eb;
}
.top-nav a.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.chart-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.chart-box {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}