/* ============================================================
   采购付款申请单系统 · 设计系统
   超盈精密 · 精密蓝金
   布局：左侧边栏 + 顶栏 + 内容区
   ============================================================ */

/* ---------- 设计 token ---------- */
:root {
    /* 品牌 —— Element Plus 主蓝 */
    --primary: #409eff;
    --primary-300: #79bbff;      /* light-3：hover */
    --primary-600: #337ecc;      /* dark-2：active / 深色文字 */
    --primary-700: #2b6cb0;
    --primary-50: #ecf5ff;       /* light-9：最浅底 */
    --primary-100: #d9ecff;      /* light-8 */
    --accent: #e6a23c;
    --accent-50: #fdf6ec;

    /* 侧边栏（浅色，Element Plus 经典观感） */
    --side-bg: #ffffff;
    --side-bg-2: #ffffff;
    --side-text: #303133;
    --side-text-hi: #409eff;
    --side-active-bg: #ecf5ff;
    --side-border: #e4e7ed;
    --side-width: 232px;
    --side-width-collapsed: 68px;

    /* 语义 —— Element Plus 标准色 */
    --success: #67c23a;
    --success-50: #f0f9eb;
    --warning: #e6a23c;
    --warning-50: #fdf6ec;
    --danger: #f56c6c;
    --danger-50: #fef0f0;
    --info: #909399;
    --info-50: #f4f4f5;

    /* 中性 —— Element Plus 文字/边框阶梯 */
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --text: #303133;
    --text-2: #606266;
    --text-3: #909399;
    --border: #ebeef5;
    --border-strong: #dcdfe6;

    /* 尺寸 —— Element Plus 圆角基准 4px */
    --r-sm: 2px;
    --r: 4px;
    --r-lg: 8px;

    /* 阴影 —— Element Plus 层级 */
    --sh-xs: 0 1px 2px rgba(0, 0, 0, .04);
    --sh-sm: 0 2px 4px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --sh-md: 0 4px 12px rgba(0, 0, 0, .08);
    --sh-lg: 0 12px 32px 4px rgba(0, 0, 0, .04), 0 8px 20px rgba(0, 0, 0, .08);

    --topbar-h: 60px;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--primary-600); }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #dcdfe6; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c0c4cc; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   布局骨架
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: var(--side-width);
    flex-shrink: 0;
    background: var(--side-bg);
    border-right: 1px solid var(--side-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    transition: width .2s var(--ease);
}
.side-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid var(--side-border);
    overflow: hidden;
    white-space: nowrap;
}
.side-brand .mark {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, #79bbff, #409eff);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(64, 158, 255, .35);
}
.side-brand .mark svg { width: 17px; height: 17px; }
.side-brand .txt { display: flex; flex-direction: column; line-height: 1.25; }
.side-brand .txt b { color: var(--text); font-size: 14.5px; font-weight: 650; letter-spacing: .2px; }
.side-brand .txt span { color: var(--text-3); font-size: 10px; letter-spacing: 1.6px; font-weight: 600; }

.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { margin: 4px 0 6px; }
.nav-group-label {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: .6px;
    color: var(--text-3);
    text-transform: none;
    padding: 9px 10px 5px;
    background: none; border: none; cursor: pointer;
    font-family: inherit; text-align: left;
    transition: color .15s var(--ease);
}
.nav-group-label:hover { color: var(--text-2); }
.nav-group-label .chev {
    width: 13px; height: 13px; flex-shrink: 0; opacity: .75;
    transition: transform .18s var(--ease);
}
.nav-group.collapsed .nav-group-label .chev { transform: rotate(-90deg); }
.nav-group-body { display: block; }
.nav-group.collapsed .nav-group-body { display: none; }

.side-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; margin-bottom: 2px;
    border-radius: var(--r);
    color: var(--side-text);
    font-size: 14px; font-weight: 400;
    white-space: nowrap; overflow: hidden;
    position: relative;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.side-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; color: var(--text-3); }
.side-link:hover { background: var(--surface-2); color: var(--primary); }
.side-link:hover svg { color: var(--primary); }
.side-link.active {
    background: var(--side-active-bg);
    color: var(--side-text-hi);
    font-weight: 500;
}
.side-link.active svg { opacity: 1; color: var(--side-text-hi); }

.side-foot {
    padding: 12px;
    border-top: 1px solid var(--side-border);
}
.collapse-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px; border-radius: var(--r);
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-2); font-size: 12.5px; cursor: pointer;
    font-family: inherit;
    transition: background .15s var(--ease), color .15s var(--ease),
                border-color .15s var(--ease);
}
.collapse-btn:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.collapse-btn svg { width: 15px; height: 15px; }

/* 折叠态 */
body.side-collapsed .sidebar { width: var(--side-width-collapsed); }
body.side-collapsed .side-brand { padding: 0 18px; }
body.side-collapsed .side-brand .txt,
body.side-collapsed .side-link span,
body.side-collapsed .nav-group-label,
body.side-collapsed .collapse-btn span { display: none; }
body.side-collapsed .side-link { justify-content: center; padding: 10px; }
body.side-collapsed .nav-group .nav-group-body { display: block; }
body.side-collapsed .collapse-btn { justify-content: center; }
body.side-collapsed .main { margin-left: var(--side-width-collapsed); }

