/* 人事财务管理页面样式 */

/* 主内容区域布局 */
.main-content {
    display: flex;
    min-height: calc(100vh - 70px);
    background: #f5f7fa;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    overflow-y: auto;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-title {
    font-size: 14px;
    font-weight: 600;
    color: #8c8c8c;
    padding: 0 24px 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #595959;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0 20px 20px 0;
    margin-right: 20px;
}

.menu-item a:hover {
    background: #f0f2f5;
    color: #1890ff;
}

.menu-item.active a {
    background: #e6f7ff;
    color: #1890ff;
    font-weight: 500;
}

.menu-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

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

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #262626;
    margin: 0;
}

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

/* 统计卡片 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

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

.stat-title {
    font-size: 14px;
    color: #8c8c8c;
    font-weight: 500;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.stat-icon.blue { background: #1890ff; }
.stat-icon.green { background: #52c41a; }
.stat-icon.orange { background: #fa8c16; }
.stat-icon.red { background: #f5222d; }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #262626;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up {
    color: #52c41a;
}

.stat-change.down {
    color: #f5222d;
}

/* 筛选区域 */
.filter-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #595959;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 表格样式 */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

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

.data-table th {
    background: #fafafa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #595959;
    border-bottom: 1px solid #f0f0f0;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #262626;
}

.data-table tr:hover {
    background: #fafafa;
}

.data-table .status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-badge.inactive {
    background: #fff1f0;
    color: #f5222d;
    border: 1px solid #ffccc7;
}

.status-badge.probation {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

/* 分页 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.pagination-info {
    font-size: 14px;
    color: #595959;
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination button.active {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* 岗位网格 */
.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.position-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

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

.position-name {
    font-size: 18px;
    font-weight: 600;
    color: #262626;
}

.position-level {
    background: #e6f7ff;
    color: #1890ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.position-info {
    margin-bottom: 16px;
}

.position-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.position-info-label {
    color: #8c8c8c;
}

.position-info-value {
    color: #262626;
    font-weight: 500;
}

.position-actions {
    display: flex;
    gap: 8px;
}

/* 考勤日历 */
.attendance-calendar {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

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

.calendar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #262626;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: #595959;
    padding: 12px;
    font-size: 14px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.calendar-day:hover {
    background: #f0f2f5;
}

.calendar-day.present {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.calendar-day.absent {
    background: #fff1f0;
    color: #f5222d;
    border: 1px solid #ffccc7;
}

.calendar-day.late {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

.calendar-day.leave {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

/* 图表容器 */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #262626;
}

.chart-content {
    height: 300px;
    position: relative;
}

/* 设置页面 */
.settings-container {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.settings-category {
    margin-bottom: 32px;
}

.settings-category h3 {
    font-size: 18px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.setting-label {
    font-size: 14px;
    color: #595959;
    font-weight: 500;
}

.setting-control {
    min-width: 200px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1890ff;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 角色网格 */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.role-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

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

.role-name {
    font-size: 18px;
    font-weight: 600;
    color: #262626;
}

.role-type {
    background: #f0f2f5;
    color: #595959;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.role-description {
    font-size: 14px;
    color: #8c8c8c;
    margin-bottom: 16px;
}

.role-permissions {
    margin-bottom: 16px;
}

.permission-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.permission-item i {
    color: #52c41a;
    margin-right: 8px;
    font-size: 12px;
}

.role-actions {
    display: flex;
    gap: 8px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content.large {
    max-width: 800px;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #8c8c8c;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f0f2f5;
    color: #262626;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #f0f0f0;
}

/* 表单样式 */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #595959;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

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

/* 计算步骤 */
.calculation-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #f0f0f0;
    z-index: -1;
}

.step.active .step-number {
    background: #1890ff;
    color: #fff;
}

.step.completed .step-number {
    background: #52c41a;
    color: #fff;
}

.step.completed::after {
    background: #52c41a;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #8c8c8c;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-title {
    font-size: 14px;
    color: #595959;
    text-align: center;
}

.step.active .step-title {
    color: #1890ff;
    font-weight: 500;
}

.step-content {
    min-height: 300px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #f0f0f0;
    color: #595959;
}

.btn-secondary:hover {
    background: #e6e6e6;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-warning {
    background: #faad14;
    color: #fff;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-danger {
    background: #f5222d;
    color: #fff;
}

.btn-danger:hover {
    background: #ff4d4f;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .content-area {
        order: 1;
        padding: 16px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .position-grid,
    .role-grid {
        grid-template-columns: 1fr;
    }
    
    .calculation-steps {
        flex-direction: column;
        gap: 16px;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .main-content {
        background: #141414;
    }
    
    .sidebar {
        background: #1f1f1f;
        border-right-color: #303030;
    }
    
    .menu-item a {
        color: #d9d9d9;
    }
    
    .menu-item a:hover {
        background: #262626;
        color: #40a9ff;
    }
    
    .menu-item.active a {
        background: #111d2c;
        color: #40a9ff;
    }
    
    .stat-card,
    .filter-section,
    .table-container,
    .chart-card,
    .settings-container,
    .position-card,
    .role-card,
    .attendance-calendar {
        background: #1f1f1f;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .stat-card:hover,
    .position-card:hover,
    .role-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
    
    .section-title,
    .stat-value,
    .chart-header h3,
    .settings-category h3,
    .position-name,
    .role-name {
        color: #d9d9d9;
    }
    
    .stat-title,
    .stat-change,
    .filter-group label,
    .data-table th,
    .setting-label,
    .position-info-label,
    .role-description,
    .permission-item {
        color: #8c8c8c;
    }
    
    .data-table td {
        color: #d9d9d9;
        border-bottom-color: #303030;
    }
    
    .data-table th {
        background: #262626;
        color: #d9d9d9;
        border-bottom-color: #303030;
    }
    
    .data-table tr:hover {
        background: #262626;
    }
    
    .form-control {
        background: #262626;
        border-color: #303030;
        color: #d9d9d9;
    }
    
    .form-control:focus {
        border-color: #40a9ff;
        box-shadow: 0 0 0 2px rgba(64, 169, 255, 0.2);
    }
    
    .btn-secondary {
        background: #303030;
        color: #d9d9d9;
    }
    
    .btn-secondary:hover {
        background: #3a3a3a;
    }
    
    .modal-content {
        background: #1f1f1f;
        color: #d9d9d9;
    }
    
    .modal-header {
        border-bottom-color: #303030;
    }
    
    .modal-footer {
        border-top-color: #303030;
    }
    
    .step-number {
        background: #303030;
        color: #8c8c8c;
    }
    
    .step-title {
        color: #8c8c8c;
    }
    
    .calendar-day {
        color: #d9d9d9;
    }
    
    .calendar-day:hover {
        background: #262626;
    }
    
    .status-badge.active {
        background: #162312;
        color: #73d13d;
        border-color: #49aa19;
    }
    
    .status-badge.inactive {
        background: #2a1215;
        color: #ff7875;
        border-color: #ff4d4f;
    }
    
    .status-badge.probation {
        background: #2b2111;
        color: #ffc53d;
        border-color: #faad14;
    }
}