/* 全体のスタイル */
body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ヘッダー */
h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* 検索ヘッダー */
.search-header {
    margin-bottom: 30px;
}

.search-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.search-period {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* テーブルのスタイル */
.table-container {
    margin-bottom: 30px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #4a90e2;
    color: white;
    font-weight: normal;
    white-space: nowrap;
}

td {
    background-color: #fff;
}

tr:nth-child(even) td {
    background-color: #f9f9f9;
}

tr:hover td {
    background-color: #f5f5f5;
}

.amount-column {
    text-align: right;
    white-space: nowrap;
}

/* リンクスタイル */
a {
    color: #4a90e2;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #357abd;
    text-decoration: underline;
}

/* 集計コンテナ */
.summary-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #495057;
    font-weight: 500;
}

.summary-value {
    font-size: 1.1em;
    font-weight: 600;
}

.positive {
    color: #28a745;
}

.negative {
    color: #dc3545;
}

/* フォームセクション */
.form-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #4a90e2;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

select.form-control {
    height: 40px;
}

.date-range {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
}

.period-info {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin: 0;
    line-height: 1.6;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-primary {
    display: inline-block;
    background-color: #4a90e2;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #357abd;
}

/* ボタン */
button,
input[type="submit"] {
    background-color: #4a90e2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover,
input[type="submit"]:hover {
    background-color: #357abd;
}

/* エラーメッセージ */
.error {
    color: #e74c3c;
    background-color: #fde8e7;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 成功メッセージ */
.success {
    color: #27ae60;
    background-color: #e8f5e9;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 戻るボタン */
.back-button {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: #5a6268;
    text-decoration: none;
    color: white;
}

.back-button::before {
    content: "←";
    margin-right: 8px;
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .table-container {
        margin: 0 -15px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 10px;
    }
    
    .summary-container {
        margin: 20px -15px 0;
        border-radius: 0;
    }
    
    .search-header h1 {
        font-size: 20px;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        width: 100%;
    }

    .form-section {
        padding: 15px;
        margin: 0 -15px 20px;
        border-radius: 0;
    }

    .search-form {
        padding: 0 15px;
    }

    .form-control {
        font-size: 16px; /* モバイルでのズームを防ぐ */
    }

    .btn-primary {
        width: 100%;
        padding: 15px;
    }
}
