/* レポート詳細画面専用スタイル */

.report-detail-container {
    padding: 24px;
    max-width: none;
    margin: 0;
}

/* ページヘッダー */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.back-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.back-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
}

.back-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #374151;
}

.report-title-section {
    display: flex;
    flex-direction: column;
}

.report-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-id {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 16px;
    color: #6b7280;
    font-weight: 500;
}

.report-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    color: #374151;
}

.action-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.edit-btn:hover {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #3b82f6;
}

.pdf-btn:hover {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.delete-btn:hover {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.status-btn:hover {
    background-color: #f0f9ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ステータスセクション */
.status-section {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.status-badge.approved {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-description {
    font-size: 14px;
    color: #374151;
    margin: 0;
}

.approval-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.approver {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}



/* レポートコンテンツ */
.report-content {
    display: flex;
    gap: 32px;
    position: relative;
}

/* メインコンテンツエリア */
.main-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-right: 320px;
    /* 固定コメント欄の幅分余白を作る */
    padding-right: 24px;
    /* 追加の余白 */
}

/* レポートサマリー */
.report-summary {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.report-summary h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.report-period {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

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

.kpi-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.kpi-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.kpi-change {
    font-size: 12px;
    color: #6b7280;
}

.summary-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.summary-text p {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

/* 固定コメントセクション */
.fixed-comments-section {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: #fafbfc;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    flex-shrink: 0;
}

.comments-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.comment-count {
    font-size: 14px;
    color: #6b7280;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
    flex: 1;
    overflow-y: auto;
    background: white;
}

.comment-item {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.comment-time {
    font-size: 12px;
    color: #6b7280;
}

.comment-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

/* システムメッセージスタイル */
.system-comment {
    background-color: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
}

.system-comment .comment-content {
    margin-left: 8px;
}

.system-avatar {
    background-color: #3b82f6;
    color: white;
}

.system-avatar.approved {
    background-color: #10b981;
}

.system-avatar.rejected {
    background-color: #ef4444;
}

.system-avatar.created {
    background-color: #8b5cf6;
}

.system-avatar.edited {
    background-color: #f59e0b;
}

.system-avatar.exported {
    background-color: #6b7280;
}

.system-comment .comment-author {
    color: #1e40af;
    font-weight: 600;
}

.system-comment .comment-text {
    color: #1e40af;
    font-weight: 500;
}

.comment-input-section {
    padding: 16px 20px 20px 20px;
    border-top: 1px solid #e2e8f0;
    background: white;
    flex-shrink: 0;
}

.comment-input {
    width: 100%;
    min-height: 60px;
    max-height: 100px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 12px;
}

.comment-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* コメントアクションエリア */
.comment-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-submit-actions {
    display: flex;
    justify-content: flex-end;
}

.submit-comment-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.submit-comment-btn:hover {
    background-color: #2563eb;
}

/* 承認・差し戻しボタンエリア */
.approval-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.approve-btn {
    flex: 1;
    background-color: #10b981;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.approve-btn:hover {
    background-color: #059669;
}

.reject-btn {
    flex: 1;
    background: white;
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.reject-btn:hover {
    background-color: #fef2f2;
}

/* チャートセクション */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.chart-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

/* 棒グラフ */
.chart-placeholder {
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-bars {
    display: flex;
    align-items: end;
    justify-content: space-between;
    height: 160px;
    padding: 0 8px;
}

.chart-month {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    margin: 0 4px;
}

.bar-container {
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    gap: 2px;
    width: 100%;
    max-width: 40px;
}

.bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
}

.bar.revenue {
    background-color: #3b82f6;
}

.bar.expense {
    background-color: #e5e7eb;
}

.month-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.revenue {
    background-color: #3b82f6;
}

.legend-color.expense {
    background-color: #e5e7eb;
}

/* 円グラフ */
.pie-chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    height: 200px;
}

.pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#1f2937 0% 40%,
            #374151 40% 65%,
            #4b5563 65% 85%,
            #6b7280 85% 100%);
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 詳細データテーブル */
.detail-data-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.detail-data-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.data-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background-color: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.positive {
    color: #10b981;
    font-weight: 500;
}

.negative {
    color: #ef4444;
    font-weight: 500;
}

/* レスポンシブデザイン */
@media (max-width: 1400px) {
    .main-content-area {
        margin-right: 280px;
    }

    .fixed-comments-section {
        width: 280px;
    }
}

@media (max-width: 1200px) {
    .report-content {
        flex-direction: column;
    }

    .main-content-area {
        margin-right: 0;
        padding-right: 0;
    }

    .fixed-comments-section {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        height: 400px;
        margin-top: 24px;
        background: white;
        border-left: none;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .pie-chart-placeholder {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .detail-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .back-section {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .status-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

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

    .chart-bars {
        padding: 0 4px;
    }

    .bar-container {
        max-width: 24px;
    }

    .month-label {
        font-size: 10px;
    }

    .fixed-comments-section {
        height: 350px;
    }

    .approval-actions {
        flex-direction: column;
        gap: 8px;
    }

    .approve-btn,
    .reject-btn {
        flex: none;
    }
}