/* ============================================================================
   知音·行政人事 模块样式
   文件：frontend/css/admin.css
   ============================================================================ */

/* ---- 页面容器 ---- */
.admin-hr-page {
    padding: 20px 24px;
    max-width: 1400px;
}

/* ---- 页面头部 ---- */
.admin-hr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.admin-hr-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}
.admin-hr-subtitle {
    font-size: 13px;
    color: #888;
}

/* ---- Tab 切换 ---- */
.admin-hr-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e8ecf1;
    margin-bottom: 20px;
    padding-bottom: 0;
}
.admin-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-weight: 500;
}
.admin-tab:hover {
    color: #3b82f6;
}
.admin-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* ---- Tab 内容 ---- */
.admin-tab-content {
    display: none;
}
.admin-tab-content.active {
    display: block;
}

/* ---- 筛选栏 ---- */
.admin-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.filter-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    width: 220px;
    outline: none;
    transition: border-color 0.2s;
}
.filter-input:focus {
    border-color: #3b82f6;
}
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    outline: none;
    min-width: 120px;
    cursor: pointer;
}

/* ---- 表格 ---- */
.admin-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table thead {
    background: #f8f9fb;
}
.admin-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e8ecf1;
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}
.admin-table tbody tr:hover {
    background: #f8faff;
}
.table-loading {
    text-align: center;
    color: #999;
    padding: 30px 0 !important;
}

/* 岗位标签 */
.role-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.role-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
}
.role-tag.super {
    background: #fef3c7;
    color: #92400e;
}
.role-tag.admin {
    background: #dbeafe;
    color: #1e40af;
}
.role-tag.director {
    background: #e0e7ff;
    color: #3730a3;
}
.role-tag.teacher {
    background: #d1fae5;
    color: #065f46;
}
.role-tag.assistant {
    background: #f3f4f6;
    color: #4b5563;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}
.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* 操作按钮 */
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    margin-right: 4px;
}
.btn-sm:hover {
    background: #f0f0f0;
}
.btn-sm.btn-edit:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}
.btn-sm.btn-reset:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}
.btn-icon {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.btn-icon:hover {
    opacity: 1;
    background: #fee2e2;
}

/* ---- 分页 ---- */
.admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 13px;
}
.admin-pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: all 0.15s;
}
.admin-pagination button:hover:not(:disabled) {
    background: #f0f0f0;
}
.admin-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.admin-pagination button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}
.admin-pagination .page-info {
    color: #888;
    margin: 0 8px;
}

/* ---- 弹窗：.modal-overlay 统一走 style.css L638，此处不再重复 ---- */
.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    max-height: 85vh;
    overflow-y: auto;
}
.staff-modal-content {
    width: 720px;
}
.modal-sm {
    width: 420px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #e8ecf1;
}
.modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: #1a1a2e;
}
.modal-close {
    border: none;
    background: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close:hover {
    color: #333;
}
.modal-body {
    padding: 20px 24px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e8ecf1;
}

/* ---- 表单区域 ---- */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    margin: 0 0 14px 0;
}
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.form-row:last-child {
    margin-bottom: 0;
}
.form-group {
    flex: 1;
    min-width: 180px;
}
.form-group.required label::after {
    content: ' *';
    color: #ef4444;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus {
    border-color: #3b82f6;
}

/* Checkbox 组 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}
.checkbox-group label {
    display: flex !important;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 400 !important;
    cursor: pointer;
    white-space: nowrap;
}

/* ---- 骨架屏/占位 ---- */
.admin-skeleton {
    padding: 40px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.admin-skeleton h3 {
    color: #1a1a2e;
    margin-bottom: 8px;
}
.admin-skeleton p {
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}
.placeholder-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 60px;
    background: #f8f9fb;
    border-radius: 12px;
    border: 2px dashed #ddd;
}
.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.placeholder-card p {
    color: #aaa;
    font-size: 14px;
    margin: 0;
}

