/* ---------- 2. 仪表盘紧凑统计卡与明细抽屉 ---------- */
.director-stat-row .stat-card {
    height: 100%;
    min-height: 0 !important;
    cursor: default;
}
.director-stat-row .stat-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px 20px;
}
.director-stat-row .stat-card .stat-value { font-size: 30px; margin-bottom: 6px; }
.stat-detail-btn {
    margin-top: auto;
    align-self: flex-start;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
}
.stat-drawer .offcanvas-body { padding: 8px 20px 20px; }
.stat-drawer .active-staff-hover-list,
.stat-drawer .active-project-hover-list,
.stat-drawer .department-workday-hover-list,
.stat-drawer .department-year-workday-hover-list {
    display: block;
    margin: 0;
    max-height: none;
    overflow: visible;
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.6;
}
.stat-drawer .active-staff-group,
.stat-drawer .active-project-group,
.stat-drawer .department-workday-group,
.stat-drawer .department-year-workday-group {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}
.stat-drawer .active-staff-role,
.stat-drawer .active-project-stage,
.stat-drawer .department-workday-type,
.stat-drawer .department-year-workday-type { color: var(--ink); font-weight: 600; }
html[data-theme="dark"] .offcanvas { background: var(--surface); color: var(--ink); }

/* ---------- 3. 登录页行业意象与项目数字 ---------- */
.login-brand { position: relative; }
.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/assets/img/login-industry.svg') center bottom / cover no-repeat;
    opacity: .20;
    pointer-events: none;
}
.login-brand .brand-content { position: relative; z-index: 1; }
.brand-stats {
    display: flex;
    gap: 26px;
    margin: 0 0 18px;
    padding: 14px 0 0;
    border-top: 1px solid rgba(255,255,255,.18);
}
.brand-stat b {
    display: block;
    font-family: var(--font-num);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.1;
    color: rgba(255,255,255,.96);
}
.brand-stat span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: rgba(255,255,255,.62);
    letter-spacing: .04em;
}
@media (max-width: 992px) { .brand-stats { display: none; } }

/* ---------- 4. 表格列配置 ---------- */
.ui-col-config { position: relative; display: inline-flex; }
.ui-col-config-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 2100;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15,23,42,.14);
}
.ui-col-config-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 7px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
}
.ui-col-config-menu label:hover { background: var(--surface-inset); }

/* ---------- 5. 命令面板自然语言结果 ---------- */
.ui-cmd-answer {
    margin: 10px 12px 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-inset);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.6;
}
.ui-cmd-answer b { font-weight: 700; }
.ui-cmd-answer .ui-cmd-answer-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ui-cmd-answer .ui-cmd-answer-links a { font-size: 12px; }

/* ---------- 6. Toast 可撤销操作 ---------- */
.ui-toast-action {
    margin-left: 10px;
    padding: 2px 8px;
    border: 1px solid currentColor;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font-size: 12px;
    cursor: pointer;
}
.ui-toast-action:hover { background: rgba(255,255,255,.16); }

