/* ==========================================
   新民独中 KPI 系统 - 现代化管理数据汇总表与低调视觉增强 (admin-table.css)
   ========================================== */

/* 1. 宽屏适配：管理控制台展开主容器宽度，避免右侧任何列被裁切 */
.main-container {
    max-width: 1440px !important;
    width: 96% !important;
    padding: 0 1rem !important;
}

/* 2. 重置密码按钮：低调克制、柔和中性的次级操作样式（绝不刺眼） */
.btn-reset-password {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
    padding: 2px 7px !important;
    min-height: 22px !important;
    height: 22px !important;
    width: auto !important;
    min-width: unset !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.72rem !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: all var(--transition-fast);
}

.btn-reset-password:hover {
    background: rgba(100, 116, 139, 0.1) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-strong) !important;
    transform: none !important;
}

[data-theme="dark"] .btn-reset-password {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .btn-reset-password:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

/* 3. 通用状态胶囊徽章防挤压折叠 */
.badge {
    white-space: nowrap !important;
}

/* 4. 汇总表格主容器 */
.admin-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow-x: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.3s ease-out;
    margin-bottom: 3rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) var(--bg-app);
}

.admin-table-container::-webkit-scrollbar {
    height: 6px;
}
.admin-table-container::-webkit-scrollbar-track {
    background: var(--bg-app);
}
.admin-table-container::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

/* 5. 现代化紧凑数据大表（全屏幕自适应完整显示） */
.admin-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.84rem;
}

.admin-data-table thead tr th {
    background: var(--bg-app);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.2px;
    padding: 10px 8px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
}

.admin-data-table tbody tr td {
    padding: 8px 8px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
    background: transparent;
}

.admin-data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.admin-data-table tbody tr:hover td {
    background-color: rgba(37, 99, 235, 0.035);
}

[data-theme="dark"] .admin-data-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}

/* 6. 工号 Badge */
.table-emp-id {
    display: inline-block;
    font-family: 'Outfit', monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-app);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* 7. 教职员姓名优雅排版 */
.table-name-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 80px;
    white-space: nowrap;
}

.table-name-zh {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.table-name-en {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 8. 担任职位胶囊排版 */
.table-pos-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 130px;
}

.table-pos-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* 9. 到职日期 */
.table-hire-date {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: center;
}

/* 10. 兼职加分微胶囊 */
.table-bonus-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    white-space: nowrap;
}

.table-bonus-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.table-bonus-tag.class-teacher {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.table-bonus-tag.dept-head {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.table-bonus-tag.admin-teacher {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 11. 得分大字与均分双行模块 */
.table-score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 65px;
    white-space: nowrap;
}

.table-score-box .score-main {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.table-score-box .score-main.self-score {
    color: var(--accent);
}

.table-score-box .score-main.admin-score {
    color: var(--success);
}

.table-score-box .score-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 12. 评估等级与奖惩建议胶囊 */
.grade-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.grade-pill.grade-excellent {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.grade-pill.grade-good {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.grade-pill.grade-medium {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.grade-pill.grade-poor {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.reward-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* 13. 状态与已复评标记 */
.table-status-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.reviewed-done-pill {
    font-size: 0.68rem;
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

/* 14. 紧凑型考评及报表操作卡片（保证全屏容纳，不裁切） */
.table-action-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 175px;
    max-width: 195px;
}

.table-btn-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 26px;
    padding: 0 8px;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    color: #ffffff;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.table-btn-grade:hover {
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.table-btn-grade.is-completed {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: none;
}

.table-btn-grade.is-completed:hover {
    background: #059669;
    color: #ffffff;
}

.table-reports-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.table-report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 2px 6px;
    gap: 4px;
}

.table-report-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85px;
}

.table-report-btns {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.btn-report-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.68rem;
    padding: 1px 5px;
    height: 20px;
    line-height: 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-report-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(37, 99, 235, 0.06);
}

.btn-report-pill.btn-report-pdf:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.06);
}

.btn-report-pill.btn-report-word:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.table-btn-reset-pwd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
}

.table-btn-reset-pwd:hover {
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-primary);
    border-color: var(--border-strong);
    border-style: solid;
}

/* 6. 实时考评进度微看板 */
.stat-dashboard-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 1.25rem 0;
}

.stat-pill {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all var(--transition-fast);
    position: relative;
    user-select: none;
}

.stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
    border-color: var(--accent);
}

.stat-pill.active {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.04);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.stat-pill .stat-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-app);
    flex-shrink: 0;
}

.stat-pill .stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.stat-pill .stat-title {
    font-size: 0.76rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-pill .stat-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-pill-all .stat-val { color: var(--accent, #2563eb); }
.stat-pill-unsub .stat-val { color: var(--warning, #d97706); }
.stat-pill-submitted .stat-val { color: #6366f1; }
.stat-pill-completed .stat-val { color: var(--success, #059669); }

/* 7. 一键快捷退回重填按钮 */
.table-btn-quick-unlock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.7rem;
    color: #b45309;
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    margin-top: 3px;
}

.table-btn-quick-unlock:hover {
    background: rgba(245, 158, 11, 0.16);
    border-color: #d97706;
    color: #92400e;
}

/* 8. 打印防跨页截断全局规则 */
@media print {
    tr, .kpi-table tr, .info-table tr, .full-box, .half-box, .sig-section, .sig-box, .table-action-card {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

