/* 项目成本看板样式 */

#project-dashboardPage {
    padding: 20px;
    background: #f5f7fa;
}

#project-dashboardPage .page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e1e5e9;
}

#project-dashboardPage .page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 筛选区域 */
.dashboard-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
}

.dashboard-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 让时间范围这一组占满行，便于右侧放置导出按钮 */
.dashboard-filters .filter-group:last-child {
    flex: 1;
}

.dashboard-filters .filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
}

/* 项目多选框样式 */
.project-multiselect-wrapper {
    position: relative;
}

.project-multiselect {
    position: relative;
    min-width: 400px;
    width: 400px;
}

.multiselect-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.multiselect-display:hover {
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.multiselect-display .placeholder {
    color: #666;
    font-size: 14px;
}

.multiselect-display .arrow {
    color: #999;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.multiselect-display.active .arrow {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.multiselect-search {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.multiselect-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.multiselect-search input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.multiselect-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

.multiselect-option {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multiselect-option:hover {
    background: #f5f5f5;
}

.multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.multiselect-option label {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    flex: 1;
}

/* 时间范围选择器 */
.time-range-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    width: 100%;
}

.time-range-btn {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-range-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.time-range-btn.active {
    background: #4A90E2;
    color: white;
    border-color: #4A90E2;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.custom-date-range .date-input {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.custom-date-range .date-input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.time-range-selector .export-btn {
    margin-left: auto;
}

.export-btn {
    margin-left: 12px;
    padding: 10px 16px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.export-btn:hover {
    background: #15803d;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.export-btn:active {
    transform: translateY(1px);
}

.custom-date-range span {
    color: #666;
    font-size: 14px;
}

/* 数字卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-cards .stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-cards .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4A90E2 0%, #50C878 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-cards .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dashboard-cards .stat-card:hover::before {
    opacity: 1;
}

.dashboard-cards .stat-content {
    width: 100%;
    text-align: center;
}

.dashboard-cards .stat-label {
    font-size: 15px;
    color: #666;
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.label-annual {
    color: #e53935;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.dashboard-cards .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* 看板行容器 - 用于左右布局 */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* 看板区块 */
.dashboard-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-section-half {
    margin-bottom: 0;
}

.section-header {
    padding: 18px 24px;
    border-bottom: none;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.3px;
}

.section-content {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 只有表格的section-content，表格紧贴表头 */
.section-content:not(.section-content-split) .table-container {
    padding: 0;
}

/* 左右分割的内容区域 */
.section-content-split {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: stretch;
    padding: 20px;
}

.section-content-split .chart-container-half {
    padding-right: 20px;
}

.section-content-split .table-container-half {
    padding-left: 20px;
}

/* 成本构成新的左右布局（更紧凑且高度一致） */
.cost-section-content {
    gap: 15px;
    align-items: stretch;
    min-height: 760px;
}

.cost-chart-column {
    width: 58%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    margin-bottom: 0;
}

.cost-table-column {
    width: 42%;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    margin: 0;
}

.cost-pie-wrapper {
    height: 360px;
    flex-shrink: 0;
    margin-bottom: 0;
    position: relative;
}

.cost-bar-wrapper {
    height: 360px;
    flex-shrink: 0;
    margin-bottom: 0;
    position: relative;
}

.human-cost-pie-wrapper {
    height: 360px;
    flex-shrink: 0;
    margin-bottom: 0;
    position: relative;
}

/* 饼图canvas样式 */
.cost-pie-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}
.human-cost-pie-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* 人力成本明细样式 */
.human-cost-detail-section {
    margin-top: 20px;
}

.work-report-detail-section .table-container {
    max-height: 360px;
    overflow-y: auto;
}

.work-report-detail-section table th:first-child,
.work-report-detail-section table td:first-child {
    min-width: 90px;
    width: 90px;
}

.human-cost-table-wrapper {
    height: 360px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.human-cost-table-wrapper table {
    margin: 0;
}

.human-cost-table-wrapper thead {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
}

.human-cost-table-wrapper thead th {
    border-bottom: 2px solid #e2e8f0;
}

/* 图表容器 */
.chart-container {
    margin-bottom: 24px;
    position: relative;
    height: 400px;
}

.chart-container canvas {
    max-height: 400px;
}

/* 左右布局中的图表容器 */
.chart-container-half {
    flex: 1;
    margin-bottom: 0;
    height: auto;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container-half canvas {
    max-height: 100%;
    max-width: 100%;
}

/* 左右布局中的表格容器 */
.table-container-half {
    flex: 1;
    margin-top: 0;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
}

.table-container-half .ranking-table {
    width: 100%;
    margin: 0;
    border-spacing: 0;
}

/* 普通表格容器 */
#project-dashboardPage .table-container {
    margin-top: 0;
    padding: 0;
    overflow-x: auto;
}

/* 表格样式 - 参考效能看板样式 */
#project-dashboardPage .ranking-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

#project-dashboardPage .ranking-table thead {
    background: #f1f5f9;
}

#project-dashboardPage .ranking-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.3px;
    border-bottom: none;
    text-transform: uppercase;
    position: relative;
}

#project-dashboardPage .ranking-table th:first-child {
    text-align: center;
}

#project-dashboardPage .ranking-table thead tr:first-child th {
    border-bottom: 1px solid #cbd5e1;
    border-top: none;
}

#project-dashboardPage .ranking-table td {
    padding: 14px 18px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

#project-dashboardPage .ranking-table td:first-child {
    text-align: center;
}