/* ---------- 7. 工天填报页 v2 安全重构 ---------- */
#wdWorkbench {
    --wd-primary: var(--accent, #12507C);
    --wd-primary-dark: var(--primary-dark, #0E3F63);
    --wd-primary-soft: var(--primary-soft, #E7EFF3);
    --wd-primary-line: var(--primary-line, #B8D2E3);
    --wd-ink: var(--ink, #152230);
    --wd-ink-2: var(--ink-2, #4A5A6B);
    --wd-ink-3: var(--ink-3, #607386);
    --wd-line: var(--line, #E3E6E4);
    --wd-line-soft: var(--line-soft, #EEF0ED);
    --wd-panel: var(--bg-white, #FFFFFF);
    --wd-panel-bg: var(--panel-bg, #F0F2EF);
    --wd-page: var(--page-bg, #F7F8F6);
    --wd-warn: var(--warn, #A2542A);
    --wd-warn-soft: var(--warn-soft, #F6ECE3);
    --wd-ok: var(--ok, #3F6B4F);
    --wd-ok-soft: var(--ok-soft, #EAF0EA);
    --wd-danger: var(--danger, #8C3A2B);
    font-variant-numeric: tabular-nums;
}
#wdWorkbench [hidden] { display: none !important; }

#wdWorkbench .wd-toolbar {
    min-height: 52px; display: flex; align-items: center; gap: 12px;
    padding: 8px 16px; background: var(--wd-panel); border-bottom: 1px solid var(--wd-line);
}
#wdWorkbench .wd-month {
    flex: 0 0 auto; display: inline-flex; align-items: stretch; height: 34px;
    border: 1px solid var(--wd-line); border-radius: 6px; overflow: hidden; background: var(--wd-panel);
}
#wdWorkbench .wd-month-arrow {
    display: inline-flex; align-items: center; justify-content: center; width: 30px;
    color: var(--wd-ink-2); text-decoration: none; font-size: 18px; line-height: 1;
}
#wdWorkbench .wd-month-arrow:hover { background: var(--wd-panel-bg); color: var(--wd-primary); }
#wdWorkbench .wd-month-arrow:first-child { border-right: 1px solid var(--wd-line); }
#wdWorkbench .wd-month-arrow:last-child { border-left: 1px solid var(--wd-line); }
#wdWorkbench .wd-month-label {
    display: inline-flex; align-items: center; padding: 0 12px; font-size: 13.5px;
    font-weight: 600; color: var(--wd-ink); white-space: nowrap;
}
#wdWorkbench .wd-cats { flex: 1 1 auto; display: flex; align-items: center; gap: 2px; overflow-x: auto; white-space: nowrap; }
#wdWorkbench .wd-cat {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 10px; border: 1px solid transparent; border-radius: 4px;
    background: transparent; color: var(--wd-ink-2); font-size: 13.5px; line-height: 1.2;
}
#wdWorkbench .wd-cat:hover { background: var(--wd-panel-bg); }
#wdWorkbench .wd-cat.is-active { background: var(--wd-primary-soft); color: var(--wd-primary); font-weight: 600; border-color: var(--wd-primary-line); }
#wdWorkbench .wd-cat-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px;
    padding: 0 5px; border-radius: 9px; background: var(--wd-ok-soft); color: var(--wd-ok);
    font-size: 11px; font-style: normal; font-weight: 600;
}
#wdWorkbench .wd-cat.is-active .wd-cat-count { background: var(--wd-primary); color: #fff; }
#wdWorkbench .wd-more-wrap { position: relative; flex: 0 0 auto; }
#wdWorkbench .wd-more {
    width: 32px; height: 32px; border: 1px solid var(--wd-line); border-radius: 6px;
    background: var(--wd-panel); color: var(--wd-ink-2); font-size: 18px; line-height: 1; cursor: pointer;
}
#wdWorkbench .wd-more:hover { border-color: var(--wd-primary-line); color: var(--wd-primary); }
#wdWorkbench .wd-more-menu {
    position: absolute; z-index: 1060; right: 0; top: calc(100% + 6px); min-width: 208px;
    padding: 5px; border: 1px solid var(--wd-line); border-radius: 6px; background: var(--wd-panel);
    box-shadow: 0 8px 24px rgba(21,34,48,.12);
}
#wdWorkbench .wd-more-menu a,
#wdWorkbench .wd-more-menu button {
    display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 4px;
    background: transparent; color: var(--wd-ink); font-size: 13px; text-align: left; text-decoration: none;
}
#wdWorkbench .wd-more-menu a:hover,
#wdWorkbench .wd-more-menu button:hover { background: var(--wd-panel-bg); color: var(--wd-primary); }

#wdWorkbench .wd-summary {
    display: flex; align-items: center; flex-wrap: wrap; gap: 16px; min-height: 32px;
    padding: 8px 16px; background: var(--wd-panel); border-bottom: 1px solid var(--wd-line);
    font-size: 12.5px; color: var(--wd-ink-3);
}
#wdWorkbench .wd-k { color: var(--wd-ink-3); }
#wdWorkbench .wd-v { color: var(--wd-ink); font-weight: 600; font-size: 13.5px; }
#wdWorkbench .wd-delta { font-style: normal; font-weight: 600; }
#wdWorkbench .wd-delta.is-up { color: var(--wd-ok); }
#wdWorkbench .wd-delta.is-down { color: var(--wd-warn); }
#wdWorkbench .wd-divider { width: 1px; height: 16px; background: var(--wd-line); }
#wdWorkbench .wd-mix { display: flex; align-items: center; gap: 7px; }
#wdWorkbench .wd-mixbar { display: flex; width: 120px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--wd-panel-bg); }
#wdWorkbench .wd-mixbar i { display: block; height: 100%; }
#wdWorkbench .wd-mixbar .wd-b1 { background: var(--wd-primary); }
#wdWorkbench .wd-mixbar .wd-b2 { background: #5B8FA8; }
#wdWorkbench .wd-mixbar .wd-b3 { background: #9FBBC9; }

#wdWorkbench .wd-note-row { display: flex; align-items: center; gap: 16px; padding: 10px 16px 0; }
#wdWorkbench .wd-note-row p { max-width: 74ch; margin: 0; color: var(--wd-ink-3); font-size: 12.5px; line-height: 1.6; }
#wdWorkbench .wd-note-row .btn { flex: 0 0 auto; min-height: 28px; padding: 3px 12px; border-radius: 6px; }

#wdWorkbench .wd-table-wrap {
    margin: 10px 16px 0; background: var(--wd-panel); border: 1px solid var(--wd-line);
    border-radius: 6px; overflow: auto; max-height: calc(100vh - 330px);
}
#wdWorkbench .wd-table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13.5px; }
#wdWorkbench .wd-table th,
#wdWorkbench .wd-table td { padding: 0 10px; border-bottom: 1px solid var(--wd-line-soft); }
#wdWorkbench .wd-table thead th {
    position: sticky; top: 0; z-index: 2; height: 36px; background: var(--wd-panel-bg); text-align: left;
    color: var(--wd-ink-2); font-size: 12.5px; font-weight: 500; border-bottom: 1px solid var(--wd-line); white-space: nowrap;
}
#wdWorkbench .wd-table .wd-col-name { width: auto; }
#wdWorkbench .wd-table .wd-col-role { width: 92px; }
#wdWorkbench .wd-table .wd-col-num { width: 112px; text-align: right; }
#wdWorkbench .wd-table th:last-child,
#wdWorkbench .wd-table td:last-child { width: 100px; }
#wdWorkbench .wd-table tbody td { height: 42px; color: var(--wd-ink); background: var(--wd-panel); }
#wdWorkbench .wd-table tbody tr:hover td { background: #FAFBF9; }
#wdWorkbench .wd-table .wd-cell-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
#wdWorkbench .wd-table .wd-code { color: var(--wd-ink-2); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; font-weight: 400; }
#wdWorkbench .wd-table .wd-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wdWorkbench .wd-table .wd-role {
    display: inline-block; padding: 1px 8px; border-radius: 10px;
    background: var(--wd-primary-soft); color: var(--wd-primary); font-size: 12px; font-weight: 500;
}
#wdWorkbench .wd-table .wd-role-none { background: var(--wd-panel-bg); color: var(--wd-ink-3); font-weight: 400; }
#wdWorkbench .wd-table .wd-row-total { font-weight: 600; }
#wdWorkbench .wd-table tfoot td {
    position: sticky; bottom: 0; z-index: 2; height: 40px; background: #FAFBFA;
    border-top: 1px solid var(--wd-line); border-bottom: 0; font-weight: 600; font-size: 13px;
}
#wdWorkbench .wd-table tfoot .wd-label { color: var(--wd-ink-2); font-weight: 500; }
#wdWorkbench .wd-table tfoot .wd-foot-total { color: var(--wd-primary); font-weight: 700; }
#wdWorkbench .wd-empty { padding: 40px 16px; text-align: center; color: var(--wd-ink-3); font-size: 13px; }
#wdWorkbench .wd-empty b { display: block; margin-bottom: 6px; color: var(--wd-ink); font-size: 14px; font-weight: 600; }

#wdWorkbench .wd-overview { margin: 14px 16px 0; }
#wdWorkbench .wd-overview-title { margin-bottom: 8px; color: var(--wd-ink-3); font-size: 12.5px; }
#wdWorkbench .wd-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
#wdWorkbench .wd-grid-card {
    display: block; padding: 8px 10px; border: 1px solid var(--wd-line); border-radius: 6px;
    background: var(--wd-panel); text-align: left; cursor: pointer;
}
#wdWorkbench .wd-grid-card:hover { border-color: var(--wd-primary-line); background: var(--wd-primary-soft); }
#wdWorkbench .wd-grid-card.is-active { border-color: var(--wd-primary); box-shadow: inset 0 0 0 1px var(--wd-primary); }
#wdWorkbench .wd-grid-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--wd-ink-2); font-size: 12.5px; }
#wdWorkbench .wd-grid-top em { color: var(--wd-ink-3); font-size: 11.5px; font-style: normal; }
#wdWorkbench .wd-grid-value { display: block; margin-top: 4px; color: var(--wd-ink); font-size: 15px; font-weight: 600; }
#wdWorkbench .wd-grid-value.is-empty { color: var(--wd-ink-3); font-size: 13px; font-weight: 500; }

#wdWorkbench .wd-footer {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 14px 18px 26px; margin-top: auto; color: var(--wd-ink-3); font-size: 12.5px;
}
#wdWorkbench .wd-dot { width: 3px; height: 3px; border-radius: 50%; background: #C7D0D8; }
#wdWorkbench .wd-link { padding: 0; border: 0; background: transparent; color: var(--wd-primary); font-size: 12.5px; text-decoration: none; cursor: pointer; }
#wdWorkbench .wd-link:hover { text-decoration: underline; }
#wdWorkbench .wd-form-panel { margin: 14px 16px 0; border: 1px solid var(--wd-line); border-radius: 6px; background: var(--wd-panel); overflow: hidden; }
#wdWorkbench .wd-form-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px; border-bottom: 1px solid var(--wd-line-soft);
}
#wdWorkbench .wd-form-title { color: var(--wd-ink-2); font-size: 13px; font-weight: 600; }
#wdWorkbench .wd-form-title i { color: var(--wd-primary); margin-right: 6px; }
#wdWorkbench .wd-form-toggle {
    height: 28px; padding: 0 10px; border: 1px solid var(--wd-line); border-radius: 6px;
    background: var(--wd-panel); color: var(--wd-ink-2); font-size: 12.5px; cursor: pointer;
}
#wdWorkbench .wd-form-toggle:hover { border-color: var(--wd-primary-line); color: var(--wd-primary); }
#wdWorkbench .wd-form-body { padding: 12px; }
#wdWorkbench .wd-form-panel:not(.is-open) .wd-form-body { display: none; }
#wdWorkbench .wd-form-panel:not(.is-open) .wd-form-head { border-bottom: 0; }
#wdWorkbench #wdFormBody #workdayTabs { display: none; }
#wdWorkbench #wdFormBody .tab-content { padding: 0; }

