/* 人事管理系统 - 演示原型样式 */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
    --radius: 10px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 布局 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.logo {
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo i {
    font-size: 28px;
    color: var(--primary-light);
    filter: drop-shadow(0 0 8px rgba(99,102,241,0.4));
}

.logo span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    margin: 4px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-light);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(79,70,229,0.2);
    color: white;
    box-shadow: 0 0 20px rgba(79,70,229,0.15);
}

.nav-item.active::before {
    height: 60%;
}

.nav-item i {
    width: 22px;
    text-align: center;
    font-size: 16px;
    transition: transform 0.2s;
}

.nav-item:hover i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 顶部栏 */
.header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(226,232,240,0.6);
}

.breadcrumb {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 280px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info i {
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

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

/* 页面内容区 - 用于固定筛选栏 */
.page-content {
    position: relative;
}

/* 固定筛选栏 */
.sticky-filter {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    padding: 16px 0;
    margin-bottom: 8px;
    /* 添加底部边框 */
    border-bottom: 2px solid var(--border);
}

/* 批量操作栏 */
.batch-actions-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

/* 仪表盘 Widget 系统 */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dashboard-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.widget-settings-btn {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s;
}

.widget-settings-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.widget-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: all 0.3s;
    overflow: hidden;
}

.widget-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.widget-card.col-3 { grid-column: span 3; }
.widget-card.col-4 { grid-column: span 4; }
.widget-card.col-6 { grid-column: span 6; }
.widget-card.col-8 { grid-column: span 8; }
.widget-card.col-12 { grid-column: span 12; }

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
}

.widget-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-header .widget-count {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 12px;
}

.widget-body {
    padding: 16px 20px;
}

.widget-body.no-padding {
    padding: 0;
}

/* 迷你统计 */
.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius);
}

.mini-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.mini-stat-info h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.mini-stat-info p {
    font-size: 12px;
    color: var(--text-light);
}

/* 排名列表 */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    transition: background 0.2s;
}

.rank-item:hover {
    background: #f1f5f9;
}

.rank-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-num.top { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: white; }
.rank-num.top2 { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: white; }
.rank-num.top3 { background: linear-gradient(135deg, #b45309, #d97706); color: white; }
.rank-num.other { background: var(--border); color: var(--text-light); }

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

.rank-info h4 {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-info p {
    font-size: 12px;
    color: var(--text-light);
}

.rank-bar {
    width: 80px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.rank-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.5s ease;
}

.rank-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    min-width: 40px;
    text-align: right;
}

/* 分布标签 */
.dist-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dist-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
}

.dist-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dist-tag span {
    color: var(--text-light);
}

.dist-tag strong {
    color: var(--text);
    margin-left: 4px;
}

/* 提醒列表 */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    border-left: 3px solid;
}

.alert-item.warning {
    background: rgba(245, 158, 11, 0.06);
    border-left-color: var(--warning);
}

.alert-item.danger {
    background: rgba(239, 68, 68, 0.06);
    border-left-color: var(--danger);
}

.alert-item.info {
    background: rgba(59, 130, 246, 0.06);
    border-left-color: var(--info);
}

.alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.alert-item.warning .alert-icon { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.alert-item.danger .alert-icon { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.alert-item.info .alert-icon { background: rgba(59, 130, 246, 0.12); color: var(--info); }

.alert-info {
    flex: 1;
}

.alert-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-info p {
    font-size: 12px;
    color: var(--text-light);
}

.alert-count {
    font-size: 18px;
    font-weight: 700;
    min-width: 30px;
    text-align: right;
}

.alert-item.warning .alert-count { color: var(--warning); }
.alert-item.danger .alert-count { color: var(--danger); }
.alert-item.info .alert-count { color: var(--info); }

/* Widget 设置面板 */
.widget-settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.widget-settings-overlay.open {
    display: flex;
}

.widget-settings-panel {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.widget-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.widget-settings-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.widget-settings-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.widget-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.widget-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.widget-toggle-item:hover {
    background: #f1f5f9;
}

.widget-toggle-item.disabled {
    opacity: 0.5;
}

.widget-toggle-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget-toggle-info i {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.widget-toggle-info span {
    font-size: 14px;
    font-weight: 500;
}

/* 开关 */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-switch.on {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.on::after {
    transform: translateX(20px);
}

.widget-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.widget-card:hover .widget-actions {
    opacity: 1;
}

.widget-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.widget-action-btn:hover {
    background: var(--primary);
    color: white;
}

/* 编辑模式 */
.widget-grid.edit-mode .widget-card {
    border: 2px dashed var(--border);
    cursor: move;
}

.widget-grid.edit-mode .widget-card:hover {
    border-color: var(--primary);
}

.widget-grid.edit-mode .widget-header {
    cursor: grab;
    background: var(--bg);
}

.widget-grid.edit-mode .widget-header:active {
    cursor: grabbing;
}

.widget-grid.edit-mode .widget-actions {
    opacity: 1;
}

.widget-ghost {
    opacity: 0.5;
    background: var(--primary-light);
    border: 2px dashed var(--primary) !important;
}

.widget-drag {
    opacity: 0.9;
    box-shadow: var(--shadow-lg);
    transform: rotate(2deg);
}

/* 展开/收起 */
.widget-expand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    margin-top: 8px;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-light);
    transition: all 0.2s;
}

.widget-expand-bar:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.widget-settings-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 1400px) {
    .widget-card.col-3 { grid-column: span 6; }
    .widget-card.col-4 { grid-column: span 6; }
}

@media (max-width: 1024px) {
    .widget-grid {
        grid-template-columns: 1fr;
    }
    .widget-card.col-3,
    .widget-card.col-4,
    .widget-card.col-6,
    .widget-card.col-8,
    .widget-card.col-12 {
        grid-column: span 1;
    }
}

.stat-card {
    background: var(--card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.3s;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-icon.blue { background: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(99,102,241,0.08)); color: var(--primary); }
.stat-icon.green { background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(52,211,153,0.08)); color: var(--success); }
.stat-icon.orange { background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(251,191,36,0.08)); color: var(--warning); }
.stat-icon.red { background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(248,113,113,0.08)); color: var(--danger); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text), var(--text-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-change {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* 图表区域 */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.chart-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-placeholder {
    height: 240px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    flex-direction: column;
    gap: 8px;
}

/* 数据表格 */
.data-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.3s;
}

.data-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(248,250,252,0.8), rgba(255,255,255,0.9));
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3730a3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