#project-dashboardPage .ranking-table tbody tr:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    transition: background 0.2s ease;
}

#project-dashboardPage .ranking-table tfoot {
    background: #f1f5f9;
}

#project-dashboardPage .ranking-table .total-row {
    font-weight: 700;
}

#project-dashboardPage .ranking-table .total-row td {
    padding: 16px 18px;
    border-top: 2px solid #cbd5e1;
    color: #334155;
    background: #f8fafc;
}

/* 差异显示 */
#project-dashboardPage .ranking-table td.positive {
    color: #e74c3c;
    font-weight: 600;
}

#project-dashboardPage .ranking-table td.negative {
    color: #27ae60;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    
    .cost-section-content {
        height: 600px;
    }
    
    .cost-pie-wrapper {
        height: 290px;
    }
    
    .cost-bar-wrapper {
        height: 290px;
    }
    
    .human-cost-table-wrapper {
        height: 290px;
    }
    
    .cost-chart-column,
    .cost-table-column {
        width: 100%;
    }
    
    .section-content-split {
        flex-direction: column;
    }
    
    .chart-container-half {
        min-height: 300px;
        width: 100%;
    }
    
    .table-container-half {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dashboard-filters .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .project-multiselect {
        min-width: 100%;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .dashboard-cards .stat-card {
        padding: 24px;
    }
    
    .dashboard-cards .stat-value {
        font-size: 28px;
    }
    
    .time-range-selector {
        flex-wrap: wrap;
    }
    
    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        margin-top: 12px;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .cost-section-content {
        height: 500px;
    }
    
    .cost-pie-wrapper {
        height: 240px;
    }
    
    .cost-bar-wrapper {
        height: 240px;
    }
    
    .human-cost-table-wrapper {
        height: 240px;
    }
    
    .chart-container-half {
        min-height: 250px;
    }
    
    .section-content {
        padding: 0;
    }
    
    .section-content-split {
        padding: 16px;
        gap: 0;
    }
    
    .section-content-split .chart-container-half {
        padding-right: 16px;
    }
    
    .section-content-split .table-container-half {
        padding-left: 16px;
    }
    
    #project-dashboardPage .ranking-table {
        font-size: 12px;
    }
    
    #project-dashboardPage .ranking-table th,
    #project-dashboardPage .ranking-table td {
        padding: 10px 12px;
    }
}

/* 可点击的员工姓名样式 */
.clickable-name {
    color: #2563eb;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.clickable-name:hover {
    color: #1d4ed8;
    text-decoration: underline;
    background-color: #f0f9ff;
}

/* 员工报工明细弹窗样式 */
#employeeReportsModal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#employeeReportsModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#employeeReportsModal .modal-body {
    padding: 0;
}

#employeeReportsModal .table-container {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#employeeReportsModal .data-table {
    margin: 0;
}

#employeeReportsModal .data-table thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1;
}

#employeeReportsModal .data-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
}

#employeeReportsModal .data-table td {
    padding: 14px 18px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

/* 任务描述列允许换行 */
#employeeReportsModal .data-table td:nth-child(4) {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 300px; /* 限制最大宽度，避免表格过宽 */
}

#employeeReportsModal .data-table tbody tr:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
}

#employeeReportsModal .modal-footer {
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* 人力成本明细弹窗样式 - 复用居中逻辑 */
#humanCostModal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* 员工项目工时分布弹窗居中样式 */
#employeeProjectModal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

#employeeProjectModal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#humanCostModal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#humanCostModal .modal-body {
    padding: 0;
}

#humanCostModal .table-container {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 12px;
}

#humanCostModal .data-table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
}

#humanCostModal .data-table th {
    background: #f1f5f9;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#humanCostModal .data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
}

#humanCostModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

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

#humanCostModal .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
}

#humanCostModal .close-btn:hover {
    background: #f1f5f9;
    color: #ef4444;
}