/* ---- 角色卡片网格 ---- */
.roles-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.role-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.role-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.role-card.system {
    border-left: 3px solid #f59e0b;
}
.role-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fb;
    border-bottom: 1px solid #eee;
}
.role-card-icon {
    font-size: 28px;
    line-height: 1;
}
.role-card-info h4 {
    margin: 0;
    font-size: 15px;
    color: #1a1a2e;
}
.role-card-code {
    font-size: 11px;
    color: #888;
}
.role-card-body {
    padding: 12px 16px;
}
.role-card-desc {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.5;
}
.role-card-perms {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.perm-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 11px;
}
.perm-tag.more {
    background: #f3f4f6;
    color: #888;
}
.role-card-meta {
    font-size: 12px;
    color: #888;
}
.role-card-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}
.system-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
}

/* ---- 权限矩阵弹窗 ---- */
.perm-category {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}
.perm-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.perm-category-title {
    font-size: 12px;
    font-weight: 700;
    color: #3b82f6;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.perm-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.perm-checkbox {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8f9fb;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}
.perm-checkbox:hover {
    border-color: #3b82f6;
}
.perm-checkbox .perm-name {
    color: #333;
    font-weight: 500;
}
.perm-checkbox .perm-code {
    font-size: 10px;
    color: #aaa;
    font-family: monospace;
}

/* ---- 操作日志 ---- */
.log-action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.log-action-badge.create {
    background: #d1fae5;
    color: #065f46;
}
.log-action-badge.update {
    background: #dbeafe;
    color: #1e40af;
}
.log-action-badge.delete {
    background: #fee2e2;
    color: #991b1b;
}
.log-action-badge.warn {
    background: #fef3c7;
    color: #92400e;
}
.log-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 11px;
    color: #555;
}

/* ---- 系统设置 ---- */
.admin-settings-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 24px;
}
.admin-settings-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1a1a2e;
}
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fb;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 12px;
}
.settings-item-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.settings-item-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}
.settings-item-desc {
    font-size: 12px;
    color: #888;
}
.settings-item-input {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.settings-item-input input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.settings-item-input input:focus {
    border-color: #3b82f6;
}
.settings-item-updated {
    font-size: 11px;
    color: #aaa;
}

/* ---- 过程管理（运营总览Tab5） ---- */
.process-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.process-group-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.15s;
}
.process-group-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.process-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.process-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}
.process-group-percentage {
    font-size: 24px;
    font-weight: 700;
}
.process-group-subtitle {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}
.process-group-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}
.process-group-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.process-group-items {
    font-size: 12px;
}
.process-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.process-item-row:last-child {
    border-bottom: none;
}
.process-item-name {
    color: #333;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.process-item-count {
    font-weight: 600;
    white-space: nowrap;
}
.process-item-count.high { color: #4cafaf; }
.process-item-count.mid { color: #ff9800; }
.process-item-count.low { color: #e53935; }
.process-group-commission {
    font-size: 11px;
    color: #999;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    line-height: 1.4;
}

/* 教师完成明细表 — sticky左侧教师列 */
.board-table-process th:first-child,
.board-table-process td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}
.board-table-process thead th:first-child {
    background: #f1f3f5;
}
.board-table-process tbody td:first-child {
    background: #fff;
    font-weight: 600;
}
.board-table-process tr.row-warning td:first-child {
    background: #fff5f5;
}

/* 月份选择器样式 */
.process-month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}
.process-month-selector label {
    font-size: 13px;
    color: #666;
}
.process-month-selector input[type="month"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.process-month-selector input[type="month"]:focus {
    border-color: #4cafaf;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .process-groups-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .process-group-percentage {
        font-size: 20px;
    }
    .admin-hr-page {
        padding: 12px;
    }
    .filter-left {
        flex-direction: column;
    }
    .filter-input {
        width: 100%;
    }
    .staff-modal-content {
        width: 95%;
    }
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    .form-group {
        min-width: 100%;
    }
}
