/* リセットと基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3B82F6;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --dark-color: #1F2937;
    --light-gray: #F3F4F6;
    --medium-gray: #9CA3AF;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ヘッダー */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-member {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* メインコンテンツ */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 80px);
}

/* タブナビゲーション */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    color: var(--medium-gray);
}

.tab-btn:hover {
    background: var(--light-gray);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* タブコンテンツ */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* セクションヘッダー */
.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.subtitle {
    color: var(--medium-gray);
    font-size: 1rem;
}

/* タスクグリッド */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.task-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.task-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.task-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.task-details {
    display: flex;
    justify-content: space-between;
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.task-price {
    background: var(--gradient-success);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    font-size: 1rem;
}

/* ダッシュボード */
.dashboard-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.selector-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    color: var(--medium-gray);
}

.selector-btn:hover {
    background: var(--light-gray);
}

.selector-btn.active {
    background: var(--primary-color);
    color: white;
}

.dashboard-view {
    display: none;
}

.dashboard-view.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* 統計カード */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card.highlight {
    background: var(--gradient-success);
    color: white;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* チャートセクション */
.chart-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.chart-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* タスク履歴 */
.task-history {
    max-height: 400px;
    overflow-y: auto;
}

.task-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.task-history-item:hover {
    background: var(--light-gray);
}

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

.task-history-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-history-icon {
    font-size: 2rem;
}

.task-history-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.task-history-meta {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.task-history-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
}

/* 月間統計 */
.month-stats {
    display: grid;
    gap: 16px;
}

.month-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

.month-stat-item.highlight {
    background: var(--gradient-success);
    color: white;
}

.month-stat-item.info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.month-stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.month-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* メンバー貢献度 */
.member-contribution {
    display: grid;
    gap: 16px;
}

.member-contribution-item {
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

.member-contribution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.member-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.member-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--success-color);
}

.contribution-bar {
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.contribution-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* MVP表示 */
.mvp-display {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 12px;
    color: white;
}

.mvp-crown {
    font-size: 4rem;
    margin-bottom: 16px;
}

.mvp-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.mvp-stats {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 設定セクション */
.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.settings-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.settings-card h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.settings-description {
    color: var(--medium-gray);
    margin-bottom: 20px;
}

/* 価格設定リスト */
.price-settings-list {
    display: grid;
    gap: 16px;
}

.price-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

.price-setting-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-setting-icon {
    font-size: 2rem;
}

.price-setting-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.price-setting-category {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.price-setting-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-setting-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
}

.btn-edit {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-edit:hover {
    background: #2563EB;
    transform: scale(1.05);
}

/* 価格履歴リスト */
.price-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.price-history-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.price-history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.price-history-task {
    font-weight: 600;
}

.price-history-date {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.price-history-change {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.price-history-reason {
    font-size: 0.9rem;
    color: var(--medium-gray);
    font-style: italic;
}

.price-history-changer {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.empty-message {
    text-align: center;
    color: var(--medium-gray);
    padding: 32px;
}

/* メンバーリスト */
.members-list {
    display: grid;
    gap: 16px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

.member-role {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.admin-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--medium-gray);
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--dark-color);
}

.modal-body {
    padding: 24px;
}

/* メンバー選択リスト */
.member-select-list {
    display: grid;
    gap: 12px;
}

.member-select-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.member-select-btn:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

/* タスク記録モーダル */
.task-record-info {
    text-align: center;
    margin-bottom: 24px;
}

.task-record-icon {
    font-size: 5rem;
    margin-bottom: 16px;
}

.task-record-info h4 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.task-record-price {
    color: var(--medium-gray);
    font-size: 1.1rem;
}

.task-record-price span {
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.3rem;
}

.calculated-value {
    text-align: center;
    padding: 16px;
    background: var(--gradient-success);
    color: white;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 1.1rem;
}

.calculated-value strong {
    display: block;
    font-size: 2rem;
    margin-top: 8px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-static-text {
    padding: 12px;
    background: var(--light-gray);
    border-radius: 8px;
    font-size: 1rem;
}

/* ボタン */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

/* 今日のタスク */
.today-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.summary-card.completed-count {
    background: var(--gradient-success);
    color: white;
}

.summary-card.pending-count {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.summary-card.total-value {
    background: var(--gradient-primary);
    color: white;
}

.summary-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.today-tasks-list {
    display: grid;
    gap: 16px;
}

.today-task-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.today-task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.today-task-item.completed {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border-left: 4px solid var(--success-color);
}

.today-task-item.pending {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border-left: 4px solid var(--warning-color);
}

.today-task-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.today-task-icon {
    font-size: 2.5rem;
}

.today-task-info {
    flex: 1;
}

.today-task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.today-task-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.today-task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.today-task-status.completed {
    background: var(--success-color);
    color: white;
}

.today-task-status.pending {
    background: var(--warning-color);
    color: white;
}

.today-task-meta {
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.today-task-frequency {
    display: inline-block;
    margin-left: 12px;
    padding: 2px 8px;
    background: var(--light-gray);
    border-radius: 8px;
    font-size: 0.85rem;
}

.today-task-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.today-task-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--success-color);
}

.today-task-action {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.today-task-action:hover {
    background: #2563EB;
    transform: scale(1.05);
}

.today-task-action.completed-btn {
    background: var(--success-color);
    cursor: default;
}

.today-task-action.completed-btn:hover {
    background: var(--success-color);
    transform: none;
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--medium-gray);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .task-grid {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .today-summary {
        grid-template-columns: 1fr;
    }

    .today-task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .today-task-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .modal-content {
        margin: 20px;
    }

    .member-contribution-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* レポート */
.report-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.report-view {
    display: none;
}

.report-view.active {
    display: block;
    animation: fadeIn 0.3s;
}

.report-period-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.period-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.period-nav-btn:hover {
    background: #2563EB;
    transform: scale(1.1);
}

.report-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.report-card.highlight {
    background: var(--gradient-success);
    color: white;
}

.report-card-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.report-card-content {
    flex: 1;
}

.report-card-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.report-card-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.report-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.report-section h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.member-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.member-stat-card {
    padding: 20px;
    background: var(--light-gray);
    border-radius: 12px;
    transition: all 0.3s;
}

.member-stat-card:hover {
    background: #E5E7EB;
    transform: translateY(-2px);
}

.member-stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.member-stat-details {
    display: grid;
    gap: 8px;
}

.stat-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.stat-detail-label {
    color: var(--medium-gray);
}

.stat-detail-value {
    font-weight: 600;
    color: var(--dark-color);
}

.task-stats-list {
    display: grid;
    gap: 12px;
}

.task-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
    transition: all 0.3s;
}

.task-stat-item:hover {
    background: #E5E7EB;
}

.task-stat-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-stat-icon {
    font-size: 2rem;
}

.task-stat-name {
    font-weight: 600;
}

.task-stat-count {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.task-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
}

.monthly-trend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.month-trend-item {
    padding: 16px 12px;
    background: var(--light-gray);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.month-trend-item:hover {
    background: var(--gradient-success);
    color: white;
    transform: translateY(-3px);
}

.month-trend-label {
    font-size: 0.85rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.month-trend-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.yearly-mvp-display {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 12px;
    color: white;
}

/* 履歴タブ */
.history-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-color);
}

.btn-filter {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    grid-column: span 1;
}

.btn-filter:hover {
    background: #2563EB;
    transform: translateY(-2px);
}

.btn-filter-reset {
    padding: 12px 24px;
    background: var(--medium-gray);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-filter-reset:hover {
    background: #6B7280;
    transform: translateY(-2px);
}

.history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.summary-item.highlight {
    background: var(--gradient-success);
    color: white;
}

.summary-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

.summary-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.history-list {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.history-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s;
    align-items: center;
}

.history-item:hover {
    background: var(--light-gray);
}

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

.history-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.history-task-icon {
    font-size: 2.5rem;
}

.history-datetime {
    font-size: 0.75rem;
    color: var(--medium-gray);
    text-align: center;
}

.history-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-task-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
}

.history-member-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.history-member-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
}

.history-meta-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.history-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-value-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.history-value-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.history-value-small {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.history-recorded-time {
    font-size: 0.8rem;
    color: var(--medium-gray);
    font-style: italic;
}

/* タスク追加 */
.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.btn-add-task {
    padding: 10px 20px;
    background: var(--gradient-success);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-add-task:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.icon-input {
    font-size: 2rem;
    text-align: center;
    cursor: pointer;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: var(--light-gray);
    border-radius: 8px;
}

.icon-option {
    font-size: 2rem;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.icon-option:hover {
    background: white;
    transform: scale(1.2);
}

.icon-option.selected {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .task-grid {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .today-summary {
        grid-template-columns: 1fr;
    }

    .today-task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .today-task-right {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .modal-content {
        margin: 20px;
    }

    .member-contribution-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .report-summary-cards {
        grid-template-columns: 1fr;
    }

    .member-stats-grid {
        grid-template-columns: 1fr;
    }

    .monthly-trend {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .history-filters {
        grid-template-columns: 1fr;
    }

    .history-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .history-value-info {
        align-items: flex-start;
    }

    .history-summary {
        grid-template-columns: 1fr;
    }
}

/* マニュアル機能 */
.modal-large .modal-content {
    max-width: 800px;
}

.manual-settings-list {
    display: grid;
    gap: 12px;
}

.manual-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

.manual-setting-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.manual-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.manual-status.completed {
    background: var(--success-color);
    color: white;
}

.manual-status.empty {
    background: var(--medium-gray);
    color: white;
}

.btn-manual {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-manual:hover {
    background: #2563EB;
    transform: scale(1.05);
}

.manual-view-content {
    padding: 20px 0;
}

.manual-section {
    margin-bottom: 32px;
}

.manual-section h4 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.manual-text {
    line-height: 1.8;
    color: var(--dark-color);
    white-space: pre-wrap;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

.manual-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.manual-step {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step-content {
    flex: 1;
    line-height: 1.6;
}

.manual-notes {
    padding: 16px;
    background: #FFF3CD;
    border-left: 4px solid #FFC107;
    border-radius: 8px;
    color: #856404;
    line-height: 1.6;
}

.manual-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.manual-photo-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.manual-photo-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.manual-photo-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* フィードバック機能 */
.feedback-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.feedback-item {
    padding: 20px;
    background: var(--light-gray);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
}

.feedback-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.feedback-member {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.feedback-category {
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
}

.feedback-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.feedback-rating .star {
    font-size: 1.2rem;
}

.feedback-content {
    color: var(--dark-color);
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.feedback-time {
    color: var(--medium-gray);
    font-size: 0.85rem;
    text-align: right;
}

.rating-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.rating-input .star {
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s;
}

.rating-input .star:hover,
.rating-input .star.active {
    opacity: 1;
    transform: scale(1.2);
}

.rating-hint {
    color: var(--medium-gray);
    font-size: 0.85rem;
    margin-top: 4px;
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.textarea-hint {
    color: var(--medium-gray);
    font-size: 0.85rem;
    margin-top: 4px;
}

#feedbackListSection {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.manual-photo-desc {
    padding: 12px;
    background: white;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* マニュアル編集 */
.manual-steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.manual-step-input {
    display: flex;
    gap: 12px;
    align-items: center;
}

.manual-step-input .step-number {
    flex-shrink: 0;
}

.manual-step-input input {
    flex: 1;
}

.btn-remove-step {
    padding: 8px 12px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.photo-upload-area {
    text-align: center;
    padding: 32px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--light-gray);
    margin-bottom: 20px;
}

.btn-upload {
    padding: 12px 24px;
    background: var(--gradient-success);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.photo-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.photo-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.photo-preview-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.photo-preview-desc {
    padding: 12px;
    background: white;
}

.photo-preview-desc textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    font-size: 0.85rem;
    resize: vertical;
}

.btn-remove-photo {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.empty-manual {
    text-align: center;
    padding: 40px;
    color: var(--medium-gray);
}

.task-manual-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
}

.task-manual-btn:hover {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .task-card {
        padding: 20px;
    }

    .task-icon {
        font-size: 2.5rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .month-stat-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
