/* =====================================================================
   OA 研发任务管理平台 · 通用样式（Bootstrap 5 之上的一层）
   ===================================================================== */
:root {
    --oa-sidebar-w: 232px;
    --oa-topbar-h: 56px;
    --oa-primary: #2f6fed;
    --oa-primary-dark: #1b50c4;
    --oa-bg: #f4f6fa;
    --oa-card: #ffffff;
    --oa-border: #e6e9f0;
    --oa-text: #24292f;
    --oa-muted: #6b7280;
    --oa-radius: 10px;
    --oa-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

body.oa-body {
    margin: 0;
    background: var(--oa-bg);
    color: var(--oa-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
}

a { text-decoration: none; }

/* ---------------- 布局 ---------------- */
.oa-layout { display: flex; min-height: 100vh; }

.oa-sidebar {
    width: var(--oa-sidebar-w);
    flex: 0 0 var(--oa-sidebar-w);
    background: #101828;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1040;
    transition: transform .2s ease;
}
.oa-brand {
    height: var(--oa-topbar-h);
    display: flex; align-items: center; gap: 8px;
    padding: 0 16px; color: #fff; font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap; overflow: hidden;
}
.oa-brand i { color: var(--oa-primary); font-size: 18px; }
.oa-brand-text { font-size: 15px; }

.oa-nav { flex: 1; overflow-y: auto; padding: 10px 8px 20px; }
.oa-nav::-webkit-scrollbar { width: 6px; }
.oa-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.oa-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin-bottom: 2px;
    color: #cbd5e1; border-radius: 8px; font-size: 13.5px;
    transition: background .15s, color .15s;
}
.oa-nav-link i { font-size: 15px; width: 18px; text-align: center; }
.oa-nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.oa-nav-link.active { background: var(--oa-primary); color: #fff; font-weight: 500; }
.oa-tag { font-size: 10px; padding: 1px 5px; margin-left: auto; }

.oa-nav-title {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin-top: 6px;
    color: #94a3b8; font-size: 12px; letter-spacing: .4px;
}
.oa-nav-title .oa-caret { margin-left: auto; font-size: 11px; transition: transform .2s; }
.oa-nav-group.open .oa-caret { transform: rotate(180deg); }
.oa-nav-sub { display: none; padding-left: 6px; }
.oa-nav-group.open .oa-nav-sub { display: block; }

.oa-sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.oa-level { display: flex; align-items: center; gap: 6px; color: #e2e8f0; }
.oa-level strong { margin-left: auto; color: #fbbf24; }

.oa-main {
    flex: 1; min-width: 0;
    margin-left: var(--oa-sidebar-w);
    display: flex; flex-direction: column;
}
.oa-sidebar-mask { display: none; }

.oa-topbar {
    height: var(--oa-topbar-h);
    background: #fff; border-bottom: 1px solid var(--oa-border);
    display: flex; align-items: center; gap: 12px;
    padding: 0 18px; position: sticky; top: 0; z-index: 1030;
}
.oa-search { position: relative; flex: 1; max-width: 380px; }
.oa-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--oa-muted); font-size: 13px; }
.oa-search input { padding-left: 30px; background: #f5f7fb; border-color: transparent; }
.oa-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.oa-icon-btn {
    position: relative; width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; color: #475467; font-size: 16px;
}
.oa-icon-btn:hover { background: #f2f4f7; color: var(--oa-primary); }
.oa-badge {
    position: absolute; top: 3px; right: 3px;
    background: #ef4444; color: #fff; font-size: 10px;
    min-width: 16px; height: 16px; line-height: 16px;
    border-radius: 8px; text-align: center; padding: 0 4px;
}
.oa-user { display: flex; align-items: center; gap: 8px; color: var(--oa-text); padding: 4px 8px; border-radius: 8px; }
.oa-user:hover { background: #f2f4f7; }
.oa-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.oa-avatar-text {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--oa-primary); color: #fff; font-size: 11px; font-weight: 600;
}

.oa-content { flex: 1; padding: 18px 20px 8px; }
.oa-pagehead { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.oa-pagehead-left { flex: 1; min-width: 200px; }
.oa-page-title { font-size: 19px; font-weight: 600; margin: 0 0 2px; }
.oa-breadcrumb { margin: 0; font-size: 12px; }
.oa-pagehead-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.oa-footer {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
    padding: 14px 20px; color: var(--oa-muted); font-size: 12px;
    border-top: 1px solid var(--oa-border); margin-top: 16px;
}

/* ---------------- 卡片 / 表格 ---------------- */
.card { border: 1px solid var(--oa-border); border-radius: var(--oa-radius); box-shadow: var(--oa-shadow); }
.card-header { background: #fff; border-bottom: 1px solid var(--oa-border); font-weight: 600; padding: 12px 16px; }
.card-body { padding: 16px; }

.oa-table { margin-bottom: 0; font-size: 13.5px; }
.oa-table > thead th {
    background: #f8fafc; color: #475467; font-weight: 600; font-size: 12.5px;
    border-bottom: 1px solid var(--oa-border); white-space: nowrap; padding: 10px 12px;
}
.oa-table > tbody td { padding: 10px 12px; vertical-align: middle; border-color: #eef1f6; }
.oa-table > tbody tr:hover { background: #fafbfe; }
.oa-table .oa-title-cell { font-weight: 500; color: var(--oa-text); }
.oa-table .oa-sub { color: var(--oa-muted); font-size: 12px; }

.table-responsive { border-radius: var(--oa-radius); }

/* ---------------- 统计卡 ---------------- */
.oa-stat { display: flex; align-items: center; gap: 12px; }
.oa-stat-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.oa-stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.oa-stat-label { color: var(--oa-muted); font-size: 12.5px; }

/* ---------------- 看板 ---------------- */
.oa-kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.oa-kanban-col { flex: 0 0 272px; background: #f1f3f9; border-radius: var(--oa-radius); padding: 10px; }
.oa-kanban-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 600; font-size: 13px; }
.oa-kanban-card {
    background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(16,24,40,.06); cursor: pointer; border-left: 3px solid var(--oa-primary);
}
.oa-kanban-card:hover { box-shadow: 0 4px 12px rgba(16,24,40,.1); }
.oa-kanban-card .oa-kc-title { font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.oa-kanban-card .oa-kc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--oa-muted); }
.oa-kanban.dragging .oa-kanban-card { opacity: .6; }

/* ---------------- 其他 ---------------- */
.oa-empty { text-align: center; padding: 42px 12px; color: var(--oa-muted); }
.oa-empty i { font-size: 40px; opacity: .35; display: block; margin-bottom: 8px; }
.oa-empty p { margin: 0; font-size: 13px; }

.oa-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; flex-wrap: wrap; }

.oa-blank-body { background: linear-gradient(140deg, #eef3fb 0%, #f7f9fc 100%); min-height: 100vh; }
.oa-blank-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }

.oa-auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 30px 28px; box-shadow: 0 10px 40px rgba(16,24,40,.10); }
.oa-auth-logo { text-align: center; margin-bottom: 18px; }
.oa-auth-logo i { font-size: 34px; color: var(--oa-primary); }
.oa-auth-logo h4 { margin: 8px 0 2px; font-size: 18px; font-weight: 600; }
.oa-auth-logo p { color: var(--oa-muted); font-size: 12.5px; margin: 0; }

.oa-error-box { text-align: center; max-width: 480px; }
.oa-error-code { font-size: 74px; font-weight: 800; line-height: 1; }

.oa-steps { display: flex; gap: 0; margin-bottom: 22px; flex-wrap: wrap; }
.oa-step { flex: 1; min-width: 110px; text-align: center; padding: 10px 6px; position: relative; color: var(--oa-muted); font-size: 12.5px; }
.oa-step::after { content: ''; position: absolute; top: 26px; right: -1px; width: 100%; height: 2px; background: var(--oa-border); z-index: 0; }
.oa-step:last-child::after { display: none; }
.oa-step .oa-step-no {
    width: 30px; height: 30px; line-height: 30px; border-radius: 50%;
    background: #fff; border: 2px solid var(--oa-border); color: var(--oa-muted);
    display: inline-block; position: relative; z-index: 1; font-weight: 600; margin-bottom: 5px;
}
.oa-step.active { color: var(--oa-primary); font-weight: 600; }
.oa-step.active .oa-step-no { border-color: var(--oa-primary); background: var(--oa-primary); color: #fff; }
.oa-step.done { color: #12b76a; }
.oa-step.done .oa-step-no { border-color: #12b76a; background: #12b76a; color: #fff; }

.oa-check-list { list-style: none; padding: 0; margin: 0; }
.oa-check-list li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f0f2f7; font-size: 13px; }
.oa-check-list li:last-child { border-bottom: 0; }
.oa-check-list .oa-ck-name { flex: 0 0 190px; font-weight: 500; }
.oa-check-list .oa-ck-req { flex: 0 0 170px; color: var(--oa-muted); font-size: 12.5px; }
.oa-check-list .oa-ck-cur { flex: 1; word-break: break-all; }
.oa-check-list .oa-ck-flag { flex: 0 0 30px; text-align: center; }
.oa-check-list li.ok .oa-ck-flag { color: #12b76a; }
.oa-check-list li.no .oa-ck-flag { color: #f04438; }
.oa-fix { color: #b54708; background: #fffaeb; border-radius: 6px; padding: 4px 8px; margin-top: 4px; font-size: 12px; display: block; }

.oa-timeline { position: relative; padding-left: 20px; }
.oa-timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--oa-border); }
.oa-timeline-item { position: relative; padding: 0 0 16px 12px; }
.oa-timeline-item::before {
    content: ''; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px;
    border-radius: 50%; background: #fff; border: 2px solid var(--oa-primary);
}
.oa-timeline-item.danger::before { border-color: #f04438; }
.oa-timeline-item.success::before { border-color: #12b76a; }
.oa-timeline-time { font-size: 12px; color: var(--oa-muted); }

.oa-diff { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px; overflow: auto; max-height: 460px; }
.oa-diff .add { color: #4ade80; }
.oa-diff .del { color: #f87171; }

.oa-tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.oa-chip { background: #f2f4f7; border-radius: 20px; padding: 2px 10px; font-size: 12px; color: #475467; }

.oa-progress-thin { height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.oa-progress-thin > span { display: block; height: 100%; background: var(--oa-primary); }

.oa-score-box { background: linear-gradient(135deg, #2f6fed, #5b8def); color: #fff; border-radius: var(--oa-radius); padding: 16px; }
.oa-score-box .oa-score-num { font-size: 30px; font-weight: 800; line-height: 1; }
.oa-score-box .oa-score-label { opacity: .85; font-size: 12.5px; }

.text-muted-2 { color: var(--oa-muted) !important; }
.oa-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.oa-nowrap { white-space: nowrap; }
.oa-clickable { cursor: pointer; }
.oa-hr { border-top: 1px solid var(--oa-border); margin: 14px 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 991.98px) {
    .oa-sidebar { transform: translateX(-100%); }
    .oa-sidebar.open { transform: translateX(0); }
    .oa-main { margin-left: 0; }
    .oa-sidebar-mask.show { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 1035; }
    .oa-content { padding: 14px 12px 6px; }
    .oa-page-title { font-size: 17px; }
    .oa-check-list .oa-ck-name { flex: 0 0 110px; }
    .oa-check-list .oa-ck-req { display: none; }
    .oa-kanban-col { flex: 0 0 84%; }
}
