/* 人事管理模块样式 */

/* 容器 */
.hr-container {
    padding: 20px;
}

/* 顶部标签页 */
.hr-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 0;
}

.hr-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hr-tab:hover {
    color: #4a5d3a;
}

.hr-tab.active {
    color: #4a5d3a;
    border-bottom-color: #4a5d3a;
    font-weight: 600;
}

.hr-tab i {
    font-size: 16px;
}

/* 工具栏 */
.hr-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.hr-toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hr-toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hr-search {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    width: 200px;
    font-size: 14px;
}

.hr-search:focus {
    outline: none;
    border-color: #4a5d3a;
    box-shadow: 0 0 0 2px rgba(74, 93, 58, 0.1);
}

.hr-select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.hr-select:focus {
    outline: none;
    border-color: #4a5d3a;
}

/* 视图切换 */
.hr-view-toggle {
    display: flex;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
}

.view-btn {
    padding: 6px 12px;
    background: white;
    border: none;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.view-btn:not(:last-child) {
    border-right: 1px solid #d9d9d9;
}

.view-btn.active {
    background: #4a5d3a;
    color: white;
}

.view-btn i {
    font-size: 16px;
}

/* 员工卡片网格 */
.emp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.emp-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #e8e8e8;
}

.emp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #4a5d3a;
}

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

.emp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5d3a 0%, #6b7d4a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.emp-card-info {
    flex: 1;
    min-width: 0;
}

.emp-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.emp-position {
    font-size: 12px;
    color: #999;
}

.emp-status-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
}

.emp-status-tag.active {
    background: #e6f7e6;
    color: #52c41a;
}

.emp-status-tag.inactive {
    background: #f5f5f5;
    color: #999;
}

.emp-card-body {
    margin-bottom: 12px;
}

.emp-card-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.emp-card-field i {
    color: #4a5d3a;
    font-size: 14px;
}

.emp-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
}

.emp-no {
    color: #999;
}

.emp-type {
    padding: 2px 8px;
    background: #f0f5e6;
    color: #4a5d3a;
    border-radius: 10px;
    font-size: 11px;
}

/* 表格样式 */
.hr-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hr-table thead {
    background: #fafafa;
}

.hr-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    border-bottom: 1px solid #e8e8e8;
}

.hr-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #666;
}

.hr-table tbody tr:hover {
    background: #f9f9f9;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.green {
    background: #52c41a;
}

.status-dot.red {
    background: #ff4d4f;
}

.status-dot.orange {
    background: #faad14;
}

.status-dot.gray {
    background: #d9d9d9;
}

/* 按钮样式 */
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sm:hover {
    border-color: #4a5d3a;
    color: #4a5d3a;
}

.btn-sm.btn-danger {
    color: #ff4d4f;
    border-color: #ffccc7;
}

.btn-sm.btn-danger:hover {
    background: #ff4d4f;
    color: white;
    border-color: #ff4d4f;
}

/* 员工详情 */
.modal-xl {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.emp-detail {
    padding: 0;
}

.emp-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f5e6 0%, #e8f0d8 100%);
    border-radius: 8px;
    margin-bottom: 20px;
}

.emp-detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5d3a 0%, #6b7d4a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    flex-shrink: 0;
}

.emp-detail-info {
    flex: 1;
}

.emp-detail-info h2 {
    margin: 0 0 4px 0;
    font-size: 24px;
    color: #333;
}

.emp-detail-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.emp-no-text {
    color: #999 !important;
    font-size: 13px !important;
    margin-top: 4px !important;
}

.emp-detail-actions {
    display: flex;
    gap: 10px;
}

/* 详情标签页 */
.emp-detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

.emp-detail-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.emp-detail-tab:hover {
    color: #4a5d3a;
}

.emp-detail-tab.active {
    color: #4a5d3a;
    border-bottom-color: #4a5d3a;
    font-weight: 600;
}

