/* 家計簿システム CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'ヒラギノ角ゴシック', 'Meiryo', 'メイリオ', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ログインページ */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.logo h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 24px;
}

.login-form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

/* フォーム */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* ボタン */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a67d8;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background-color: #cbd5e0;
}

.btn-full {
    width: 100%;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group .btn {
    flex: 1;
}

/* アラート */
.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fed7d7;
    color: #9b2c2c;
    border: 1px solid #feb2b2;
}

.alert-success {
    background-color: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

/* ダッシュボード */
.dashboard {
    background-color: #f7fafc;
    min-height: 100vh;
}

/* ヘッダーナビ */
.header-nav {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: #edf2f7;
}

/* ダッシュボードセクション */
.dashboard-section {
    background: white;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

/* 収支サマリー */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

.summary-label {
    color: #718096;
    margin-top: 5px;
}

.summary-value.positive {
    color: #38a169;
}

.summary-value.negative {
    color: #e53e3e;
}

/* チャート */
.chart-container {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

/* 履歴テーブル */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.history-table th,
.history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.history-table th {
    background-color: #f7fafc;
    font-weight: bold;
    color: #4a5568;
}

.history-table tr:hover {
    background-color: #f7fafc;
}

/* 目標グラフ */
.goal-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: #4a5568;
}

/* フッター */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #718096;
    border-top: 1px solid #e2e8f0;
    margin-top: 40px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .history-table {
        font-size: 14px;
    }
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* セットアップページのスタイル */
.setup-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.setup-form-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
}

.setup-description {
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

.setup-step {
    display: none;
}

.setup-step.active {
    display: block;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.checkbox-item:hover {
    background-color: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
}

.setup-features {
    margin: 20px 0;
}

.feature-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
}

.feature-item strong {
    color: #28a745;
    display: block;
    margin-bottom: 5px;
}

.feature-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-success:hover {
    background-color: #218838;
}

/* ログイン画面の新しいスタイル */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

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

.form-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.form-switch a {
    color: #667eea;
    text-decoration: none;
}

.form-switch a:hover {
    text-decoration: underline;
}