/* ==================== 证明管理（离职证明 / 在职证明） ====================
   克制风格：白底、细边框 #e8eaef、单一强调色 #4f46e5，无渐变无光晕
   宿主约束：.page-content 自身无 padding，由 #certRoot 承担 */

#certRoot { display: flex; flex-direction: column; padding: 18px 24px 26px; }

/* ---------- 顶部条 ---------- */
.cert-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cert-bar-l { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.cert-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.cert-sub { font-size: 12.5px; color: #94a3b8; }
.cert-bar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cert-syncinfo { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.cert-dot { width: 6px; height: 6px; border-radius: 50%; background: #4f46e5; flex-shrink: 0; }
.cert-dot-stale { background: #cbd5e1; }

/* ---------- 按钮 ---------- */
.cert-btn {
    appearance: none; border: 1px solid #e5e7eb; background: #fff; color: #475569;
    font-size: 12.5px; padding: 5px 12px; border-radius: 7px; cursor: pointer;
    transition: border-color .15s, color .15s; white-space: nowrap;
    font-family: inherit; text-decoration: none; display: inline-flex; align-items: center;
    line-height: 20px;
}
.cert-btn:hover { border-color: #4f46e5; color: #4f46e5; }
.cert-btn:disabled { opacity: .45; cursor: not-allowed; }
.cert-btn:disabled:hover { border-color: #e5e7eb; color: #475569; }
.cert-btn-primary { border-color: #c7d2fe; color: #4f46e5; background: #f8f9ff; }
.cert-btn-quiet { color: #94a3b8; }

/* ---------- 统计卡 ---------- */
.cert-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.cert-card { background: #fff; border: 1px solid #e8eaef; border-radius: 10px; padding: 14px 16px; }
.cert-card-n { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cert-card-l { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.cert-card-s { font-size: 11.5px; color: #b4b8c4; margin-top: 3px; }

/* ---------- 工具栏 ---------- */
.cert-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cert-search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.cert-search-wide { max-width: 100%; flex: none; }
.cert-search input {
    width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; background: #fff;
    border-radius: 8px; padding: 7px 10px 7px 30px; font-size: 13px; color: #0f172a;
    outline: none; transition: border-color .15s; font-family: inherit;
}
.cert-search input:focus { border-color: #4f46e5; }
.cert-search input::placeholder { color: #b4b8c4; }
.cert-search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: #b4b8c4; pointer-events: none; }
.cert-sel, .cert-date {
    border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 6px 9px;
    font-size: 12.5px; color: #475569; outline: none; font-family: inherit;
}
.cert-sel:focus, .cert-date:focus { border-color: #4f46e5; }
.cert-sep { color: #cbd5e1; font-size: 12px; }

/* ---------- 列表 ---------- */
.cert-listwrap { background: #fff; border: 1px solid #e8eaef; border-radius: 10px; overflow: hidden; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.cert-table th {
    text-align: left; font-weight: 500; font-size: 12px; color: #94a3b8;
    padding: 11px 12px; border-bottom: 1px solid #e8eaef; white-space: nowrap; background: #fcfdfe;
}
.cert-table td {
    padding: 11px 12px; border-bottom: 1px solid #f1f2f6; color: #334155;
    vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cert-table tbody tr:last-child td { border-bottom: none; }
.cert-table tbody tr:hover { background: #fafbfd; }
.cert-no { font-variant-numeric: tabular-nums; color: #64748b; font-size: 12.5px; }
.cert-emp-n { color: #0f172a; font-weight: 500; }
.cert-emp-c { color: #94a3b8; font-size: 11.5px; font-variant-numeric: tabular-nums; margin-left: 5px; }
.cert-dt { font-variant-numeric: tabular-nums; color: #64748b; font-size: 12.5px; }
.cert-co { color: #475569; font-size: 12.5px; }
.cert-tag { display: inline-block; font-size: 11.5px; border-radius: 4px; padding: 1px 6px; }
.cert-tag-off { color: #b45309; background: #fffbeb; }
.cert-tag-on { color: #0f766e; background: #f0fdfa; }
.cert-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cert-st i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cert-st-ok { color: #047857; } .cert-st-ok i { background: #059669; }
.cert-st-plan { color: #4338ca; } .cert-st-plan i { background: #4f46e5; }
.cert-st-void { color: #94a3b8; } .cert-st-void i { background: #cbd5e1; }
.cert-ops { display: flex; gap: 10px; align-items: center; }
.cert-op { color: #4f46e5; font-size: 12.5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.cert-op:hover { text-decoration: underline; }
.cert-op-off { color: #c3c8d2; font-size: 12.5px; }
.cert-op-danger { color: #dc2626; }

/* ---------- 分页 / 空态 ---------- */
.cert-pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; color: #94a3b8; }
.cert-pager-pages { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cert-empty { text-align: center; padding: 56px 20px; color: #94a3b8; font-size: 13px; background: #fff; border: 1px solid #e8eaef; border-radius: 10px; }
.cert-empty-t { font-size: 14px; color: #475569; margin-bottom: 6px; }
.cert-empty-s { font-size: 12.5px; color: #a3a9b7; line-height: 1.7; }

/* ---------- 弹窗 ---------- */
.cert-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); display: flex; align-items: center; justify-content: center; z-index: 1200; padding: 26px; }
.cert-panel { background: #fff; border-radius: 12px; width: min(920px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.cert-panel-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 14px; border-bottom: 1px solid #eef0f4; flex-shrink: 0; }
.cert-panel-t { font-size: 15px; font-weight: 600; color: #0f172a; }
.cert-panel-sub { font-size: 12px; color: #94a3b8; margin-top: 5px; display: flex; gap: 12px; flex-wrap: wrap; }
.cert-panel-bd { padding: 16px 22px 4px; overflow-y: auto; }
.cert-panel-ft { padding: 13px 22px 16px; border-top: 1px solid #eef0f4; display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-shrink: 0; }
.cert-panel-ft .cert-op-danger { margin-right: auto; }
.cert-close { appearance: none; background: none; border: none; cursor: pointer; color: #b4b8c4; font-size: 20px; line-height: 1; padding: 2px 4px; flex-shrink: 0; }
.cert-close:hover { color: #475569; }

/* ---------- 员工搜索 ---------- */
.cert-emp { position: relative; margin-bottom: 14px; }
.cert-emp-pop { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: #fff; border: 1px solid #e8eaef; border-radius: 9px; margin-top: 5px; max-height: 240px; overflow-y: auto; box-shadow: 0 10px 26px rgba(2, 6, 23, .1); }
.cert-emp-item { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #f1f2f6; }
.cert-emp-item:last-child { border-bottom: none; }
.cert-emp-item:hover { background: #fafbfd; }
.cert-emp-n { font-size: 13px; color: #0f172a; font-weight: 500; }
.cert-emp-s { font-size: 11.5px; color: #94a3b8; font-variant-numeric: tabular-nums; text-align: right; }
.cert-emp-hint { padding: 11px 12px; font-size: 12.5px; color: #94a3b8; }

/* ---------- 员工卡片 ---------- */
.cert-empcard { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 13px; background: #f8fafc; border: 1px solid #e8eaef; border-radius: 9px; margin-bottom: 14px; }
.cert-empcard-n { font-size: 13.5px; font-weight: 600; color: #0f172a; }
.cert-empcard-c { font-size: 12px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.cert-empcard-t { font-size: 12px; color: #475569; }
.cert-empcard-s { font-size: 11.5px; color: #4f46e5; background: #eef2ff; border-radius: 4px; padding: 1px 6px; }
.cert-empcard-re { margin-left: auto; font-size: 12px; color: #4f46e5; cursor: pointer; }
.cert-empcard-re:hover { text-decoration: underline; }

/* ---------- 预警条 ---------- */
.cert-alert { border-radius: 9px; padding: 11px 13px; font-size: 12.5px; line-height: 1.7; margin-bottom: 14px; }
.cert-alert-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.cert-alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
.cert-alert-info { background: #f8fafc; border: 1px solid #e8eaef; color: #64748b; }
.cert-alert-h { font-weight: 600; margin-bottom: 4px; }
.cert-alert-i { display: flex; gap: 10px; flex-wrap: wrap; }
.cert-alert-act { display: flex; gap: 8px; margin-top: 10px; }
.cert-cmp { color: #94a3b8; font-variant-numeric: tabular-nums; font-size: 11.5px; }
.cert-lab-warn { color: #b45309; font-weight: 500; margin-left: 6px; font-size: 11.5px; }
.cert-hint { font-size: 11.5px; color: #a3a9b7; }
.cert-note { grid-column: 1 / -1; font-size: 12px; color: #94a3b8; line-height: 1.7; margin-top: 2px; }

/* ---------- 职务（带职级） ---------- */
/* 职务名输入 + 职级下拉并排；证明里的最终文本 = 职务名（职级名称级） */
.cert-job-row { display: flex; gap: 8px; align-items: center; }
.cert-job-row input { flex: 1 1 auto; min-width: 0; }
.cert-job-row select { flex: 0 0 152px; }
.cert-lab-note { color: inherit; font-weight: 400; font-size: 11.5px; }

/* ---------- BPM 单据 ---------- */
.cert-docs { margin-bottom: 14px; font-size: 12.5px; }
.cert-docs summary { cursor: pointer; color: #64748b; outline: none; padding: 4px 0; }
.cert-docs summary:hover { color: #4f46e5; }
.cert-docs-t { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.cert-docs-t th { text-align: left; font-weight: 500; color: #94a3b8; padding: 6px 10px; border-bottom: 1px solid #e8eaef; }
.cert-docs-t td { padding: 6px 10px; border-bottom: 1px solid #f1f2f6; color: #475569; }

/* ---------- 表单 ---------- */
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; }
.cert-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cert-field-full { grid-column: 1 / -1; }
.cert-field label { font-size: 12px; color: #94a3b8; font-weight: 500; }
.cert-field label em { color: #dc2626; font-style: normal; margin-left: 2px; }
.cert-field input, .cert-field select, .cert-field textarea {
    width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 7px 10px; font-size: 13px; color: #0f172a; outline: none;
    transition: border-color .15s; background: #fff; font-family: inherit;
}
.cert-field input:focus, .cert-field select:focus { border-color: #4f46e5; }
.cert-field input[readonly] { background: #fafbfd; color: #64748b; cursor: default; }
.cert-field input:disabled { background: #fafbfd; color: #b4b8c4; }
.cert-field input::placeholder { color: #b4b8c4; }

/* ---------- 完成态 ---------- */
.cert-done { text-align: center; padding: 34px 20px 26px; }
.cert-done-t { font-size: 15px; font-weight: 600; color: #047857; margin-bottom: 10px; }
.cert-done-s { font-size: 13px; color: #334155; }
.cert-done-f { font-size: 12px; color: #94a3b8; margin-top: 8px; word-break: break-all; }
.cert-done-q { font-size: 12px; color: #a3a9b7; margin-top: 6px; }

/* ---------- 详情 ---------- */
.cert-kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #e8eaef; border-radius: 9px; overflow: hidden; margin-bottom: 14px; }
.cert-kv { display: flex; gap: 10px; padding: 9px 13px; border-bottom: 1px solid #f1f2f6; font-size: 12.5px; min-width: 0; }
.cert-kv-k { color: #94a3b8; flex-shrink: 0; width: 66px; }
.cert-kv-v { color: #334155; overflow: hidden; text-overflow: ellipsis; word-break: break-all; }
.cert-file { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: #f8fafc; border: 1px solid #e8eaef; border-radius: 9px; margin-bottom: 14px; font-size: 12.5px; }
.cert-file-t { color: #94a3b8; flex-shrink: 0; }
.cert-file-p { color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }

/* ---------- 轻提示 ---------- */
.cert-toast {
    position: fixed; top: 22px; right: 24px; z-index: 1400;
    background: #0f172a; color: #f8fafc; font-size: 12.5px; line-height: 1.6;
    padding: 9px 15px; border-radius: 8px; max-width: 380px;
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.cert-toast-on { opacity: 1; transform: translateY(0); }
.cert-toast-err { background: #b91c1c; }
.cert-toast-warn { background: #b45309; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1180px) {
    .cert-cards { grid-template-columns: repeat(2, 1fr); }
    .cert-listwrap { overflow-x: auto; }
    .cert-table { min-width: 940px; }
}
@media (max-width: 720px) {
    #certRoot { padding: 14px 14px 20px; }
    .cert-grid, .cert-kvs { grid-template-columns: 1fr; }
}