/* 信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-group {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
}

.info-group h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.info-row label {
    color: #999;
    min-width: 100px;
}

.info-row span {
    color: #333;
    text-align: right;
}

/* 证书列表 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.cert-list, .contract-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cert-item, .contract-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.cert-icon, .contract-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f0f5e6 0%, #e8f0d8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5d3a;
    font-size: 24px;
    flex-shrink: 0;
}

.cert-info, .contract-info {
    flex: 1;
    min-width: 0;
}

.cert-name, .contract-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.cert-meta, .contract-meta {
    font-size: 12px;
    color: #999;
}

.cert-status, .contract-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
}

.cert-status.green, .contract-status.green {
    background: #e6f7e6;
    color: #52c41a;
}

.cert-status.orange, .contract-status.orange {
    background: #fff7e6;
    color: #faad14;
}

.cert-status.red, .contract-status.red {
    background: #fff1f0;
    color: #ff4d4f;
}

.cert-status.gray, .contract-status.gray {
    background: #f5f5f5;
    color: #999;
}

.cert-actions, .contract-actions {
    display: flex;
    gap: 8px;
}

/* 表单样式 */
.hr-form {
    padding: 0;
}

.form-section {
    margin-bottom: 24px;
}

.form-section h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a5d3a;
    box-shadow: 0 0 0 2px rgba(74, 93, 58, 0.1);
}

.form-group small {
    font-size: 12px;
    color: #999;
}

/* 账号管理面板 */
.account-panel {
    padding: 0;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f5e6 0%, #e8f0d8 100%);
    border-radius: 8px;
    margin-bottom: 20px;
}

.account-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5d3a 0%, #6b7d4a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 0;
}

.account-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #333;
}

.account-info p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.account-tips {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.account-tips h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #ad8b00;
}

.account-tips ul {
    margin: 0;
    padding-left: 20px;
}

.account-tips li {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #999;
}

.stat-card.success {
    border-left: 4px solid #52c41a;
}

.stat-card.warning {
    border-left: 4px solid #faad14;
}

.stat-card.danger {
    border-left: 4px solid #ff4d4f;
}

.stat-card.info {
    border-left: 4px solid #1890ff;
}

.stat-card.caution {
    border-left: 4px solid #fa8c16;
}

/* 预警区域 */
.alert-section {
    background: #fff8e6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.alert-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #ad8b00;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
}

.alert-item.danger {
    border-left: 3px solid #ff4d4f;
}

.alert-item.warning {
    border-left: 3px solid #faad14;
}

.alert-item.info {
    border-left: 3px solid #1890ff;
}

.alert-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.alert-item.danger .alert-badge {
    background: #fff1f0;
    color: #ff4d4f;
}

.alert-item.warning .alert-badge {
    background: #fff7e6;
    color: #faad14;
}

.alert-item.info .alert-badge {
    background: #e6f7ff;
    color: #1890ff;
}

.alert-name {
    font-weight: 600;
    color: #333;
}

.alert-cert {
    color: #666;
    flex: 1;
}

.alert-expire {
    color: #999;
    font-size: 12px;
}

/* 看板 */
.hr-dashboard {
    padding: 0;
}

.dashboard-row {
    margin-bottom: 24px;
}

.dashboard-row.two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.dashboard-card h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    color: #333;
}

/* 部门分布条 */
.dept-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dept-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dept-name {
    width: 100px;
    font-size: 13px;
    color: #666;
    text-align: right;
    flex-shrink: 0;
}

.dept-bar {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.dept-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a5d3a 0%, #6b7d4a 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.dept-count {
    width: 50px;
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

/* 预警迷你列表 */
.alert-mini-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-mini-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 6px;
    font-size: 13px;
}

.alert-mini-item.danger {
    background: #fff1f0;
    border-left: 3px solid #ff4d4f;
}

.alert-mini-item.warning {
    background: #fff7e6;
    border-left: 3px solid #faad14;
}

.alert-mini-item.info {
    background: #e6f7ff;
    border-left: 3px solid #1890ff;
}

.alert-days {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: white;
}

.alert-mini-item.danger .alert-days {
    color: #ff4d4f;
}

.alert-mini-item.warning .alert-days {
    color: #faad14;
}

.alert-mini-item.info .alert-days {
    color: #1890ff;
}

.empty-hint {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 14px;
}

/* 空状态和加载状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d9d9d9;
}

.empty-state p {
    font-size: 14px;
}

.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #ff4d4f;
}

/* 响应式 */
@media (max-width: 768px) {
    .hr-tabs {
        flex-wrap: wrap;
    }
    
    .hr-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .hr-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hr-toolbar-left,
    .hr-toolbar-right {
        justify-content: stretch;
    }
    
    .hr-search {
        width: 100%;
    }
    
    .emp-card-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-row.two-col {
        grid-template-columns: 1fr;
    }
    
    .emp-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .emp-detail-actions {
        justify-content: center;
    }
    
    .cert-item, .contract-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
