/* ============ 全局 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #0a0e1a; color: #cfd6e4; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
body { background:
    radial-gradient(1200px 600px at 20% -10%, rgba(30,80,180,.18), transparent),
    radial-gradient(900px 500px at 90% 10%, rgba(120,40,200,.12), transparent),
    #0a0e1a;
    min-height: 100vh;
}
.dashboard { padding: 14px 18px 18px; max-width: 1480px; margin: 0 auto; }

/* ============ 顶栏 ============ */
.top-bar {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 18px;
    background: linear-gradient(180deg, rgba(20,30,55,.85), rgba(15,22,40,.85));
    border: 1px solid rgba(80,130,220,.18);
    border-radius: 12px;
    margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 340px; }
.brand .logo { font-size: 24px; }
.brand .title { font-size: 18px; font-weight: 600; color: #e6ecff; letter-spacing: 1px; }

.filters { display: flex; gap: 10px; flex: 1; }
.filter {
    display: flex; align-items: center; gap: 6px;
    background: rgba(20,32,60,.7);
    border: 1px solid rgba(80,130,220,.18);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
}
.filter .lbl { color: #8a98b8; }
.filter select {
    background: transparent; border: none; color: #cfd6e4;
    outline: none; font-size: 12px; cursor: pointer; min-width: 110px;
}
.filter select option { background: #0f1830; color: #cfd6e4; }

.actions { display: flex; align-items: center; gap: 10px; }
.btn-refresh {
    background: linear-gradient(180deg, #2a73ff, #1c4dcc);
    border: none; color: #fff; padding: 6px 14px;
    border-radius: 8px; cursor: pointer; font-size: 12px;
    display: flex; align-items: center; gap: 5px;
    box-shadow: 0 0 12px rgba(42,115,255,.4);
}
.btn-refresh:hover { filter: brightness(1.1); }
.btn-refresh.spinning .r-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auto-toggle { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #8a98b8; }
.auto-toggle select { background: rgba(20,32,60,.7); color: #cfd6e4; border: 1px solid rgba(80,130,220,.18); border-radius: 6px; padding: 2px 6px; font-size: 12px; outline: none; }
.auto-toggle input { accent-color: #2a73ff; }

.clock {
    font-family: "Consolas", monospace; font-size: 16px;
    color: #5fc8ff; padding: 4px 12px;
    background: rgba(20,32,60,.7);
    border: 1px solid rgba(80,130,220,.18);
    border-radius: 8px; min-width: 100px; text-align: center;
}

/* ============ 统计卡片 ============ */
.stats-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card {
    background: linear-gradient(180deg, rgba(20,30,55,.85), rgba(15,22,40,.85));
    border: 1px solid rgba(80,130,220,.18);
    border-radius: 12px;
    padding: 14px 16px;
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #2a73ff, transparent);
}
.stat-card.success::before { background: linear-gradient(90deg, transparent, #2ed47a, transparent); }
.stat-card.danger::before  { background: linear-gradient(90deg, transparent, #ff5b5b, transparent); }
.stat-label { font-size: 12px; color: #8a98b8; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: #e6ecff; font-family: "Consolas", monospace; }
.stat-card.success .stat-value { color: #2ed47a; }
.stat-card.danger .stat-value { color: #ff6b6b; }
.stat-foot { font-size: 11px; color: #5a6480; margin-top: 4px; }

/* ============ 通用面板 ============ */
.panel {
    background: linear-gradient(180deg, rgba(20,30,55,.85), rgba(15,22,40,.85));
    border: 1px solid rgba(80,130,220,.18);
    border-radius: 12px;
    padding: 12px 16px 14px;
    margin-bottom: 14px;
    position: relative;
}
.panel-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: #cfd6e4; font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(80,130,220,.18);
}
.panel-title span.err { color: #ff6b6b; }
.panel-title small { font-weight: normal; font-size: 12px; color: #5a6480; }
.panel-title .btn-mini { margin-left: auto; background: transparent; color: #5fc8ff; border: 1px solid rgba(95,200,255,.4); border-radius: 6px; padding: 2px 8px; font-size: 11px; cursor: pointer; }

.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart { height: 280px; }
.queue-panel .chart { height: 360px; }

/* ============ Tab ============ */
.tab-group { display: flex; gap: 4px; margin-left: auto; }
.tab {
    padding: 3px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
    color: #8a98b8; background: rgba(20,32,60,.5);
    border: 1px solid transparent;
}
.tab.active { background: rgba(42,115,255,.2); color: #5fc8ff; border-color: rgba(95,200,255,.4); }
.tab:hover { color: #cfd6e4; }

/* ============ 表格 ============ */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: left; color: #5a6480; font-weight: normal; padding: 8px 6px; border-bottom: 1px solid rgba(80,130,220,.18); white-space: nowrap; }
.data-table td { padding: 10px 6px; border-bottom: 1px solid rgba(80,130,220,.08); color: #cfd6e4; }
.data-table tbody tr:hover { background: rgba(42,115,255,.06); }
.data-table .tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.data-table .tag.dept { background: rgba(42,115,255,.15); color: #5fc8ff; }
.data-table .tag.status-running { background: rgba(95,200,255,.18); color: #5fc8ff; }
.data-table .tag.status-success { background: rgba(46,212,122,.18); color: #2ed47a; }
.data-table .tag.status-failed { background: rgba(255,107,107,.18); color: #ff6b6b; }

/* ============ 失败任务明细 专用样式 ============ */
.proc-icon { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 13px; margin-right: 6px; filter: saturate(1.2); }
.proc-name { color: #cfd6e4; }
.fail-cell { display: inline-flex; align-items: center; gap: 6px; color: #cfd6e4; }
.warn-icon { color: #ffae3a; font-size: 14px; filter: drop-shadow(0 0 4px rgba(255,174,58,.6)); }
.fail-cell .hl { color: #ff8a4a; font-weight: 600; background: rgba(255,138,74,.08); padding: 0 3px; border-radius: 3px; }

/* ============ 各部门执行统计 专用样式 ============ */
.num-cell { font-family: "Consolas", monospace; font-size: 13px; font-weight: 600; text-align: center; }
.num-cell.success-num { color: #2ed47a; }
.num-cell.failed-num { color: #ff6b6b; }
.proc-link { color: #5fc8ff; text-decoration: none; cursor: pointer; }
.proc-link:hover { color: #8ad8ff; text-decoration: underline; }
.proc-link .more-link { color: #ff8a4a; font-size: 11px; margin-left: 2px; }

.progress { position: relative; height: 8px; background: rgba(20,32,60,.8); border-radius: 4px; overflow: hidden; }
.progress .bar { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #2a73ff, #5fc8ff); border-radius: 4px; transition: width .3s; }
.progress .pct { position: absolute; right: 0; top: -16px; font-size: 11px; color: #5fc8ff; }
.progress.fail .bar { background: linear-gradient(90deg, #ff5b5b, #ff8a4a); }

.rate-bar { display: flex; align-items: center; gap: 6px; }
.rate-bar .bar { flex: 1; height: 6px; background: rgba(20,32,60,.8); border-radius: 3px; overflow: hidden; }
.rate-bar .fill { height: 100%; border-radius: 3px; transition: width .3s; }
.rate-bar.green .fill { background: linear-gradient(90deg, #2ed47a, #5fe89a); }
.rate-bar.orange .fill { background: linear-gradient(90deg, #ffae3a, #ffd46b); }
.rate-bar.red .fill { background: linear-gradient(90deg, #ff5b5b, #ff8a4a); }
.rate-bar .val { font-size: 11px; color: #cfd6e4; min-width: 42px; text-align: right; font-family: "Consolas", monospace; font-weight: 600; }
.rate-bar.green .val { color: #2ed47a; }
.rate-bar.orange .val { color: #ffae3a; }
.rate-bar.red .val { color: #ff6b6b; }
.link { color: #5fc8ff; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ============ 分页 ============ */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; color: #8a98b8; }
.pager-left { display: flex; align-items: center; gap: 12px; }
.pager-btns { display: flex; gap: 4px; align-items: center; }
.pager-btns button { background: rgba(20,32,60,.7); border: 1px solid rgba(80,130,220,.18); color: #cfd6e4; padding: 3px 9px; border-radius: 4px; cursor: pointer; font-size: 12px; min-width: 26px; line-height: 1.4; }
.pager-btns button.active { background: rgba(42,115,255,.35); color: #fff; border-color: rgba(95,200,255,.6); font-weight: 600; box-shadow: 0 0 6px rgba(42,115,255,.4); }
.pager-btns button:disabled { opacity: .35; cursor: not-allowed; }
.pager-btns button:hover:not(:disabled):not(.active) { background: rgba(42,115,255,.18); color: #5fc8ff; }
.pager-btns .pg-arrow { color: #8a98b8; }
.pager-btns .pg-dots { color: #5a6480; padding: 0 4px; user-select: none; }
.pg-size { background: rgba(20,32,60,.7); border: 1px solid rgba(80,130,220,.18); color: #cfd6e4; padding: 3px 6px; border-radius: 4px; font-size: 12px; cursor: pointer; outline: none; }
.pg-size:hover { border-color: rgba(95,200,255,.5); }
.pager-jump { display: flex; align-items: center; gap: 6px; color: #8a98b8; }
.pager-jump input { width: 44px; background: rgba(20,32,60,.7); border: 1px solid rgba(80,130,220,.18); color: #cfd6e4; padding: 3px 6px; border-radius: 4px; font-size: 12px; text-align: center; outline: none; -moz-appearance: textfield; }
.pager-jump input::-webkit-outer-spin-button, .pager-jump input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pager-jump input:focus { border-color: rgba(95,200,255,.6); }
.pg-info { color: #8a98b8; }

/* ============ 弹窗 ============ */
.modal-mask {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55);
    z-index: 100; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
    background: linear-gradient(180deg, #15203c, #0e1730);
    border: 1px solid rgba(95,200,255,.3);
    border-radius: 12px;
    width: 520px; max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.modal-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid rgba(80,130,220,.18);
    font-size: 14px; color: #5fc8ff; font-weight: 600;
}
.modal-close { cursor: pointer; color: #8a98b8; font-size: 20px; }
.modal-close:hover { color: #ff6b6b; }
.modal-body { padding: 8px 0; overflow: auto; }
.modal-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; font-size: 13px; border-bottom: 1px solid rgba(80,130,220,.08);
}
.modal-row:hover { background: rgba(42,115,255,.06); }
.modal-row .name { color: #cfd6e4; display: flex; align-items: center; gap: 6px; }
.modal-row .count { background: rgba(42,115,255,.18); color: #5fc8ff; padding: 2px 10px; border-radius: 12px; font-size: 11px; }
.modal-pager { padding: 10px 16px; border-top: 1px solid rgba(80,130,220,.18); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8a98b8; }

/* ============ 底部 ============ */
.footer { text-align: right; font-size: 11px; color: #5a6480; margin-top: 8px; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(80,130,220,.3); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