#wdWorkbench .wd-unsaved {
    position: fixed; z-index: 1070; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 10px 16px; border-top: 1px solid var(--wd-line); background: var(--wd-panel);
    box-shadow: 0 -6px 20px -12px rgba(21,34,48,.25);
}
#wdWorkbench .wd-unsaved-label { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--wd-ink); font-size: 13px; }
#wdWorkbench .wd-unsaved-label em {
    display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px;
    padding: 1px 8px; border: 1px solid #E8CDBB; border-radius: 11px; background: var(--wd-warn-soft);
    color: var(--wd-warn); font-style: normal; font-size: 12px; font-weight: 600;
}
#wdWorkbench .wd-unsaved-list { display: flex; gap: 6px; flex: 1 1 240px; overflow-x: auto; padding: 2px 0; }
#wdWorkbench .wd-change {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 26px;
    padding: 0 10px; border: 1px solid var(--wd-line); border-radius: 13px;
    background: var(--wd-panel); color: var(--wd-ink-2); font-size: 12px; white-space: nowrap; cursor: pointer;
}
#wdWorkbench .wd-change:hover { border-color: var(--wd-primary-line); background: var(--wd-primary-soft); color: var(--wd-primary); }
#wdWorkbench .wd-change del { color: var(--wd-ink-3); }
#wdWorkbench .wd-change strong { color: var(--wd-ink); font-weight: 600; }
#wdWorkbench .wd-more-changes { flex: 0 0 auto; color: var(--wd-ink-3); font-size: 12px; }
#wdWorkbench .wd-unsaved-actions { display: flex; gap: 8px; flex: 0 0 auto; }
#wdWorkbench .wd-unsaved-actions .btn { min-height: 32px; border-radius: 6px; }
#wdWorkbench .wd-unsaved-actions .btn-primary { background: var(--wd-primary); border-color: var(--wd-primary); color: #fff; }
.wd-mini-toast {
    position: fixed; z-index: 1090; left: 50%; bottom: 74px; transform: translateX(-50%);
    padding: 9px 14px; border-radius: 6px; background: var(--wd-ink, #152230); color: #fff; font-size: 13px;
}

#wdWorkbench .wd-note-row { align-items: flex-start; }
#wdWorkbench .wd-note-row .btn-primary { background: var(--wd-primary); border-color: var(--wd-primary); color: #fff; }
#wdWorkbench .wd-note-row .btn-primary:hover { background: var(--wd-primary-dark); border-color: var(--wd-primary-dark); }
#wdWorkbench .wd-month-label { min-width: 106px; justify-content: center; }

@media (max-width: 1180px) {
    #wdWorkbench .wd-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    #wdWorkbench .wd-toolbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
    #wdWorkbench .wd-month-arrow { width: 40px; height: 40px; }
    #wdWorkbench .wd-month { height: 40px; }
    #wdWorkbench .wd-month-label { height: 40px; min-width: 96px; }
    #wdWorkbench .wd-cats { order: 9; flex: 1 0 100%; }
    #wdWorkbench .wd-more { order: 2; margin-left: auto; width: 38px; height: 38px; }
    #wdWorkbench .wd-more-menu { min-width: 200px; }
    #wdWorkbench .wd-summary { padding: 8px 12px; gap: 10px; }
    #wdWorkbench .wd-mixbar { width: 84px; }
    #wdWorkbench .wd-note-row { padding: 10px 12px 0; flex-wrap: wrap; }
    #wdWorkbench .wd-note-row .btn,
    #wdWorkbench .wd-unsaved-actions .btn { min-height: 38px; }
    #wdWorkbench .wd-table-wrap { margin-left: 12px; margin-right: 12px; max-height: none; }
    #wdWorkbench .wd-table tbody td { height: 46px; }
    #wdWorkbench .wd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #wdWorkbench .wd-overview,
    #wdWorkbench .wd-footer,
    #wdWorkbench .wd-form-panel { margin-left: 12px; margin-right: 12px; }
    #wdWorkbench .wd-footer { padding: 8px 12px 20px; }
    #wdWorkbench .wd-unsaved { padding: 10px 12px; }
    #wdWorkbench .wd-unsaved-list { order: 5; flex: 1 0 100%; }
}
@media (max-width: 520px) {
    #wdWorkbench .wd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    #wdWorkbench *, #wdWorkbench *::before, #wdWorkbench *::after { transition: none !important; animation: none !important; }
}


/* ---------- 查看与操作便利性：排序提示、固定首列、只读抽屉 ---------- */
table[data-ui-sort] thead th.sortable{cursor:pointer;user-select:none;position:relative}
table[data-ui-sort] thead th.sortable::after{content:"\2195";font-size:10px;opacity:.45;margin-left:6px}
table[data-ui-sort] thead th.sortable.sorted::after{content:"\2193";opacity:.9;color:var(--accent)}
table[data-ui-sort] thead th.sortable.sorted.sorted-asc::after{content:"\2191"}
.ui-table.ui-sticky-first th:first-child,.ui-table.ui-sticky-first td:first-child{position:sticky;left:0;z-index:3;background:var(--surface-2)}
.ui-table.ui-sticky-first thead th:first-child{z-index:5}
.construction-volumes-responsive{max-height:calc(100vh - 320px);overflow:auto}
.ui-readonly-drawer .offcanvas-body{padding:16px 20px}
.ui-readonly-list{margin:0}
.ui-readonly-list>div{padding:10px 0;border-bottom:1px solid var(--line)}
.ui-readonly-list>div:last-child{border-bottom:0}
.ui-readonly-list dt{font-size:12px;color:var(--ink-3);margin-bottom:3px}
.ui-readonly-list dd{margin:0;font-size:14px;color:var(--ink);word-break:break-word}
.ui-nav-cmd-btn{white-space:nowrap}


/* ---------- B3：施工图项目卡页内展开 ---------- */
.project-inline-detail{padding:4px 0 12px;border-bottom:1px dashed var(--line);margin-bottom:12px}
.project-inline-summary{cursor:pointer}


/* ---------- B1：接排序后保持深色表头原配色（ui-table 浅底不覆写 table-dark） ---------- */
table[data-ui-sort] thead.table-dark th,
table[data-ui-sort] thead.table-dark th.sortable{background:var(--bs-table-bg,var(--ink));color:var(--bs-table-color,var(--surface-2))}
table[data-ui-sort] thead.table-dark th.sortable:hover{background:var(--bs-table-bg,var(--ink));color:#fff}
.ui-table.ui-sticky-first thead.table-dark th:first-child{background:var(--bs-table-bg,var(--ink));z-index:5}
