/* アプリ全体で使う色を定義（後で変更しやすいように） */
:root {
    --primary-color: #4CAF50;
    --income-color: #2196F3;
    --expense-color: #F44336;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
}

/* 全体の余白をリセット */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 画面の中央に配置し、最大幅をスマホサイズ程度に制限 */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

header h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* カード型の白い背景のデザイン */
.summary-card, .form-card, .list-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* サマリー（集計）部分のレイアウト */
.summary-card {
    display: flex;
    justify-content: space-between;
    text-align: center;
}

.summary-item h3 {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
}

.summary-item p {
    font-size: 1.4rem;
    font-weight: bold;
}

.income-text { color: var(--income-color); }
.expense-text { color: var(--expense-color); }

/* 入力フォームのレイアウト */
.form-group {
    margin-bottom: 15px;
}

.row {
    display: flex;
    gap: 10px;
}

.row > * {
    flex: 1; /* 横幅を均等に分ける */
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fafafa;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #43a047;
}

/* 履歴リストのレイアウト */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.list-header h2 {
    font-size: 1.2rem;
}

.action-btn {
    padding: 6px 12px;
    background-color: #607D8B;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.transaction-list {
    list-style: none;
}

.empty-message {
    text-align: center;
    color: #aaa;
    padding: 20px 0;
}

/* グラフエリアのレイアウト */
.chart-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    text-align: center;
}