/* ==========================================
   クリーン＆ミニマル (iOS / Material Design風)
   ========================================== */

/* 1. カラー変数（デザインの設計図） */
:root {
    --bg-color: #F2F2F7;       /* 画面全体の背景（薄いグレー） */
    --card-bg: #FFFFFF;        /* カードの背景（純白） */
    --text-main: #1C1C1E;      /* メインテキスト（濃いグレー） */
    --text-muted: #8E8E93;     /* サブテキスト（薄いグレー） */
    --primary: #007AFF;        /* アクセントカラー（青） */
    --income: #34C759;         /* 収入カラー（緑） */
    --expense: #FF3B30;        /* 支出カラー（赤） */
    --border-radius: 16px;     /* 大きめの角丸 */
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.04); /* 極めて薄く広い影 */
}

/* 2. ベースリセットと全体のフォント設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    -webkit-font-smoothing: antialiased; /* 文字の輪郭を滑らかに */
}

/* アプリ全体の幅をスマホライクに制限 */
.container {
    max-width: 500px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* 3. カードデザインの共通設定 */
.summary-card, .chart-card, .form-card, .list-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

/* 4. カレンダー（月選択）の美装 */
#month-selector {
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    appearance: none; /* デフォルトの矢印を消す */
}

/* 5. サマリー（合計金額）エリア */
.summary-card {
    display: flex;
    justify-content: space-between;
    text-align: center;
}

.summary-item {
    flex: 1;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: 700;
}

#total-income { color: var(--income); }
#total-expense { color: var(--expense); }

/* 6. 入力フォームの美装 */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input[type="date"], input[type="number"], input[type="text"], select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #E5E5EA;
    background-color: #FAFAFC;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

/* フォーカス時のハイライト */
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

button[type="submit"] {
    width: 100%;
    padding: 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s;
}

button[type="submit"]:hover {
    opacity: 0.85;
}

/* 7. 履歴リストとバッジデザイン */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

ul {
    list-style: none;
}

li {
    padding: 16px 0;
    border-bottom: 1px solid #F2F2F7;
}

li:last-child {
    border-bottom: none;
}

.action-btn {
    background-color: #F2F2F7;
    color: var(--text-main);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.action-btn:hover {
    background-color: #E5E5EA;
}