/* ============================================================
   CMM V2 — 与 CRM / EMS 一致的设计语言
   ============================================================ */

@import url('/kaifa/css/kaifa-v2.css?v=20260531');
@import url('/kaifa/css/kaifa-common.css?v=20260527');

/* 计量模块品牌色（蓝） */
.cmm-shell-logo { color: #4c6ef5 !important; }
.cmm-shell-logo .dot {
    background: #4c6ef5 !important;
    box-shadow: 0 0 0 3px #edf2ff !important;
}
.kf-shell-top .kf-nav-tab:hover,
.kf-shell-top .kf-nav-tab.active {
    background: #edf2ff;
    color: #4c6ef5;
}
.kf-shell-top .kf-module-card:hover {
    border-color: #bac8ff;
    box-shadow: 0 2px 8px rgba(76, 110, 245, 0.12);
}

/* 工作台 KPI */
.cmm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
@media (max-width: 1100px) { .cmm-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .cmm-kpi-grid { grid-template-columns: 1fr; } }

.cmm-kpi {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 16px 18px;
    border: 1px solid var(--c-border2);
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cmm-kpi:hover {
    border-color: #bac8ff;
    box-shadow: 0 2px 10px rgba(76, 110, 245, 0.1);
}
.cmm-kpi .v { font-size: 28px; font-weight: 700; color: var(--c-text); line-height: 1.2; }
.cmm-kpi .l { font-size: 12px; color: var(--c-text3); margin-top: 4px; }
.cmm-kpi .ico {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.cmm-kpi.blue .ico   { background: #edf2ff; color: #4c6ef5; }
.cmm-kpi.green .ico  { background: #e6fcf5; color: #12b886; }
.cmm-kpi.orange .ico { background: #fff4e6; color: #fd7e14; }
.cmm-kpi.red .ico    { background: #fff5f5; color: #fa5252; }

.cmm-chart-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 900px) { .cmm-chart-row { grid-template-columns: 1fr; } }
.cmm-chart-box { width: 100%; min-height: 280px; }

html.gy-in-iframe .gy-wrap { padding: 12px 14px; box-sizing: border-box; }

html.kf-workspace .gy-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
html.kf-workspace .gy-panel > .layui-table-view {
    flex: 1 1 auto;
    min-height: 0;
}

html.kf-workspace .layui-table-view .layui-table,
html.gy-in-iframe .layui-table-view .layui-table {
    table-layout: auto !important;
}

/* —— 测试活动流 —— */
.cmm-flow-panel {
    background: #fff;
    border: 1px solid var(--c-border2, #e8eef4);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.cmm-flow-panel.compact { padding: 10px 12px; }
.cmm-flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.cmm-flow-head h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; color: #1e293b; }
.cmm-flow-head p { font-size: 11px; color: #94a3b8; margin: 0; }
.cmm-flow-meta { display: flex; gap: 14px; font-size: 12px; color: #64748b; }
.cmm-flow-meta strong { color: #4c6ef5; font-size: 16px; margin-left: 4px; }
.cmm-flow-steps { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.cmm-flow-step { display: flex; align-items: center; flex: 1; min-width: 110px; }
.cmm-flow-step-num {
    width: 28px; height: 28px; border-radius: 50%; background: #edf2ff; color: #4c6ef5;
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.cmm-flow-step-body { margin-left: 8px; min-width: 0; }
.cmm-flow-step-label { font-size: 11px; color: #64748b; white-space: nowrap; }
.cmm-flow-step-count { font-size: 20px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.cmm-flow-arrow { color: #cbd5e1; font-size: 16px; padding: 0 8px; flex-shrink: 0; }

/* 流程步骤条（表格行内） */
.cmm-wf-bar { display: flex; align-items: center; gap: 2px; min-width: 200px; }
.cmm-wf-node {
    flex: 1; height: 6px; border-radius: 3px; background: #e2e8f0; position: relative;
}
.cmm-wf-node.done { background: #4c6ef5; }
.cmm-wf-node.current { background: #fab005; box-shadow: 0 0 0 2px #fff4e6; }
.cmm-wf-label { font-size: 11px; margin-top: 4px; color: #475569; white-space: nowrap; }
.cmm-wf-label .tag {
    display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600;
}
.cmm-wf-label .tag.gray { background: #f1f5f9; color: #64748b; }
.cmm-wf-label .tag.blue { background: #edf2ff; color: #4c6ef5; }
.cmm-wf-label .tag.cyan { background: #e6fffb; color: #08979c; }
.cmm-wf-label .tag.orange { background: #fff4e6; color: #fd7e14; }
.cmm-wf-label .tag.green { background: #e6fcf5; color: #12b886; }
.cmm-wf-label .tag.red { background: #fff5f5; color: #fa5252; }

/* —— 合规中心 —— */
.cmm-comp-summary { padding: 14px; margin-bottom: 12px; }
.cmm-comp-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 1100px) { .cmm-comp-summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .cmm-comp-summary-grid { grid-template-columns: 1fr; } }
.cmm-comp-card {
    border-radius: 10px; padding: 14px 16px; border: 1px solid #e8eef4; background: #fff;
}
.cmm-comp-card .t { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.cmm-comp-card .v { font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 8px; }
.cmm-comp-card .d { font-size: 11px; color: #94a3b8; line-height: 1.5; }
.cmm-comp-card.danger .v { color: #fa5252; }
.cmm-comp-card.warn .v { color: #fd7e14; }
.cmm-comp-card.lock .v { color: #845ef7; }
.cmm-comp-card.info .v { color: #4c6ef5; }
.cmm-comp-tabs .layui-tab-title { padding: 0 12px; }
.cmm-tab-badge {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
    background: #edf2ff; color: #4c6ef5; border-radius: 10px; font-size: 10px; line-height: 18px;
}
.cmm-tier { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.cmm-tier-overdue { background: #fff5f5; color: #fa5252; }
.cmm-tier-d7 { background: #fff4e6; color: #fd7e14; }
.cmm-tier-d15 { background: #fff9db; color: #fab005; }
.cmm-tier-d30 { background: #edf2ff; color: #4c6ef5; }
.cmm-empty { text-align: center; color: #94a3b8 !important; padding: 24px !important; }

/* 近期活动 */
.cmm-activity-list { display: flex; flex-direction: column; gap: 8px; }
.cmm-activity-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border: 1px solid #e8eef4; border-radius: 8px; background: #fafcff;
    cursor: pointer; transition: border-color .15s;
}
.cmm-activity-item:hover { border-color: #bac8ff; }
.cmm-activity-item .left { min-width: 0; }
.cmm-activity-item .id { font-size: 12px; font-weight: 600; color: #334155; }
.cmm-activity-item .meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.cmm-flow-step.clickable { cursor: pointer; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; transition: background .15s; }
.cmm-flow-step.clickable:hover { background: #f8fafc; }
.cmm-flow-step.clickable.active { background: #edf2ff; }
.cmm-flow-step.clickable.active .cmm-flow-step-num { background: #4c6ef5; color: #fff; }

.cmm-wf-bar.mini { min-width: 160px; max-width: 280px; }
.cmm-wf-bar.mini .cmm-wf-node { height: 5px; }

.cmm-timeline { padding: 8px 0 4px 8px; border-left: 2px solid #e2e8f0; margin-left: 8px; }
.cmm-timeline-item { position: relative; padding: 0 0 14px 18px; }
.cmm-timeline-item:last-child { padding-bottom: 0; }
.cmm-timeline-dot {
    position: absolute; left: -25px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
    background: #cbd5e1; border: 2px solid #fff; box-shadow: 0 0 0 1px #e2e8f0;
}
.cmm-timeline-item.done .cmm-timeline-dot { background: #4c6ef5; }
.cmm-timeline-item.current .cmm-timeline-dot { background: #fab005; box-shadow: 0 0 0 3px #fff4e6; }
.cmm-timeline-title { font-size: 13px; font-weight: 600; color: #334155; }
.cmm-timeline-time { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.cmm-timeline-desc { font-size: 12px; color: #64748b; margin-top: 4px; }

.cmm-kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; min-height: 420px; }
.cmm-kanban-col { flex: 0 0 220px; background: #f8fafc; border: 1px solid #e8eef4; border-radius: 10px; display: flex; flex-direction: column; max-height: 70vh; }
.cmm-kanban-head { padding: 10px 12px; font-size: 12px; font-weight: 600; color: #475569; border-bottom: 1px solid #e8eef4; display: flex; justify-content: space-between; }
.cmm-kanban-head span { background: #edf2ff; color: #4c6ef5; padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.cmm-kanban-cards { padding: 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cmm-kanban-card { background: #fff; border: 1px solid #e8eef4; border-radius: 8px; padding: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cmm-kanban-card:hover { border-color: #bac8ff; box-shadow: 0 2px 8px rgba(76,110,245,.08); }
.cmm-kanban-card .id { font-size: 11px; color: #4c6ef5; font-weight: 600; }
.cmm-kanban-card .title { font-size: 12px; color: #334155; margin: 4px 0; font-weight: 600; }
.cmm-kanban-card .meta { font-size: 10px; color: #94a3b8; }
.cmm-kanban-empty { text-align: center; color: #cbd5e1; font-size: 12px; padding: 20px 0; }

.cmm-accept-bar { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.cmm-accept-track { flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; min-width: 60px; }
.cmm-accept-fill { height: 100%; background: linear-gradient(90deg, #4c6ef5, #12b886); border-radius: 3px; }

.cmm-accept-dims { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cmm-accept-dim { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.cmm-accept-dim.skip { background: #f1f5f9; color: #94a3b8; }
.cmm-accept-dim.pending { background: #fff4e6; color: #fd7e14; }
.cmm-accept-dim.done { background: #e6fcf5; color: #12b886; }

.cmm-report-timeline { background: #fff; border: 1px solid #e8eef4; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.cmm-report-timeline h4 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: #1e293b; }
