#timesheetPage {
    --project-label-max-width: 70px;
}

@media screen and (min-width: 1400px) {
    #timesheetPage {
        --project-label-max-width: 120px;
    }
}

@media screen and (min-width: 1800px) {
    #timesheetPage {
        --project-label-max-width: 150px;
    }
}
/* 工时填报页面样式 */
#timesheetPage {
    min-height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 响应式高度调整 - 小屏幕优化 */
@media screen and (max-height: 900px) {
    #timesheetPage {
        padding: 8px;
        max-height: calc(100vh - 10px);
    }
    
    .timesheet-layout {
        gap: 12px;
    }
    
    .calendar-container,
    .stats-sidebar {
        padding: 12px;
    }
    
    .calendar-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .calendar-title {
        font-size: 16px;
    }
    
    .header-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .header-buttons .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .holiday-sync-info {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .calendar th,
    .calendar td {
        padding: 6px;
        min-height: 60px;
    }
    
    .calendar th {
        height: 40px;
        font-size: 12px;
        padding: 4px;
    }
    
    .calendar-date {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .stats-sidebar h3 {
        margin-bottom: 15px;
        font-size: 16px;
    }
    
    .stats-card {
        padding: 12px;
    }
    
    .stats-number {
        font-size: 24px;
    }
    
    .stats-trend {
        font-size: 11px;
    }
}

@media screen and (min-height: 1200px) {
    #timesheetPage {
        height: calc(100vh - 60px);
        min-height: calc(100vh - 60px);
        padding: 30px;
    }
}

@media screen and (min-height: 1440px) {
    #timesheetPage {
        height: calc(100vh - 80px);
        min-height: calc(100vh - 80px);
        padding: 40px;
    }
}

.timesheet-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 小屏幕：侧边栏更窄 */
@media screen and (max-height: 900px) {
    .timesheet-layout {
        grid-template-columns: 170px 1fr;
        gap: 12px;
    }
}

.stats-sidebar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.stats-sidebar h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.month-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #e1e5e9;
}

.month-nav {
    background: white;
    border: 1px solid #e1e5e9;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #4A90E2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.month-nav:hover {
    background: #4A90E2;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.current-month {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.stats-grid {
    display: grid;
    gap: 16px;
    flex: 1;
    grid-template-rows: repeat(4, 1fr);
}

.stats-card {
    background: white;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stats-card h4 {
    color: #666;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stats-unit {
    font-size: 14px;
    color: #999;
    font-weight: normal;
}

.stats-trend {
    font-size: 12px;
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

/* Calendar */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e5e9;
    position: relative;
}

.calendar-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    justify-content: flex-end;
}

