/* リセット */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 基本設定 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
    background-color: #f0f4f8;
    color: #333;
    min-height: 100vh;
}

/* ===== ナビゲーション ===== */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #4a7fa5;
    color: white;
    padding: 0.75rem 1.5rem;
}

.app-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.25rem;
    color: #333;
}

.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ===== フォーム共通 ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4a7fa5;
    box-shadow: 0 0 0 3px rgba(74, 127, 165, 0.15);
}

/* ===== ボタン ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn-primary {
    background-color: #4a7fa5;
    color: white;
}

.btn-primary:hover {
    background-color: #3a6a8e;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-link {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
}

.nav-link {
    color: white;
    font-size: 0.875rem;
    text-decoration: none;
    opacity: 0.9;
}

.nav-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ===== アラート ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* ===== 登録ページリンク ===== */
.register-link {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
}

.register-link a {
    color: #6366f1;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }
}

/* ===== メインコンテンツ ===== */
.main-content {
    padding: 1.5rem 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

/* ===== お手伝い一覧テーブル ===== */
.chore-table-wrapper {
    overflow-x: auto;
}

.chore-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chore-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e5e7eb;
}

.chore-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    vertical-align: middle;
}

.chore-table tr:last-child td {
    border-bottom: none;
}

.chore-date {
    white-space: nowrap;
    color: #555;
    font-size: 0.875rem;
}

.chore-content {
    color: #333;
}

/* ===== ステータスバッジ ===== */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-unpaid {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-pending {
    background: #fffbeb;
    color: #d97706;
}

.status-approved {
    background: #f0fdf4;
    color: #16a34a;
}

.status-rejected {
    background: #fef2f2;
    color: #dc2626;
}

/* ===== ボタン追加スタイル ===== */
.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

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

/* ===== 登録フォームカード ===== */
.form-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ===== 一括登録テーブル ===== */
.bulk-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.bulk-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.bulk-table td {
    padding: 0.375rem 0.5rem;
}

.bulk-table .col-date {
    width: 160px;
}

.bulk-actions {
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.field-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ===== 空の状態 ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* ===== 登録完了アニメーション ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-12px); }
}

.registered-banner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    text-align: center;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    animation: fadeIn 0.4s ease;
    box-shadow: 0 2px 8px rgba(251,191,36,0.35);
}

.registered-icon {
    margin: 0 0.25rem;
}

/* ===== 申請完了バナー ===== */
.applied-banner {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    color: white;
    text-align: center;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    animation: fadeIn 0.4s ease;
    box-shadow: 0 2px 8px rgba(124,58,237,0.35);
}

/* ===== ページヘッダーアクション ===== */
.page-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ===== 申請フォーム ===== */
.request-hint {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.request-chore-list {
    margin-bottom: 1.5rem;
}

.request-chore-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.625rem 0;
}

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

.chore-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.chore-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: #4a7fa5;
    cursor: pointer;
    flex-shrink: 0;
}

.chore-checkbox-date {
    font-weight: 600;
    color: #4a7fa5;
    min-width: 4rem;
    font-size: 0.9rem;
}

.chore-checkbox-content {
    color: #333;
    font-size: 0.95rem;
}

/* ===== 金額プレビュー ===== */
.amount-preview {
    background: #f0f4f8;
    border: 2px solid #4a7fa5;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.amount-label {
    font-size: 1rem;
    font-weight: 600;
    color: #4a7fa5;
}

.amount-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d6a4f;
}

.amount-value #previewAmount {
    font-size: 1.75rem;
}

/* ===== 承認画面 ===== */
.approval-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.approval-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.approval-table th {
    background: #4a7fa5;
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.approval-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.approval-table tr:last-child td {
    border-bottom: none;
}

.approval-table tr:hover td {
    background: #f8fafc;
}

.amount-cell {
    font-weight: 600;
}

.amount-text {
    color: #2d6a4f;
}

/* ===== 承認・却下バナー ===== */
.approval-success-banner {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    color: white;
    text-align: center;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(5,150,105,0.35);
}

.approval-reject-banner {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    color: white;
    text-align: center;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220,38,38,0.35);
}

/* ===== 申請詳細 ===== */
.approval-detail-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.detail-list {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.5rem 1rem;
}

.detail-list dt {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.detail-list dd {
    padding: 0.25rem 0;
    font-size: 0.95rem;
}

.detail-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d6a4f;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
}

/* ===== 承認・却下アクション ===== */
.approval-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.approve-form {
    display: flex;
    align-items: flex-start;
}

.btn-approve {
    background: #059669;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-approve:hover {
    background: #047857;
}

.rejection-form {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.btn-reject {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: background 0.2s;
}

.btn-reject:hover {
    background: #b91c1c;
}

/* ===== アラート ===== */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ===== ユーザー登録フォーム ===== */
.required {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.4rem;
}

.optional {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.4rem;
}

/* ===== レスポンシブ（小画面） ===== */
@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .form-actions {
        flex-direction: column;
    }
}