/* 行内编辑工具栏 */
.inline-edit-toolbar {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.inline-edit-toolbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.inline-edit-title {
    font-weight: 600;
    color: #92400e;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-edit-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.inline-edit-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 表格 */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    /* 限制高度，使垂直滚动在容器内 */
    max-height: calc(100vh - 280px);
    /* 滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    /* 表格需要最小宽度才能滚动 */
    min-width: max-content;
}

thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

/* 表头行固定 */
thead tr {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

/* 表头所有单元格 */
th {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

th, td {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 编辑状态第一列 */
tr.editing td:first-child {
    background: #fffbeb;
}

th {
    font-weight: 700;
    color: var(--text-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(79,70,229,0.03), rgba(99,102,241,0.02));
    transform: scale(1.002);
}

/* 状态标签 */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.badge-success::before { background: var(--success); }

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}
.badge-warning::before { background: var(--warning); }

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.badge-danger::before { background: var(--danger); }

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}
.badge-info::before { background: var(--info); }

/* 员工头像 */
.employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.employee-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.employee-details h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.employee-details p {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 13px;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

/* 组织架构树样式 */
.org-tree {
    padding: 8px;
}

.org-dept-item {
    margin-bottom: 4px;
}

.org-dept-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    border-left: 3px solid var(--primary);
    transition: all 0.2s ease;
}

.org-dept-header:hover {
    background: var(--primary-light) !important;
    transform: translateX(4px);
}

.org-dept-children {
    margin-left: 16px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    max-height: 5000px;
    opacity: 1;
}

.org-dept-children.collapsed {
    max-height: 0;
    opacity: 0;
    margin-left: 0;
    padding: 0;
}

/* 强制隐藏收起的子部门内容 */
.org-dept-children.collapsed * {
    display: none !important;
}

.org-dept-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

/* 小箭头旋转动画 */
.dept-toggle-icon {
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 6px;
    font-size: 12px;
    z-index: 10;
    position: relative;
}

.dept-toggle-icon:hover {
    color: var(--primary) !important;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 4px;
}

.dept-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

/* 岗位清单表格 */
.org-pos-row {
    transition: background 0.2s;
}

.org-pos-row:hover {
    background: var(--primary-light);
}
.editable-cell {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.editable-cell:hover {
    background: rgba(79, 70, 229, 0.05);
    border-color: var(--primary-light);
}

.editable-cell.editing {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.editable-cell input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    outline: none;
    padding: 0;
}

/* 右侧滑出面板 */
.side-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 2000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-panel.open {
    right: 0;
}

.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.side-panel-overlay.open {
    opacity: 1;
    visibility: visible;
}

.side-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
}

.side-panel-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.side-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.side-panel-close:hover {
    background: rgba(255,255,255,0.3);
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.side-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg);
}

/* 面板内表单样式 */
.panel-section {
    margin-bottom: 24px;
}

.panel-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.panel-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.panel-form-group.full-width {
    grid-column: 1 / -1;
}

.panel-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}

.panel-form-group input,
.panel-form-group select,
.panel-form-group textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: var(--card);
    color: var(--text);
}

.panel-form-group input:focus,
.panel-form-group select:focus,
.panel-form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.panel-form-group .readonly {
    background: var(--bg);
    color: var(--text-light);
    cursor: not-allowed;
}

/* 头像区域 */
.panel-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-lg);
    color: white;
}

.panel-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.panel-avatar-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.panel-avatar-info p {
    opacity: 0.9;
    font-size: 14px;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    border: 1px solid var(--border);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(248,250,252,0.8), rgba(255,255,255,0.9));
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--danger);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(248,250,252,0.5);
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: var(--card);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 编辑员工分组 */
.edit-group {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.edit-group-title {
    padding: 12px 16px;
    background: var(--bg);
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    border-bottom: 1px solid var(--border);
}

.edit-group-title:hover {
    background: #f1f5f9;
}

.edit-group-title i {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.2s;
}

.edit-group-content {
    padding: 16px;
    background: var(--card);
}

.edit-group-content.collapsed {
    display: none;
}

/* 流程步骤 */
.process-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 36px;
    position: relative;
    padding: 0 20px;
}

.process-steps::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, var(--border), var(--primary-light));
    z-index: 0;
    border-radius: 2px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.step.active .step-number {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(79,70,229,0.35);
    transform: scale(1.1);
}

.step.completed .step-number {
    background: linear-gradient(135deg, var(--success), #059669);
    border-color: var(--success);
    color: white;
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

.step-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.3s;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 入职/调动/离职卡片 */
.flow-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.flow-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.flow-card-header h3 {
    font-size: 16px;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--card);
}

.timeline-content {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius);
}

.timeline-content h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 12px;
    color: var(--text-light);
}

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .main-content {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .search-box input {
        width: 160px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 打印样式 */
@media print {
    .sidebar,
    .header,
    .btn,
    .actions {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
    .content {
        padding: 0;
    }
}