.holiday-sync-info {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.calendar {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex: 1;
    min-height: 0;
    table-layout: fixed;
}

.calendar th,
.calendar td {
    width: 14.28%;
    text-align: center;
    vertical-align: top;
    border: 1px solid #f0f0f0;
    position: relative;
    padding: 8px 4px;
    min-height: 70px;
    height: auto;
}

.calendar th {
    background: #f5f5f5;
    font-weight: 600;
    color: #666;
    height: 50px;
    vertical-align: middle;
    font-size: 14px;
}

.calendar td {
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.calendar td:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e3f2fd 100%);
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.calendar-date {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

.calendar-date.holiday {
    color: #e53935;
}

.calendar td.holiday-cell {
    background: #ffeef0 !important;
}

.calendar td.holiday-cell:hover {
    background: #ffd6dc !important;
}

.calendar td.holiday-cell.today {
    background: #ffb3ba !important;
}

.calendar td.holiday-cell.today:hover {
    background: #ff9ca5 !important;
}

.calendar-status {
    display: block;
    padding-left: 12px;
}

/* 每个报工记录项 */
.report-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 4px;
    row-gap: 2px;
    margin-bottom: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.status-completed {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.status-approved {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.status-partial {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.status-pending {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.status-rejected {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

/* 请假（蓝色） */
.status-leave {
    background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 100%);
}

/* 项目名称标签 */
.project-label {
    font-size: 10px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
    max-width: var(--project-label-max-width, 70px);
    display: inline-block;
    word-break: break-word;
    white-space: normal;
    text-align: left;
    margin-left: 2px;
    cursor: help;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 报工记录操作区域 */
.report-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.report-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    min-width: 60px;
}

.report-actions .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.report-actions .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* 状态标签样式 */
.status-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 50px;
}

.status-label.status-pending {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
}

.status-label.status-approved {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.status-label.status-rejected {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
}

.status-label.status-leave {
    background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 100%);
    color: white;
}

/* 兼容不带前缀的状态类名（例如: pending/approved/rejected/leave） */
.status-label.pending { background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%); color: white; }
.status-label.approved { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; }
.status-label.rejected { background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%); color: white; }
.status-label.leave { background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 100%); color: white; }

.status-label.unknown {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.today {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #4A90E2;
    font-weight: bold;
}

/* 右上角“今”徽标 */
.today .today-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #4A90E2;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(74,144,226,0.4);
}

.other-month {
    color: #ccc;
    background: #fafafa;
}

/* 工时填报模态框横向布局样式 */
.timesheet-modal-content {
    max-width: 900px !important;
    padding: 20px !important;
}

.timesheet-form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row-horizontal {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-group-horizontal {
    flex: 1;
    min-width: 0;
}

.form-group-horizontal-full {
    width: 100%;
}

.form-control-small {
    padding: 8px 12px !important;
    font-size: 13px !important;
}

.form-textarea-compact {
    min-height: 80px !important;
    resize: vertical;
}

.timesheet-form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* 工时行样式 */
.timesheet-row {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #f8f9fa;
    position: relative;
}

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

.timesheet-row-title {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

.timesheet-row-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.timesheet-row-remove:hover {
    background: #c82333;
}

.btn-small {
    padding: 8px 16px !important;
    font-size: 13px !important;
}

/* Project List */
.project-search {
    position: relative;
    margin-bottom: 12px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
}

.search-input {
    padding-left: 36px !important;
}

.project-list-compact {
    max-height: 160px !important;
    overflow-y: auto;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
}

.project-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.project-item:hover {
    background: #f8f9fa;
}

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

.project-item.selected {
    background: #e3f2fd;
    border-left: 4px solid #4A90E2;
}

.project-code {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    font-size: 13px;
}

.project-name {
    color: #666;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .timesheet-layout {
        grid-template-columns: 1fr;
    }
}

/* 工时详情查看模态框样式 */
.timesheet-detail-content {
    padding: 20px;
}

.detail-actions-top {
    margin-bottom: 15px;
    width: 100%;
}

.detail-actions-top .btn {
    width: 100%;
}

.detail-date-info {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 编辑提示样式 */
.edit-hint {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #4A90E2;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1976d2;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.1);
}

.edit-hint .hint-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.edit-hint .hint-text {
    flex: 1;
    line-height: 1.5;
}

.edit-hint .hint-text strong {
    color: #1565c0;
    font-weight: 600;
}

.detail-date-label {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0;
    white-space: nowrap;
}

.detail-date-value {
    font-size: 15px;
    font-weight: 600;
}

.detail-reports-list {
    margin-bottom: 25px;
}

.report-detail-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.report-detail-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.report-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.report-project-info {
    flex: 1;
}

.report-project-code {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 5px;
}

.report-project-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.report-hours-info {
    text-align: right;
}

.report-hours {
    font-size: 20px;
    font-weight: 600;
    color: #4A90E2;
}

.report-days {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.report-content {
    margin-bottom: 15px;
}

.report-content-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.report-content-text {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    line-height: 1.5;
    color: #333;
}

.report-content-text textarea {
    resize: vertical !important;
    overflow-y: auto !important;
}

.report-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.report-employee {
    display: flex;
    align-items: center;
    gap: 5px;
}

.report-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.empty-reports {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-reports-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-reports-text {
    font-size: 16px;
    margin-bottom: 10px;
}

.empty-reports-hint {
    font-size: 14px;
    color: #999;
}