/* ---------- 主区 ---------- */
.main {
    flex: 1;
    margin-left: var(--side-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s var(--ease);
}

.topbar {
    height: var(--topbar-h);
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 16.5px; font-weight: 650; }
.topbar .crumb { color: var(--text-3); font-size: 12.5px; margin-left: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 22px 26px 44px; flex: 1; }

/* ---------- 页头 ---------- */
.page-head { margin-bottom: 18px; display: flex; align-items: flex-end; gap: 16px; }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.page-sub { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   用户菜单
   ============================================================ */
.user-chip {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 5px 10px 5px 5px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.user-chip:hover { border-color: var(--border-strong); box-shadow: var(--sh-xs); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #79bbff, #409eff);
    color: #fff; font-size: 12.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-chip .uname { font-weight: 600; color: var(--text); }
.role-badge {
    font-size: 11px; font-weight: 500;
    padding: 1px 7px; border-radius: var(--r);
    background: var(--primary-50); color: var(--primary);
    white-space: nowrap;
}
.user-wrap { position: relative; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 168px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh-lg);
    padding: 6px;
    display: none;
    z-index: 80;
}
.dropdown.show { display: block; animation: dropIn .16s var(--ease); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dropdown a {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: var(--r-sm);
    color: var(--text); font-size: 13.5px;
}
.dropdown a:hover { background: var(--surface-2); color: var(--primary); }
.dropdown a svg { width: 15px; height: 15px; color: var(--text-3); }
.dropdown a:hover svg { color: var(--primary); }
.dropdown .sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ============================================================
   卡片
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
.card-header {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.card-header h3 .ico,
.approval-section h4 .ico {
    width: 26px; height: 26px; border-radius: 6px;
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.card-header h3 .ico svg, .approval-section h4 .ico svg { width: 15px; height: 15px; }
.card-header > *:last-child:not(h3) { margin-left: auto; }
.card-body { padding: 20px; }

/* 无内边距的内容区（表格/时间线等自带留白） */
.card-plain { padding: 20px; }

/* ============================================================
   统计卡
   ============================================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    position: relative;
    transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.stat-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.stat-ico {
    width: 32px; height: 32px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 15px; right: 16px;
}
.stat-ico svg { width: 16px; height: 16px; }
.ic-blue  { background: var(--primary-50); color: var(--primary); }
.ic-gold  { background: var(--warning-50); color: var(--warning); }
.ic-green { background: var(--success-50); color: var(--success); }
.ic-cyan  { background: var(--info-50);    color: var(--info); }
.ic-red   { background: var(--danger-50);  color: var(--danger); }
.stat-value {
    font-size: 26px; font-weight: 700; letter-spacing: -.03em;
    line-height: 1.25;
    /* 大号独立数字用比例数字：tabular-nums 会让 121 这类数字显得松散 */
    padding-right: 42px;              /* 给右上角图标留位，长数字不会压上去 */
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-label { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; padding: 0 15px;
    border-radius: var(--r);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px; font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--primary-300); color: var(--primary); background: var(--primary-50); }
.btn:disabled, .btn:disabled:hover {
    opacity: .5; cursor: not-allowed;
    border-color: var(--border-strong); color: var(--text-3); background: var(--surface);
}

/* 实心按钮：hover 走 light-3、active 走 dark-2，与 Element Plus 的交互阶梯一致 */
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-300); border-color: var(--primary-300); color: #fff; }
.btn-primary:active { background: var(--primary-600); border-color: var(--primary-600); }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #85ce61; border-color: #85ce61; color: #fff; }
.btn-success:active { background: #529b2e; border-color: #529b2e; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.btn-danger:active { background: #dd6161; border-color: #dd6161; }

.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
/* 破坏性动作放在操作区里用描边红：实心红按钮在页面里太重，
   和主操作抢注意力；这里只要「别按错」的信号 */
.btn-outline.danger { color: var(--danger); border-color: #fbc4c4; }
.btn-outline.danger:hover { background: var(--danger-50); border-color: var(--danger); color: var(--danger); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--primary-50); color: var(--primary); border-color: transparent; }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.btn-ghost.success { color: var(--success); }
.btn-ghost.success:hover { background: var(--success-50); color: var(--success); border-color: transparent; }

.btn-sm { height: 24px; padding: 0 9px; font-size: 12px; border-radius: var(--r); }
.btn-sm svg { width: 13px; height: 13px; }
.btn-block { width: 100%; }

/* 表格里的图标按钮 */
.icon-btn {
    width: 28px; height: 28px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-2); border-radius: var(--r); cursor: pointer;
    font-size: 13px; line-height: 1;
    transition: all .15s var(--ease);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-50); }

/* ============================================================
   表单
   ============================================================ */
.form-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.col-2 { flex: 2 1 0; } .col-3 { flex: 3 1 0; } .col-4 { flex: 4 1 0; }
.col-5 { flex: 5 1 0; } .col-6 { flex: 6 1 0; } .col-7 { flex: 7 1 0; }
.col-8 { flex: 8 1 0; } .col-9 { flex: 9 1 0; }
.col-10 { flex: 10 1 0; } .col-11 { flex: 11 1 0; } .col-12 { flex: 12 1 0; }

.form-group label {
    font-size: 13px; font-weight: 500; color: var(--text-2);
    display: flex; align-items: center; gap: 5px;
}
.req { color: var(--danger); font-weight: 700; }
.form-hint { font-size: 11.5px; color: var(--text-3); }

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
    width: 100%;
    height: 32px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; padding: 6px 11px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #a8abb2; }

input:hover, select:hover, textarea:hover { border-color: #c0c4cc; }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, .12);
}
input:disabled, select:disabled, textarea:disabled,
.input-readonly {
    background: #f5f7fa;
    color: var(--text-3);
    cursor: not-allowed;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 32px;
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: .9; }

/* 表单分节（替代老式的 fieldset 方框） */
.form-section { padding: 20px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.section-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 13.5px; font-weight: 650; color: var(--text);
    margin-bottom: 16px;
}
.section-title::before {
    content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--primary);
}
.section-title .ico {
    width: 24px; height: 24px; border-radius: var(--r);
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.section-title .ico svg { width: 14px; height: 14px; }
.section-title .sub { font-weight: 500; color: var(--text-3); font-size: 12.5px; }

.form-actions {
    display: flex; gap: 10px; align-items: center;
    padding: 16px 20px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}

/* 开关 */
.switch-wrap { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.switch-wrap input { width: 16px; height: 16px; height: auto; accent-color: var(--primary); cursor: pointer; }

/* ============================================================
   筛选栏
   ============================================================ */
.filter-bar { padding: 14px 18px; margin-bottom: 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row > input, .filter-row > select { width: auto; min-width: 148px; }
.filter-row > input[type="text"], .filter-row > input[type="search"] { min-width: 230px; flex: 1 1 200px; max-width: 340px; }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
/* 表头与数据单元格的**左右内边距必须一致**（都用 12px）——
   否则每一列的文字起点都差几像素，列越靠右偏差越大，
   看上去就像「明细对不上列标题」。 */
.table thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--surface-2);
    text-align: left;
    font-size: 12.5px; font-weight: 600;
    color: var(--text-3);
    letter-spacing: .2px;
    padding: 10px 12px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;          /* 默认不折行，避免窄容器把列挤成多行 */
}
/* 数字单元格右对齐时，**表头也要右对齐**，否则标题在左、数字在右，
   宽表里看起来完全对不上。给对应的 <th> 加 class="num" 即可。 */
.table thead th.num,
.table tfoot th.num { text-align: right; }
/* 长文本列：单行截断 + 省略号，悬停看 title */
.table td.trunc {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table td.trunc-wide { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* 操作列吸附右侧：表格横向滚动时按钮始终可见（只作用于表头与表体，不含合计行） */
.table-sticky-actions thead th:last-child,
.table-sticky-actions tbody td:last-child {
    position: sticky; right: 0; z-index: 1;
    background: var(--surface);
    box-shadow: -8px 0 10px -8px rgba(0, 0, 0, .08);
}
.table-sticky-actions thead th:last-child { background: var(--surface-2); z-index: 3; }
.table-sticky-actions tbody tr:hover td:last-child { background: #f5f7fa; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: #f5f7fa; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }
.table .mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12.5px; }
.table .actions { white-space: nowrap; display: flex; gap: 6px; }
.table td.right { text-align: right; }

/* 合计行 */
.table tfoot td {
    padding: 11px 12px;
    background: var(--surface-2);
    border-top: 1px solid var(--border-strong);
    font-weight: 650;
    white-space: nowrap;
}
.table tfoot td.ft-label { text-align: right; color: var(--text-2); font-weight: 500; }
.table tfoot td.ft-note { color: var(--text-3); font-weight: 500; font-size: 12.5px; }

/* 紧凑明细表：用于卡片内的从属明细（采购订单明细、发票明细）。
   替代原先的内联 font-size —— 左右内边距仍与表头保持一致，
   并让 sticky 表头的字号/行高一起缩小，避免表头比数据高出一截。 */
.table-sm { font-size: 12.5px; }
.table-sm thead th { padding: 8px 10px; font-size: 11.5px; }
.table-sm tbody td { padding: 8px 10px; }

/* 分页 */
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 18px; flex-wrap: wrap; }.pagination button {
    min-width: 30px; height: 30px; padding: 0 6px;
    border: none; background: #f4f4f5;
    border-radius: var(--r); cursor: pointer; font-size: 13px; font-family: inherit;
    color: var(--text-2);
    transition: all .15s var(--ease);
}
.pagination button:hover { background: var(--primary-50); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; font-weight: 500; }

/* ============================================================
   状态标签
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: var(--r);
    font-size: 12px; font-weight: 500; letter-spacing: .2px;
    white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-draft            { background: #f4f4f5; color: #909399; }
.badge-pending_approval { background: var(--warning-50); color: var(--warning); }
.badge-approved         { background: var(--success-50); color: var(--success); }
.badge-rejected         { background: var(--danger-50);  color: var(--danger); }
.badge-paid             { background: var(--info-50);    color: var(--info); }
.badge-void             { background: #f4f4f5; color: #c0c4cc; }
.badge-void::before { display: none; }
.badge-void { text-decoration: line-through; }

/* 小胶囊（节点名/计数） */
.tl-pill {
    font-size: 11.5px; font-weight: 500;
    padding: 2px 8px; border-radius: var(--r);
    background: #f4f4f5; color: var(--text-2);
    white-space: nowrap;
}
.tl-pill.approved { background: var(--success-50); color: var(--success); }
.tl-pill.pending  { background: var(--warning-50); color: var(--warning); }
.tl-pill.rejected { background: var(--danger-50);  color: var(--danger); }

/* ============================================================
   详情
   分组：一组一栏，栏内左右两列「标签 + 值」。
   关键约束：标签列定宽、值列自适应并换行 —— 长值（账号/全称）
   只在自己那一格折行，不会把右边的格子挤歪。
   ============================================================ */
.detail-section { padding: 4px 20px 12px; }
.detail-section + .detail-section { border-top: 1px solid var(--border); padding-top: 14px; }
.ds-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 650; color: var(--text);
    margin: 8px 0 2px;
}
.ds-ico {
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ds-ico svg { width: 13px; height: 13px; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
}
.detail-item {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px; align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    min-width: 0;
}
.detail-label { color: var(--text-3); font-size: 12.5px; }
.detail-value {
    font-weight: 600; font-size: 13.5px; color: var(--text);
    line-height: 1.6; min-width: 0;
    word-break: break-word; overflow-wrap: anywhere;
}

/* 金额头牌：单据上最该被一眼看到的数字 */
.amount-hero {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    margin: 16px 20px 6px;
    padding: 16px 22px;
    background: linear-gradient(135deg, var(--primary-50), #f5f9ff 62%);
    border: 1px solid #d9ecff;
    border-radius: var(--r);
}
.amount-hero .ah-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.amount-hero .ah-label {
    font-size: 12px; font-weight: 600; color: var(--primary-700);
    letter-spacing: .06em;
}
.amount-hero .ah-cn {
    font-size: 13px; color: var(--text-2); line-height: 1.5;
    word-break: break-word;
}
.amount-hero .ah-value {
    margin-left: auto;
    font-size: 30px; font-weight: 700; letter-spacing: -.02em;
    color: var(--danger);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.amount-hero .ah-unit { font-size: 15px; font-weight: 600; margin-left: 4px; }

.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   审批操作区
   ============================================================ */
.approval-section {
    margin: 4px 20px 20px;
    padding: 18px;
    background: linear-gradient(180deg, #f5f7fa, #f5f7fa);
    border: 1px solid var(--border);
    border-radius: var(--r);
}
.approval-section h4 {
    font-size: 13.5px; margin-bottom: 13px;
    display: flex; align-items: center; gap: 9px;
}
/* 意见框占满剩余宽度，按钮底对齐 —— 不再依赖固定栅格列，
   窄屏下按钮自然换到下一行，不会把输入框压成一条缝 */
.action-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.action-row .action-field { flex: 1 1 320px; min-width: 0; }
.action-row .action-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   审批进度时间线
   ============================================================ */
.timeline { padding: 20px 22px; }
.tl-item { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: ""; position: absolute; left: 11px; top: 26px; bottom: 0;
    width: 2px; background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
    width: 24px; height: 24px; flex-shrink: 0; z-index: 1;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 700;
    background: #f4f4f5; color: var(--text-3);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--border);
}
.tl-dot.approved { background: var(--success-50); color: var(--success); box-shadow: 0 0 0 1px #c2e7b0; }
.tl-dot.pending  { background: var(--warning-50); color: var(--warning); box-shadow: 0 0 0 1px #f5dab1; }
.tl-dot.rejected { background: var(--danger-50);  color: var(--danger);  box-shadow: 0 0 0 1px #fbc4c4; }
.tl-dot.skipped  { background: #f4f4f5; color: #a8abb2; }
.tl-body { flex: 1; padding-top: 1px; min-width: 0; }
.tl-title {
    font-size: 13.5px; font-weight: 600;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tl-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.tl-comment {
    font-size: 12.5px; color: var(--text-2); margin-top: 7px;
    background: var(--surface-2);
    border-left: 3px solid var(--border-strong);
    padding: 7px 11px; border-radius: 0 var(--r) var(--r) 0;
}

/* ============================================================
   待办
   ============================================================ */
.todo-list { display: flex; flex-direction: column; }
.todo-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    transition: background .12s var(--ease);
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #f5f7fa; }
.todo-item.overdue { background: var(--danger-50); }
.todo-item.overdue:hover { background: #fef0f0; }
.todo-item .todo-main { flex: 1; min-width: 0; }
.todo-item .todo-no {
    font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
    font-size: 12.5px; font-weight: 600;
}
.todo-item .todo-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.todo-item .todo-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============================================================
   提示块
   ============================================================ */
.hint-box {
    background: var(--primary-50);
    border: 1px solid #d9ecff;
    color: #337ecc;
    border-radius: var(--r);
    padding: 12px 16px;
    font-size: 12.5px; line-height: 1.75;
    margin: 0 0 16px;
}
.card-header + .hint-box { margin: 16px 20px 0; }
.hint-box code {
    background: rgba(64, 158, 255, .1); padding: 1px 5px;
    border-radius: 4px; font-size: 12px;
}

.alert {
    padding: 11px 15px; border-radius: var(--r);
    margin-bottom: 14px; font-size: 13px;
    border: 1px solid transparent;
}
.alert-error   { background: var(--danger-50); color: var(--danger); border-color: #fbc4c4; }
.alert-success { background: var(--success-50); color: var(--success); border-color: #c2e7b0; }

/* ============================================================
   弹窗
   ============================================================ */
.modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 200;
    display: flex; justify-content: center; align-items: center;
    padding: 24px;
    animation: fadeIn .16s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: var(--surface);
    border-radius: var(--r-lg);
    width: 600px; max-width: 100%;
    max-height: 88vh; overflow-y: auto;
    box-shadow: var(--sh-lg);
    animation: modalIn .2s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-wide { width: 880px; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 17px 22px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 15.5px; font-weight: 650; }
.btn-close {
    background: none; border: none; font-size: 20px; line-height: 1;
    cursor: pointer; color: var(--text-3); padding: 2px;
    border-radius: 6px;
    transition: color .15s var(--ease), background .15s var(--ease);
}
.btn-close:hover { color: var(--danger); background: var(--danger-50); }
.modal .form-row { padding: 0 22px; }
.modal .form-row:first-of-type { padding-top: 20px; }
.modal .form-section { padding: 20px 22px; }
.modal .form-actions { padding: 16px 22px; position: sticky; bottom: 0; }

/* ============================================================
   审批流节点编辑行
   ============================================================ */
.step-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.step-row .step-no {
    width: 24px; height: 24px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff;
    border-radius: 50%; font-size: 11.5px; font-weight: 700;
}
/* 只作用于主行内的输入框/下拉：节点行现在多了一层「退回勾选组」，
   若仍用 .step-row input 会把勾选框也撑成 flex:1，整行变形。 */
.step-line input.step-name { flex: 1; }
.step-line select.step-approver { flex: 1.2; }
.step-row .step-tools { display: flex; gap: 4px; flex-shrink: 0; }

/* ============================================================
   空状态
   ============================================================ */
.empty {
    text-align: center;
    padding: 34px 20px;
    color: var(--text-3);
}
.empty .empty-ico {
    width: 44px; height: 44px; margin: 0 auto 10px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3);
}
.empty .empty-ico svg { width: 20px; height: 20px; }
.empty p { font-size: 13px; margin: 0; }
.empty a { font-weight: 600; }
.empty-lg { padding: 96px 20px; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed; top: 18px; left: 50%;
    transform: translateX(-50%) translateY(-14px);
    background: #303133; color: #fff;
    padding: 11px 18px;
    border-radius: var(--r);
    font-size: 13.5px; font-weight: 500;
    z-index: 999;
    box-shadow: var(--sh-lg);
    opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
    display: flex; align-items: center; gap: 9px;
    max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast.ok svg { color: #85ce61; }
.toast.err svg { color: #f89898; }

/* ============================================================
   登录页
   ============================================================ */
.login-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: #1f2d3d;
    background-image:
        radial-gradient(circle at 18% 18%, rgba(64, 158, 255, .35), transparent 46%),
        radial-gradient(circle at 82% 78%, rgba(230, 162, 60, .22), transparent 44%);
    padding: 24px;
}
.login-card {
    width: 384px; max-width: 100%;
    background: var(--surface);
    border-radius: 12px;
    padding: 36px 32px 28px;
    box-shadow: 0 26px 64px rgba(0, 0, 0, .35);
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .logo-mark {
    width: 52px; height: 52px; margin: 0 auto 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #79bbff, #409eff);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(64, 158, 255, .38);
}
.login-logo .logo-mark svg { width: 26px; height: 26px; }
.login-logo h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.login-logo p {
    margin: 5px 0 0; font-size: 10.5px; font-weight: 600;
    letter-spacing: 2.4px; color: rgba(255, 255, 255, .62);
}
.login-hint {
    text-align: center; margin-top: 18px;
    font-size: 11.5px; color: var(--text-3);
}

/* ============================================================
   附件
   ============================================================ */
.attach-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.attach-toolbar select { width: auto; min-width: 132px; }
.attach-toolbar input[type="file"] {
    height: auto; padding: 6px 10px;
    flex: 1 1 240px; max-width: 420px;
    border: 1px dashed var(--border-strong); background: var(--surface-2);
}
.attach-toolbar input[type="file"]::file-selector-button {
    margin-right: 10px; padding: 5px 12px;
    border: 1px solid var(--border-strong); border-radius: 6px;
    background: var(--surface); color: var(--text);
    font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.attach-toolbar input[type="file"]::file-selector-button:hover {
    border-color: var(--primary); color: var(--primary);
}
.attach-note {
    font-size: 12.5px; color: #909399;
    background: var(--warning-50); border: 1px solid #f5dab1;
    border-radius: var(--r-sm); padding: 8px 12px; margin-bottom: 12px;
}
.attach-list { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.attach-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.attach-item:last-child { border-bottom: none; }
.attach-item:hover { background: var(--surface-2); }
.attach-name {
    font-weight: 600; flex-shrink: 0; max-width: 38%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-meta { color: var(--text-3); font-size: 12px; flex: 1; min-width: 0; }

/* ============================================================
   图表（BI 报表）
   以月度渐变趋势、付款类型环图、带排名的横向条形为主；
   可点击元素需有 hover / focus 提示，保留 tooltip 与表格视图。
   ============================================================ */
.viz-wrap { padding: 16px 20px 20px; }
.viz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.viz-grid > .card { margin-bottom: 0; }

/* 报表按分析任务分区：统一筛选，指标与不同分析主题独立呈现。 */
.report-tabs {
    display: flex; gap: 4px; overflow-x: auto;
    padding: 5px; margin: 0 0 18px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.report-tab {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    flex: 1 0 150px; padding: 10px 14px;
    border: 1px solid transparent; border-radius: var(--r);
    background: transparent; color: var(--text-2);
    font: inherit; font-size: 13.5px; font-weight: 650; text-align: left;
    cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.report-tab span { color: var(--text-3); font-size: 11.5px; font-weight: 450; }
.report-tab:hover { color: var(--text); background: var(--surface); }
.report-tab.active {
    color: var(--primary); background: var(--surface);
    border-color: var(--border); box-shadow: var(--sh-xs);
}
.report-tab.active span { color: var(--text-2); }
.report-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.report-panel[hidden] { display: none !important; }
.report-section-intro { margin: 2px 0 14px; }
.report-section-intro h2 { margin: 0; color: var(--text); font-size: 17px; font-weight: 700; }
.report-section-intro p { margin: 5px 0 0; color: var(--text-3); font-size: 12.5px; }
.report-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* 横向条形：单系列统一一色；值标在条端 */
.viz-hbar { display: flex; flex-direction: column; gap: 9px; }
.viz-hbar-row {
    display: grid;
    grid-template-columns: 30px minmax(100px, 148px) minmax(80px, 1fr) minmax(92px, auto);
    align-items: center;
    gap: 10px;
    min-height: 46px; padding: 5px 8px; margin: 0 -8px;
    border-radius: 9px; cursor: pointer;
    transition: background .15s var(--ease), transform .15s var(--ease);
}
.viz-hbar-row:hover { background: var(--surface-2); transform: translateX(2px); }
.viz-hbar-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.viz-hbar-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 8px;
    color: var(--text-3); background: var(--surface-2);
    font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.viz-hbar-row:nth-child(-n+3) .viz-hbar-rank:not(.viz-hbar-rank-empty) { color: var(--primary); background: var(--primary-50); }
.viz-hbar-rank-empty { background: transparent; }
.viz-hbar-info { min-width: 0; }
.viz-hbar-name {
    color: var(--text); font-size: 12.5px; font-weight: 620;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viz-hbar-count { display: block; margin-top: 2px; color: var(--text-3); font-size: 10.5px; }
.viz-hbar-track { height: 10px; min-width: 20px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.viz-hbar-bar {
    height: 10px; border-radius: 99px;
    transition: width .35s var(--ease), filter .15s var(--ease);
}
.viz-hbar-row:hover .viz-hbar-bar { filter: brightness(1.08); }
.viz-hbar-val {
    font-size: 12px; font-weight: 650; color: var(--text);
    text-align: right; font-variant-numeric: tabular-nums;
}

/* 付款类型构成：环形图强调整体金额，右侧图例承载可读数据与点击入口。 */
.viz-donut { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); gap: 22px; align-items: center; }
.viz-donut-chart { position: relative; width: 100%; max-width: 240px; margin: 0 auto; aspect-ratio: 1; }
.viz-donut-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.viz-donut-segment { cursor: pointer; stroke: var(--surface); stroke-width: 2; transition: opacity .15s var(--ease), filter .15s var(--ease); }
.viz-donut-segment:hover, .viz-donut-segment:focus-visible { filter: brightness(1.08); outline: none; }
.viz-donut-segment:focus-visible { stroke: var(--text); stroke-width: 3; }
.viz-donut-center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; pointer-events: none; text-align: center;
}
.viz-donut-center strong { max-width: 80%; color: var(--text); font-size: clamp(18px, 2vw, 24px); font-weight: 730; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.viz-donut-center span { margin-top: 4px; color: var(--text-3); font-size: 11.5px; }
.viz-donut-legend { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.viz-donut-item {
    display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center;
    column-gap: 9px; row-gap: 2px; width: 100%; padding: 8px 10px;
    border: 1px solid transparent; border-radius: 8px;
    background: transparent; color: var(--text); font: inherit; text-align: left;
    cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease);
}
.viz-donut-item:hover { background: var(--surface-2); border-color: var(--border); }
.viz-donut-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.viz-donut-item:disabled { cursor: default; }
.viz-donut-name { overflow: hidden; color: var(--text-2); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.viz-donut-share { grid-column: 2; color: var(--text-3); font-size: 10.5px; }
.viz-donut-value { grid-column: 3; grid-row: 1 / span 2; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-trend-hit { cursor: crosshair; outline: none; }
.viz-trend-hit:focus-visible { stroke: var(--primary); stroke-opacity: .25; stroke-width: 2; }
.viz-trend-point { transition: r .12s var(--ease); }

/* 堆叠条：部分-整体 */
.viz-stack {
    display: flex; gap: 2px;     /* 面色间隙，用留白分隔而不是描边 */
    height: 34px; border-radius: 4px; overflow: hidden;
    background: var(--surface);
}
.viz-stack-seg {
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 650; min-width: 2px;
    transition: filter .15s var(--ease);
}
.viz-stack-seg:hover { filter: brightness(1.08); }

/* 图例：≥2 系列必须有 */
.viz-legend {
    display: flex; flex-wrap: wrap; gap: 8px 20px;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--border);
}
.viz-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.viz-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.viz-legend-name { color: var(--text-2); }
.viz-legend-val { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* 表格视图（图表的无障碍孪生） */
.viz-table .table { font-size: 13px; }
.viz-table .table thead th { position: static; }

/* Tooltip：值在前、名称在后；系列用短线键而不是色块 */
.viz-tip {
    position: fixed; left: 0; top: 0;
    z-index: 999; pointer-events: none;
    background: #303133; color: #fff;
    padding: 9px 13px; border-radius: 8px;
    font-size: 12.5px; line-height: 1.5;
    box-shadow: var(--sh-lg);
    opacity: 0; transition: opacity .12s var(--ease);
    max-width: 280px;
}
.viz-tip.show { opacity: 1; }
.viz-tip-title { font-weight: 650; margin-bottom: 3px; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.viz-tip-key { width: 12px; height: 2px; border-radius: 1px; flex-shrink: 0; }
.viz-tip-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-tip-name { color: #c0c4cc; }

/* ============================================================
   组合框（供应商搜索选择）
   ============================================================ */
.combo { position: relative; }
.combo > input[type="text"] { width: 100%; }
.combo-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    box-shadow: var(--sh-lg);
    max-height: 320px; overflow-y: auto;
    z-index: 120;
    display: none;
    padding: 4px;
}
.combo.open .combo-list { display: block; }
.combo-item {
    padding: 8px 10px; border-radius: var(--r-sm);
    cursor: pointer;
}
.combo-item:hover, .combo-item.active { background: var(--primary-50); }
.combo-main { display: flex; align-items: baseline; gap: 8px; }
.combo-name { font-size: 13.5px; font-weight: 650; color: var(--text); }
.combo-py {
    font-size: 11px; color: var(--text-3);
    font-family: "Cascadia Mono", Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 45%;
}
.combo-sub {
    font-size: 12px; color: var(--text-3); margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.combo-empty { padding: 14px 10px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ============================================================
   高级筛选面板
   ============================================================ */
.filter-panel { padding: 16px 20px; }
.filter-panel .fp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px 18px;
}
.filter-panel .form-group label { font-size: 12px; }
.filter-panel .fp-foot {
    display: flex; align-items: center; gap: 10px;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--border);
}
.filter-panel .fp-summary { margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.filter-panel .fp-summary b { color: var(--text); font-size: 13.5px; }

/* 已生效的筛选条件标签 */
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 8px 3px 11px;
    background: var(--primary-50); color: var(--primary);
    border-radius: 99px; font-size: 12.5px; font-weight: 550;
}
.chip button {
    border: none; background: none; cursor: pointer;
    color: var(--primary); font-size: 15px; line-height: 1;
    padding: 0 2px; opacity: .6;
}
.chip button:hover { opacity: 1; }

/* ============================================================
   强制提交警示（缺附件放行）
   ============================================================ */
.force-banner {
    margin: 16px 20px 0;
    padding: 14px 18px;
    background: var(--danger-50);
    border: 1px solid #fbc4c4;
    border-left: 4px solid var(--danger);
    border-radius: var(--r);
}
.force-banner .fb-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13.5px; font-weight: 650; color: var(--danger);
}
.force-banner .fb-title svg { width: 17px; height: 17px; flex-shrink: 0; }
.force-banner .fb-reason {
    margin-top: 8px; font-size: 13px; color: var(--text);
    line-height: 1.6; word-break: break-word;
}
.force-banner .fb-meta { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.force-banner .fb-list { margin-top: 10px; }
.force-banner .fb-item {
    display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
    padding: 7px 0; border-top: 1px dashed #fbc4c4; font-size: 13px;
}
.force-banner .fb-item:first-child { border-top: none; }

/* ============================================================
   超时排行（首页「待我审批」内）
   ============================================================ */
.rank-block {
    border-top: 1px solid var(--border);
    padding: 14px 20px 16px;
    background: var(--surface-2);
}
.rank-head {
    display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
}
.rank-title { font-size: 13px; font-weight: 650; color: var(--danger); }
.rank-row {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 0; font-size: 13px;
    border-bottom: 1px dashed var(--border);
}
.rank-row:last-child { border-bottom: none; }
.rank-no {
    width: 20px; height: 20px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f4f4f5; color: var(--text-2);
    border-radius: 5px; font-size: 11.5px; font-weight: 700;
}

/* ============================================================
   页签（系统设置把品牌/通知/提醒/审批流/用户/导入收在一页里）
   ============================================================ */
.tabs {
    display: flex; gap: 0; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding: 0;
}
.tab {
    appearance: none; border: none; background: transparent;
    padding: 0 20px; height: 40px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;                 /* 让下划线压住分隔线 */
    font: inherit; font-size: 14px; font-weight: 500;
    color: var(--text-2); cursor: pointer;
    transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tab:hover { color: var(--primary); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}
/* ============================================================
   审批状态流转图
   ============================================================ */

.flow-diagram { display: flex; flex-direction: column; gap: 10px; }
.fd-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fd-label {
    flex-shrink: 0; width: 92px;
    font-size: 12.5px; font-weight: 600; color: var(--text-2);
    text-align: right;
}
.fd-chain { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fd-state {
    font-size: 12.5px; padding: 3px 10px;
    border-radius: var(--r);
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-2); white-space: nowrap;
}
.fd-state.ok   { background: var(--success-50); color: var(--success); border-color: #c2e7b0; }
.fd-state.warn { background: var(--warning-50); color: var(--warning); border-color: #f5dab1; }
.fd-state.bad  { background: var(--danger-50);  color: var(--danger);  border-color: #fbc4c4; }
.fd-state.active { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.fd-arrow { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.fd-note {
    font-size: 12px; color: var(--text-3); line-height: 1.7;
    padding-left: 104px;                    /* 与 .fd-chain 左对齐 */
    margin-top: -4px;
}
.fd-note b { color: var(--text-2); font-weight: 600; }

.fd-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    margin-top: 16px; padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-3);
}
.fd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fd-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--border-strong); display: inline-block;
}
.fd-dot.ok   { background: var(--success); }
.fd-dot.warn { background: var(--warning); }
.fd-dot.bad  { background: var(--danger); }

@media (max-width: 640px) {
    .fd-label { width: auto; text-align: left; }
    .fd-note { padding-left: 0; }
}

/* ============================================================
   审批驳回：终止 / 退回
   ============================================================ */

/* 节点编辑行：主行 + 下面一行「可退回到」勾选组 */
/* 节点行改为纵向两层：第一层是节点本身，第二层是「可退回到」勾选组。
   padding/margin/边框沿用上面 849 行的定义，这里只改方向。 */
.step-row { flex-direction: column; align-items: stretch; gap: 2px; }
.step-line { display: flex; align-items: center; gap: 10px; }
.step-return {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 4px 0 2px 30px;              /* 与节点名对齐，视觉上从属 */
}
.step-return-label { font-size: 12px; color: var(--text-3); }
.step-return-item {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; color: var(--text-2); cursor: pointer;
    padding: 2px 8px; border-radius: var(--r);
    border: 1px solid var(--border); background: var(--surface);
}
.step-return-item:hover { border-color: var(--primary-300); color: var(--primary); }
.step-return-item input { accent-color: var(--primary); cursor: pointer; }

/* 驳回对话框里的两种处理方式 */
.reject-modes { display: flex; flex-direction: column; gap: 6px; }
.reject-mode {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 10px 12px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--r);
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.reject-mode:hover { border-color: var(--primary-300); background: var(--primary-50); }
.reject-mode input { margin-top: 3px; accent-color: var(--primary); cursor: pointer; }
.reject-mode b { font-weight: 600; font-size: 13.5px; }
.reject-mode em {
    display: block; font-style: normal;
    font-size: 12px; color: var(--text-3); margin-top: 1px;
}

/* ============================================================
   采购订单（基础数据）：可展开的订单行 + 缩进的明细表
   ============================================================ */

/* 订单行整行可点，给个手型提示 */
.po-row { cursor: pointer; }
.po-caret {
    color: var(--text-3); font-size: 11px;
    width: 34px; text-align: center; user-select: none;
}
.po-row:hover .po-caret { color: var(--primary); }

/* 明细行：不复用 tbody 的 hover，避免展开区跟着变色 */
.po-items-row > td { padding: 0; background: var(--surface-2); }
.po-items-row:hover { background: transparent; }

/* 明细表缩进一格：视觉上属于上面那张单，而不是同级 */
.po-items-wrap {
    padding: 0 0 0 34px;
    border-top: 1px dashed var(--border);
    border-bottom: 1px solid var(--border);
}
.po-items-wrap .table { background: transparent; }
.po-items-wrap .table thead th { background: transparent; }
.po-items-wrap .table tbody tr:hover { background: rgba(64, 158, 255, .04); }

/* ============================================================
   发票查重 + 批量上传
   ============================================================ */

/* 重复命中的警示块。风险分三档配色，让「已付款/已核销」最扎眼。 */
.dup-block { padding: 12px 14px; }
.dup-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13.5px;
}
.dup-risk-tag {
    font-size: 11.5px; font-weight: 500;
    padding: 1px 7px; border-radius: var(--r);
    background: rgba(0, 0, 0, .06); color: var(--text-2);
}
.dup-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--r);
    padding: 8px 11px;
    margin-bottom: 6px;
}
.dup-row:last-child { margin-bottom: 0; }
.dup-row.dup-high { border-left-color: var(--danger); }
.dup-row.dup-mid  { border-left-color: var(--warning); }
.dup-row.dup-low  { border-left-color: var(--info); }
.dup-row-top {
    display: flex; align-items: center; gap: 9px;
    font-size: 13px; flex-wrap: wrap;
}
.dup-badge {
    font-size: 11.5px; font-weight: 500;
    padding: 1px 7px; border-radius: var(--r);
    background: #f4f4f5; color: var(--text-2);
    white-space: nowrap;
}
.dup-row.dup-high .dup-badge { background: var(--danger-50); color: var(--danger); }
.dup-row.dup-mid  .dup-badge { background: var(--warning-50); color: var(--warning); }
.dup-no { font-size: 12.5px; font-weight: 600; }
.dup-payee { max-width: 220px; color: var(--text-2); }
.dup-amt { margin-left: auto; font-weight: 600; }
.dup-row-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.dup-reason { margin-top: 10px; }
.dup-reason input { border-color: var(--danger); }
.dup-reason input:focus { box-shadow: 0 0 0 2px rgba(245, 108, 108, .12); }

/* 警示级 alert（比 error 温和、比 info 醒目） */
.alert-warn {
    background: var(--warning-50); color: #a86a1c;
    border-color: #f5dab1;
}

/* ---------- 批量上传 ---------- */
.ivb-drop {
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
    background: var(--surface-2);
    padding: 26px 20px;
    text-align: center;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.ivb-drop.over {
    border-color: var(--primary);
    background: var(--primary-50);
}
.ivb-drop-ico { color: var(--text-3); margin-bottom: 8px; }
.ivb-drop-ico svg { width: 34px; height: 34px; }
.ivb-drop-txt {
    font-size: 13.5px; color: var(--text-2);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    flex-wrap: wrap; margin-bottom: 6px;
}
.ivb-picked { margin-top: 12px; }
.ivb-file {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; margin-bottom: 4px;
    border: 1px solid var(--border); border-radius: var(--r);
    background: var(--surface); font-size: 13px;
}
.ivb-file .trunc { max-width: 420px; }
.ivb-file .form-hint { margin-left: auto; white-space: nowrap; }

/* 批量识别结果卡片 */
.ivb-card { margin-bottom: 12px; }
.ivb-card.ivb-high { border-left: 3px solid var(--danger); }
.ivb-card.ivb-mid  { border-left: 3px solid var(--warning); }
.ivb-card .card-header h3 { font-size: 13.5px; }
.ivb-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px 18px;
    margin-bottom: 8px;
}
.ivb-field { display: flex; gap: 8px; font-size: 13px; align-items: baseline; }
.ivb-k { color: var(--text-3); font-size: 12px; min-width: 56px; flex-shrink: 0; }
.ivb-v { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tab-pane { margin-top: 16px; }
/* 页签内容里的第一个卡片不再加额外上边距，避免与页签条脱节 */
.tab-pane > .card:first-child { margin-top: 0; }

/* 品牌外观：图标选择器 */
.bf-mark {
    width: 46px; height: 46px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--surface); cursor: pointer;
    color: var(--text-2);
    transition: border-color .15s var(--ease), color .15s var(--ease),
                background .15s var(--ease);
}
.bf-mark:hover { border-color: var(--border-strong); color: var(--text); }
.bf-mark.active {
    border-color: var(--primary);
    background: var(--primary-50);
    color: var(--primary-700);
}
.bf-mark svg { width: 22px; height: 22px; }
.rank-row:nth-child(2) .rank-no { background: var(--danger-50); color: var(--danger); }
.rank-name { font-weight: 600; color: var(--text); min-width: 60px; }
.rank-hours { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-count {
    margin-left: auto; font-weight: 650; color: var(--danger);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   月度计划执行进度
   ============================================================ */
.plan-progress { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.plan-progress .pp-head {
    display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
    margin-bottom: 9px;
}
.plan-progress .pp-label { font-size: 13px; font-weight: 650; color: var(--text); }
.plan-progress .pp-num { font-size: 12.5px; color: var(--text-2); }
.plan-progress .pp-num b { color: var(--success); font-size: 14px; }
.plan-progress .pp-amt {
    margin-left: auto; font-size: 12.5px; color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.plan-progress .pp-track {
    height: 8px; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--border);
    overflow: hidden;
}
.plan-progress .pp-fill {
    height: 100%; border-radius: 99px;
    background: var(--success);
    transition: width .3s var(--ease);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1180px) {
    .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .viz-grid { grid-template-columns: 1fr; }
    .viz-hbar-row { grid-template-columns: 28px minmax(84px, 120px) minmax(65px, 1fr) minmax(82px, auto); gap: 7px; }
    .sidebar { transform: translateX(-100%); transition: transform .22s var(--ease); }
    body.side-open .sidebar { transform: none; }
    .main { margin-left: 0 !important; }
    .side-scrim {
        display: none; position: fixed; inset: 0;
        background: rgba(0, 0, 0, .45); z-index: 55;
    }
    body.side-open .side-scrim { display: block; }
    .side-toggle { display: inline-flex !important; }
    .detail-grid { grid-template-columns: 1fr; }
    .amount-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
    .amount-hero .ah-value { margin-left: 0; font-size: 26px; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content { padding: 16px 14px 34px; }
    .topbar { padding: 0 14px; }
}
@media (max-width: 640px) {
    .form-row { flex-direction: column; gap: 14px; }
    .col-2, .col-3, .col-4, .col-5, .col-6, .col-7,
    .col-8, .col-9, .col-10, .col-11, .col-12 { flex: 1 1 100%; }
    .action-row .action-field { flex: 1 1 100%; }
    .action-row .action-btns { width: 100%; }
    .action-row .action-btns .btn { flex: 1 1 0; }
    .stats-row { grid-template-columns: 1fr; }
    .viz-donut { grid-template-columns: 1fr; gap: 10px; }
    .viz-donut-chart { max-width: 205px; }
    .viz-hbar-row { grid-template-columns: 24px minmax(76px, 100px) minmax(36px, 1fr) minmax(76px, auto); gap: 6px; }
    .login-card { padding: 30px 22px 24px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .page-actions { margin-left: 0; }
}

/* 侧边栏移动端切换按钮（桌面隐藏） */
.side-toggle {
    display: none;
    align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text-2);
    cursor: pointer;
}
.side-toggle svg { width: 17px; height: 17px; }

/* 打印时隐藏外壳 */
@media print {
    .sidebar, .topbar, .side-scrim { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0; }
}
/* ============================================================
   2026 UI refresh · manufacturing finance workspace
   Quiet surfaces, strong hierarchy, and a deep operational sidebar.
   ============================================================ */
:root {
    --primary: #246b83;
    --primary-300: #3789a4;
    --primary-600: #1d596f;
    --primary-700: #17485b;
    --primary-50: #eaf3f6;
    --primary-100: #d1e5eb;
    --accent: #bd8538;
    --accent-50: #f8f2e8;

    --side-bg: #14283a;
    --side-bg-2: #1a3348;
    --side-text: #c5d2dc;
    --side-text-hi: #ffffff;
    --side-active-bg: rgba(82, 158, 184, .2);
    --side-border: rgba(224, 237, 245, .1);

    --success: #25846b;
    --success-50: #e9f5f1;
    --warning: #ae762c;
    --warning-50: #faf2e5;
    --danger: #c65353;
    --danger-50: #fbefef;
    --info: #607586;
    --info-50: #edf1f4;

    --bg: #f2f5f7;
    --surface: #ffffff;
    --surface-2: #f7f9fa;
    --text: #1d2b36;
    --text-2: #52616d;
    --text-3: #778590;
    --border: #e3e9ed;
    --border-strong: #ced8de;

    --r-sm: 6px;
    --r: 8px;
    --r-lg: 12px;
    --sh-xs: 0 1px 2px rgba(22, 42, 57, .04);
    --sh-sm: 0 2px 8px rgba(22, 42, 57, .055);
    --sh-md: 0 8px 22px rgba(22, 42, 57, .09);
    --sh-lg: 0 18px 46px rgba(22, 42, 57, .16);
    --topbar-h: 64px;
}

body { color: var(--text); background: var(--bg); }
::selection { color: #123d50; background: #cfe5ed; }
::-webkit-scrollbar-thumb { background: #c8d2d8; }

/* Navigation */
.sidebar { background: var(--side-bg); border-right: 1px solid rgba(12, 28, 42, .18); }
.side-brand { border-bottom-color: var(--side-border); }
.side-brand .mark {
    background: var(--primary);
    border-radius: 9px;
    box-shadow: 0 5px 14px rgba(13, 77, 100, .32);
}
.side-brand .txt b { color: #f4f7f9; }
.side-brand .txt span { color: #91a7b7; letter-spacing: 1.2px; }
.nav-group-label { color: #8197a7; letter-spacing: .9px; padding-top: 13px; }
.nav-group-label:hover { color: #dbe7ee; }
.side-link { color: #c3d0da; border-radius: 8px; padding: 10px 11px; margin: 2px 0; }
.side-link svg { color: #8da2b1; opacity: 1; }
.side-link:hover { background: rgba(222, 239, 247, .08); color: #fff; }
.side-link:hover svg { color: #8cc5d7; }
.side-link.active { background: var(--side-active-bg); color: #fff; font-weight: 600; }
.side-link.active::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0; background: #69b3ca;
}
.side-link.active svg { color: #8bcadd; }
.side-foot { border-top-color: var(--side-border); }
.collapse-btn { background: rgba(240, 247, 251, .06); border-color: rgba(240, 247, 251, .12); color: #a9bdca; }
.collapse-btn:hover { background: rgba(240, 247, 251, .11); color: #fff; border-color: rgba(240, 247, 251, .22); }

/* Workspace frame */
.topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .94);
    border-bottom-color: var(--border);
    box-shadow: 0 1px 4px rgba(26, 47, 62, .025);
    padding-inline: 28px;
    backdrop-filter: blur(12px);
}
.topbar h1 { color: #203442; font-size: 16px; letter-spacing: -.015em; }
.content { padding: 28px 30px 52px; }
.page-head { margin-bottom: 22px; }
.page-title { color: #1d3342; font-size: 23px; letter-spacing: -.035em; }
.page-sub { color: var(--text-3); line-height: 1.65; }

/* Surfaces and data */
.card, .stat-card {
    border-color: var(--border);
    border-radius: 12px;
    box-shadow: var(--sh-xs);
}
.card { margin-bottom: 18px; }
.card-header { padding: 16px 21px; }
.card-header h3 { color: #263b49; font-size: 14px; letter-spacing: -.01em; }
.card-header h3 .ico, .approval-section h4 .ico { border-radius: 8px; }
.card-body, .card-plain { padding: 22px; }
.stat-card { padding: 18px 19px; min-height: 104px; }
.stat-card:hover { box-shadow: var(--sh-sm); transform: translateY(-2px); }
.stat-value { color: #203747; font-size: 27px; font-variant-numeric: tabular-nums; }
.stat-label { color: #74838e; font-size: 12px; letter-spacing: .01em; }

/* Buttons, inputs, filters */
.btn { min-height: 36px; border-radius: 8px; padding-inline: 14px; font-weight: 550; }
.btn-sm { min-height: 31px; border-radius: 7px; }
.btn-primary { box-shadow: 0 2px 5px rgba(23, 87, 110, .16); }
.btn-primary:hover { box-shadow: 0 4px 10px rgba(23, 87, 110, .2); }
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
    min-height: 38px;
    border-color: #d2dce2;
    border-radius: 8px;
    background-color: #fff;
}
textarea { min-height: 86px; }
input:hover, select:hover, textarea:hover { border-color: #aebdc6; }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 107, 131, .13);
}
.form-group label { color: #3f515e; font-weight: 600; }
.form-section { padding: 22px; }
.section-title { font-size: 14px; margin-bottom: 18px; }
.filter-bar, .filter-panel { border-radius: 12px; }
.filter-bar { padding: 16px 18px; }
.filter-row { gap: 9px; }

/* Tables */
.table thead th {
    background: #f5f8f9;
    color: #687985;
    font-size: 11.5px;
    text-transform: none;
    letter-spacing: .025em;
    border-bottom-color: #dfe7eb;
}
.table tbody td { color: #344653; }
.table tbody tr:hover { background: #f5f9fa; }
.table-sticky-actions tbody tr:hover td:last-child { background: #f5f9fa; }
.table tfoot td { background: #f5f8f9; }
.badge, .tl-pill { border-radius: 999px; }

/* Tabs and transient UI */
.tab, .report-tab { transition: color .16s ease, background .16s ease, border-color .16s ease; }
.modal-content { border-radius: 14px; box-shadow: 0 24px 72px rgba(13, 31, 44, .24); }
.dropdown { border-radius: 10px; }
.toast { border-radius: 10px; box-shadow: var(--sh-md); }
:focus-visible { outline: 3px solid rgba(36, 107, 131, .3); outline-offset: 2px; }

/* Login */
.login-body {
    background: #14283a;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(39, 105, 129, .48), transparent 56%);
}
.login-card { border-radius: 16px; box-shadow: 0 28px 72px rgba(4, 18, 29, .38); }
.login-logo .logo-mark { background: var(--primary); border-radius: 14px; box-shadow: 0 8px 20px rgba(23, 87, 110, .24); }
.login-logo p { color: #7b8c96; }
.login-card .form-group label { font-size: 12.5px; }
.login-card input { min-height: 42px; }
.login-hint { padding-top: 12px; border-top: 1px solid var(--border); }

@media (max-width: 1180px) {
    .content { padding-inline: 22px; }
}
@media (max-width: 900px) {
    .topbar { padding-inline: 16px; }
    .content { padding: 20px 16px 38px; }
}
@media (max-width: 640px) {
    .content { padding: 16px 12px 30px; }
    .page-title { font-size: 21px; }
    .card-body, .card-plain { padding: 16px; }
    .form-section { padding: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Request detail page: group dense payment data into calm, aligned panels. */
#detailCard { overflow: hidden; }
#detailCard > .card-header {
    min-height: 66px;
    padding: 14px 22px;
    gap: 16px;
}
#detailTitle {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
    color: #203747;
    font-size: 15px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
#detailTitle .badge { flex-shrink: 0; font-size: 11px; }
#detailCard .detail-actions { justify-content: flex-end; gap: 7px; }
#detailCard #detailContent { padding-bottom: 3px; }
#detailCard .amount-hero {
    margin: 18px 22px 16px;
    padding: 18px 22px;
    background: #eef5f7;
    border: 1px solid #d8e8ed;
    border-radius: 11px;
    gap: 18px 28px;
}
#detailCard .amount-hero .ah-label {
    color: #55717e;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
#detailCard .amount-hero .ah-cn { color: #536570; font-size: 12.5px; }
#detailCard .amount-hero .ah-value {
    color: #174f64;
    font-size: clamp(25px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -.035em;
}
#detailCard .amount-hero .ah-unit { color: #55717e; font-size: 13px; }
#detailCard .detail-section {
    margin: 0 22px 14px;
    padding: 14px 18px 8px;
    background: #fbfcfd;
    border: 1px solid #e7edf0;
    border-radius: 10px;
}
#detailCard .detail-section + .detail-section {
    border-top: 1px solid #e7edf0;
    padding-top: 14px;
}
#detailCard .ds-head {
    margin: 0 0 5px;
    gap: 9px;
    color: #324b5a;
    font-size: 13px;
    font-weight: 650;
}
#detailCard .ds-ico {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    background: #eaf2f5;
    color: #326e83;
}
#detailCard .detail-grid {
    column-gap: 34px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
#detailCard .detail-item {
    grid-template-columns: minmax(96px, 112px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f3;
}
#detailCard .detail-grid .detail-item:nth-last-child(-n + 2) { border-bottom: 0; }
#detailCard .detail-label {
    color: #788994;
    font-size: 12px;
    line-height: 1.65;
    white-space: normal;
}
#detailCard .detail-value {
    color: #253b48;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
#detailCard .detail-section .table-wrap { margin: 8px -6px 0; }
#detailCard .approval-section {
    margin: 8px 22px 22px;
    padding: 18px 20px 20px;
    background: #f6f9fa;
    border-color: #e1e9ed;
    border-radius: 10px;
}
#detailCard .approval-section h4 { color: #314956; margin-bottom: 15px; }
#detailCard .approval-section h4 .ico { border-radius: 7px; }
#detailCard .action-row { align-items: flex-end; gap: 12px; }
#detailCard .action-row .action-field { flex: 1 1 210px; }
#detailCard .action-row .action-btns { flex: 0 0 auto; }
#attachCard .card-plain { padding: 18px 22px; }
#timelineCard .timeline { padding: 22px 26px; }
#logCard .table-wrap { border-radius: 0 0 12px 12px; }

@media (max-width: 900px) {
    #detailCard > .card-header { align-items: flex-start; flex-wrap: wrap; }
    #detailCard .detail-actions { width: 100%; justify-content: flex-start; }
    #detailCard .detail-grid { column-gap: 24px; }
    #detailCard .detail-item { grid-template-columns: 94px minmax(0, 1fr); }
}
@media (max-width: 640px) {
    #detailCard > .card-header { padding: 13px 15px; }
    #detailCard .amount-hero { margin: 14px 14px; padding: 15px 16px; }
    #detailCard .amount-hero .ah-value { margin-left: 0; font-size: 25px; }
    #detailCard .detail-section { margin: 0 14px 11px; padding: 12px 14px 6px; }
    #detailCard .detail-grid { grid-template-columns: minmax(0, 1fr); }
    #detailCard .detail-item,
    #detailCard .detail-grid .detail-item:nth-last-child(-n + 2) { border-bottom: 1px solid #edf1f3; }
    #detailCard .detail-grid .detail-item:last-child { border-bottom: 0; }
    #detailCard .detail-item { grid-template-columns: minmax(96px, 112px) minmax(0, 1fr); }
    #detailCard .approval-section { margin: 8px 14px 16px; padding: 15px; }
    #detailCard .action-row .action-field { flex-basis: 100%; }
    #detailCard .action-row .action-btns { width: 100%; }
    #detailCard .action-row .action-btns .btn { flex: 1 1 0; }
    #attachCard .card-plain { padding: 14px; }
}

/* Related records on the payment detail page (POs and invoices). */
#detailPoSection, #detailInvoiceSection { min-width: 0; }
#detailCard .detail-related {
    min-width: 0;
    margin: 0 22px 14px;
    padding: 15px 18px 17px;
    background: #fbfcfd;
    border: 1px solid #e4ebef;
    border-radius: 10px;
}
#detailCard .detail-related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    flex-wrap: wrap;
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9eef1;
}
#detailCard .detail-related-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
#detailCard .detail-related-head h4 {
    margin: 0;
    color: #314956;
    font-size: 13.5px;
    font-weight: 650;
}
#detailCard .detail-related-total {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: #71818c;
    font-size: 12px;
    line-height: 1.6;
}
#detailCard .detail-related-total b { color: #304653; font-weight: 650; }
#detailCard .detail-invoice-sep { color: #a7b3ba; padding-inline: 2px; }
#detailCard .detail-related-body { min-width: 0; padding-top: 13px; }
#detailCard .detail-related-empty {
    padding: 12px 14px;
    color: #758691;
    background: #fff;
    border: 1px dashed #dce5e9;
    border-radius: 8px;
    font-size: 12.5px;
}
#detailCard .detail-related-body > .detail-related-empty:first-child { margin-top: 0; }
#detailCard .detail-related-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 12px;
}
#detailCard .detail-po-card {
    margin: 0 0 10px;
    border-radius: 9px;
    box-shadow: none;
    overflow: hidden;
}
#detailCard .detail-po-card:last-child { margin-bottom: 0; }
#detailCard .detail-po-card .card-header {
    min-height: 50px;
    padding: 10px 14px;
    background: #fff;
    flex-wrap: wrap;
}
#detailCard .detail-po-card .card-header h3 {
    flex-wrap: wrap;
    min-width: 0;
    gap: 7px;
    font-size: 12.5px;
}
#detailCard .detail-po-amount { color: #28586c; white-space: nowrap; }
#detailCard .detail-po-card .table-wrap { min-width: 0; }
#detailCard .detail-po-card .table { min-width: 760px; }
#detailCard .detail-po-card .table thead th { position: static; }

@media (max-width: 640px) {
    #detailCard .detail-related { margin: 0 14px 11px; padding: 13px; }
    #detailCard .detail-related-head { align-items: flex-start; }
    #detailCard .detail-related-total { width: 100%; }
    #detailCard .detail-po-card .card-header { align-items: flex-start; }
    #detailCard .detail-po-card .detail-po-amount { margin-left: auto; }
}

/* Compact, predictable audit-log columns. Keep the date, action, and actor
   columns fixed so a wide page only gives its extra space to the comment. */
.table-log { width: 100%; min-width: 700px; table-layout: fixed; }
.table-log col.log-col-time { width: 230px; }
.table-log col.log-col-action { width: 150px; }
.table-log col.log-col-actor { width: 180px; }
.table-log thead th { text-align: left !important; }
.table-log tbody td { text-align: left; }
.table-log .log-time {
    color: #667985;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.table-log th.log-action-head,
.table-log th.log-actor,
.table-log th.log-comment { text-align: left !important; }
.table-log .log-action {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #edf3f5;
    color: #385d6d;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.table-log .log-comment { color: #647681; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .table-log { min-width: 760px; }
    .table-log col.log-col-time { width: 220px; }
    .table-log col.log-col-action { width: 120px; }
    .table-log col.log-col-actor { width: 130px; }
}


/* Reconciliation actions and deep-linked attachment focus. */
.reconcile-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.reconcile-flow-guide { margin: 0 0 14px; }
.reconcile-flow-guide ol { margin: 8px 0 0; padding-left: 22px; }
.reconcile-flow-guide li + li { margin-top: 4px; }
.bf-target-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bf-target-notice strong { color: var(--text); }
.bf-target-notice .form-hint { margin: 3px 0 0; }
#attachCard { scroll-margin-top: 86px; }
#attachCard.attach-focus { animation: attachFocus 2.4s ease-out; }
@keyframes attachFocus {
    0%, 65% { box-shadow: 0 0 0 3px rgba(36, 107, 131, .24), var(--sh-sm); }
    100% { box-shadow: var(--sh-xs); }
}
.attach-bank-flow-note {
    border: 1px solid #efcf9e;
    background: #fff8ed;
    color: #845b25;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.attach-permission-note { color: #865d2b; }
@media (max-width: 760px) {
    .reconcile-actions { min-width: 220px; }
}
