:root {
    --crm-font: "Inter", "SF Pro Text", "Segoe UI Variable Text", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    --crm-green: #16a374;
    --crm-green-dark: #0d7d5a;
    --crm-green-soft: #eaf7f1;
    --crm-ink: #17233a;
    --crm-text: #334155;
    --crm-muted: #7b8798;
    --crm-line: #e7ebf0;
    --crm-surface: #ffffff;
    --crm-canvas: #f4f6f9;
    --crm-radius: 14px;
    --crm-shadow: 0 1px 2px rgba(21, 35, 56, .03), 0 8px 28px rgba(21, 35, 56, .045);
    --crm-focus: 0 0 0 3px rgba(22, 163, 116, .13);
    --bs-primary: #16a374;
    --bs-primary-rgb: 22, 163, 116;
    --bs-body-font-family: var(--crm-font);
    --bs-body-color: var(--crm-text);
    --bs-body-bg: var(--crm-canvas);
    --bs-border-color: var(--crm-line);
    --bs-secondary-color: var(--crm-muted);
    --bs-link-color: #128363;
    --bs-link-hover-color: #0b654d;
    --bs-table-border-color: #edf0f4;
}

html, body {
    font-family: var(--crm-font);
    color: var(--crm-text);
    background: var(--crm-canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    font-size: .9rem;
    letter-spacing: .005em;
}

::selection {
    color: #0b5f47;
    background: #cdeee1;
}

:focus-visible {
    outline: 2px solid rgba(22, 163, 116, .55);
    outline-offset: 2px;
}

/* 细滚动条：全站统一，避免系统默认粗滚动条破坏视觉层次 */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd3dc transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #cbd3dc;
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #aab5c2;
    background-clip: padding-box;
}

/* 全屏斜向水印层：固定覆盖视口，背景平铺用户名；穿透点击、不可选中，不影响任何交互 */
.watermark-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    user-select: none;
}

/* 登录页 */
.login-page {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 22%, rgba(38, 188, 139, .20), transparent 34%),
        radial-gradient(circle at 82% 78%, rgba(56, 122, 189, .17), transparent 32%),
        linear-gradient(145deg, #102b2d 0%, #10283a 48%, #101d30 100%);
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .20;
    background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.login-card {
    position: relative;
    width: 390px;
    max-width: 100%;
    padding: 2.35rem 2.25rem 2.1rem;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .32), 0 2px 8px rgba(0, 0, 0, .10);
    backdrop-filter: blur(18px);
    animation: login-card-in .55s cubic-bezier(.2, .8, .2, 1) both;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24%;
    right: 24%;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, var(--crm-green), transparent);
}

.login-brand-mark {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 17px;
    background: linear-gradient(145deg, #183b3d, #0e242c);
    box-shadow: 0 10px 24px rgba(16, 43, 45, .24), inset 0 1px 0 rgba(255,255,255,.14);
}

.login-brand-mark img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.login-card h3 {
    color: var(--crm-ink);
    font-weight: 700;
    letter-spacing: -.035em;
}

.login-subtitle {
    color: var(--crm-muted);
    font-size: .82rem;
    letter-spacing: .08em;
}

.login-card .form-control {
    min-height: 2.65rem;
    border-radius: 9px;
}

.login-card button[type="submit"] {
    min-height: 2.65rem;
    border-radius: 9px;
    font-size: .88rem;
    letter-spacing: .08em;
    box-shadow: 0 8px 18px rgba(22, 163, 116, .20);
}

.login-card button[type="submit"]:hover {
    box-shadow: 0 10px 22px rgba(22, 163, 116, .26);
}

@keyframes login-card-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 通用紧凑表格与工具类 */
.table-sm td, .table-sm th {
    padding: .62rem .72rem;
}

/* 全局表格网格线：Bootstrap 5.3 把底色画在单元格上（td 的 background-color 会盖住 tr 的底色），
   以斑马纹/悬停必须走单元格认可的 --bs-table-accent-bg / --bs-table-hover-bg 变量 */
.table > tbody > tr:nth-of-type(even) {
    --bs-table-accent-bg: #fafbfd;
}

.table-hover > tbody > tr:hover {
    --bs-table-hover-bg: #f0f8f5;
}

/* 桌面端以留白和细分隔线建立秩序，不再绘制密集竖向网格 */
.table > thead > tr > th:not(:last-child),
.table > tbody > tr > td:not(:last-child),
.table > tfoot > tr > td:not(:last-child) {
    border-right: 0;
}

/* ===== 表头：全部文字居中 + 右边缘可拖拽调列宽 ===== */
.table > thead > tr > th {
    text-align: center !important;
}

/* 全站表格单元格默认允许换行 */
.table td {
    overflow-wrap: break-word;
}

/* 型号列强制断词（防止单一无空格字符串撑宽列） */
.table td.cell-model {
    word-break: break-all;
}

/* 产品列表单位：与分类单元格一致，默认显示标签，悬停才出现编辑铅笔 */
.unit-cell {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.unit-tag {
    display: inline-block;
    max-width: 70px;
    padding: .18rem .5rem;
    border: 1px solid #dbe3ec;
    border-radius: .35rem;
    background: #f1f5f9;
    color: #475569;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.unit-tag.none {
    border-style: dashed;
    background: #f8fafc;
    color: #94a3b8;
}

.unit-edit {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: .95rem;
    line-height: 1;
    padding: .1rem .2rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s ease;
}

.unit-cell:hover .unit-edit,
.unit-edit:focus-visible {
    opacity: 1;
}

.unit-edit:hover {
    color: #1d4ed8;
    background: #eef2ff;
}

.table > thead > tr > th:has(input.form-check-input),
.table > tbody > tr > td:has(input.form-check-input) {
    text-align: center;
}

/* 拖拽把手：分界线两侧各 6px 热区，悬停高亮提示可拖（js/table-resize.js 负责实际拖拽）。
   热区必须落在 th 内部：之前写成 right:-4px 会越出表格右沿，让 scrollWidth 比 clientWidth 多 4px，
   列宽明明全部显示在窗口内也照样冒出横向滚动条 */
.table > thead > tr > th {
    position: relative;
}

/* 表头常驻：在列表滚动容器内吸顶，下拉时不被推走 */
.table-responsive > .table > thead {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f6f8fb;
    box-shadow: 0 1px 0 var(--crm-line);
}

/* 表头采用低饱和冷灰，让数据成为页面视觉主角 */
.table > thead > tr > th {
    background: #f6f8fb;
    border-bottom: 1px solid #e3e8ef;
    font-weight: 400;
    font-size: .78rem;
    letter-spacing: .025em;
    color: #657286;
    vertical-align: middle;
}

/* 表格圆角外框 */
.table {
    border: 1px solid var(--crm-line);
    border-radius: 12px;
    border-collapse: separate !important;
    border-spacing: 0;
    background: transparent;
    color: var(--crm-text);
}

/* 四角单元格圆角 */
.table > thead:first-child > tr:first-child > th:first-child { border-top-left-radius: 11px; }
.table > thead:first-child > tr:first-child > th:last-child  { border-top-right-radius: 11px; }
.table > tbody:last-child > tr:last-child > td:first-child   { border-bottom-left-radius: 11px; }
.table > tbody:last-child > tr:last-child > td:last-child    { border-bottom-right-radius: 11px; }
.table > tfoot:last-child > tr:last-child > td:first-child   { border-bottom-left-radius: 11px; }
.table > tfoot:last-child > tr:last-child > td:last-child    { border-bottom-right-radius: 11px; }

.table > :not(caption) > * > * {
    border-bottom: 1px solid #edf0f4;
    background-color: transparent;
    vertical-align: middle;
}

/* 去掉最后一行底部边框（避免和外框重叠） */
.table > tbody:last-child > tr:last-child > td,
.table > tfoot > tr:last-child > td {
    border-bottom: none;
}

/* table-light 在 tfoot/tbody 统一透明，让卡片底色透出 */
.table > tfoot.table-light,
.table > tfoot > tr.table-light,
.table > tbody > tr.table-light {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
}

.table > tfoot.table-light > tr > th,
.table > tfoot.table-light > tr > td,
.table > tfoot > tr.table-light > td,
.table > tfoot > tr.table-light > th,
.table > tbody > tr.table-light > td {
    background-color: transparent;
}

/* 表格内输入框圆角美化 */
.table td input.form-control,
.table td input[type="number"],
.table td input[type="text"],
.table td input[type="date"],
.table td select.form-select {
    min-height: 2rem;
    border-radius: 7px;
    border-color: #dfe5ec;
    background-color: #fff;
    font-size: .82rem;
    padding: 0.25rem 0.55rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.table td input.form-control:focus,
.table td select.form-select:focus {
    border-color: var(--crm-green);
    box-shadow: var(--crm-focus);
}

/* 列表页的 table-responsive 作为弹性填充区，承担纵向滚动（thead sticky 的参照） */
.cat-main > .table-responsive,
.page-card > .table-responsive {
    flex: 1 1 0;
    min-height: 0;
}

/* 直接子卡片禁止 flex 收缩：.page-card / .cat-main 都是纵向 flex 滚动容器，而 .card 带 overflow:hidden
   会使其自动最小尺寸归 0；内容超高时直接子卡片会被 flex 压扁到只剩边框、卡片内容（如详情页表格行、
   编辑页工具条按钮）被 overflow 裁空。禁止收缩后卡片保持自然高度，超出部分交由容器整体滚动。
   注意：此规则不影响上面 .table-responsive 的 flex:1 1 0 填充行为（选择器不同）。 */
.page-card > .card,
.cat-main > .card {
    flex-shrink: 0;
}

.table > thead > tr > th::before,
.table > thead > tr > th::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
}

.table > thead > tr > th::after {
    right: 0;
}

/* 左边界热区拖的是左边那一列（脚本里换算），首列左边没有左邻，故不显示把手 */
.table > thead > tr > th::before {
    left: 0;
}

.table > thead > tr > th:first-child::before {
    display: none;
}

.table > thead > tr > th::before:hover,
.table > thead > tr > th::after:hover {
    background: rgba(22, 163, 116, .24);
}

body.col-resizing {
    cursor: col-resize;
    user-select: none;
}

/* ===== 列表「设置」按钮弹出的列显示/隐藏面板（见 table-resize.js 的 CrmCols） ===== */
.colset-panel {
    position: fixed;
    z-index: 1080;
    min-width: 200px;
    max-width: 300px;
    max-height: 60vh;
    overflow: auto;
    background: rgba(255, 255, 255, .98);
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    box-shadow: 0 16px 44px rgba(21, 35, 56, .16);
    padding: .7rem .75rem;
    font-size: .82rem;
    backdrop-filter: blur(14px);
    animation: modal-box-in .16s ease both;
}

.colset-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 400;
    margin-bottom: .45rem;
    color: #3e4d62;
}

.colset-reset {
    color: var(--crm-green);
    font-weight: 400;
    font-size: .76rem;
    cursor: pointer;
}

.colset-reset:hover { color: var(--crm-green-dark); text-decoration: underline; }

.colset-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .3rem .2rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color .14s ease;
}

.colset-item:hover {
    background: #f2f7f5;
}

.colset-item input { margin: 0; flex-shrink: 0; }

.money {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* 关键文本列保留可读宽度，避免固定布局下被挤成逐字换行 */
.table th.col-party {
    min-width: 180px;
}

.table th.col-code {
    min-width: 180px;
}

.table th.col-date {
    min-width: 96px;
}

.table th.status-col {
    min-width: 128px;
}

.table-link {
    cursor: pointer;
}

.ws-salary td {
    white-space: nowrap;
}

.ws-salary .num {
    width: 92px;
}

/* 穿透页页签：低饱和容器 + 当前页下划线 */
.nav-tabs {
    gap: .35rem;
    border-bottom-color: #e4e9ef;
}

.nav-tabs .nav-link {
    margin-bottom: -1px;
    padding: .62rem .9rem;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    color: #778397;
    background: transparent;
    font-size: .84rem;
    font-weight: 400;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.nav-tabs .nav-link:hover {
    color: #167458;
    background: #f5f9f7;
    border-bottom-color: #cde8dd;
    isolation: isolate;
}

.nav-tabs .nav-link.active {
    color: #0e7656;
    background: #f2faf6;
    border-bottom-color: var(--crm-green);
}

.nav-tabs .nav-item,
.nav-pills .nav-item {
    position: relative;
}

.nav-tabs .nav-item .tab-new,
.nav-pills .nav-item .tab-new {
    position: absolute;
    top: -3px;
    right: -3px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1b6ec2;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.nav-tabs .nav-item:hover .tab-new,
.nav-pills .nav-item:hover .tab-new {
    opacity: 1;
    pointer-events: auto;
}

.nav-tabs .nav-item .tab-new:hover,
.nav-pills .nav-item .tab-new:hover {
    background: #14568f;
}

/* 表格底部汇总行（本页合计 / 全部合计） */
.tbl-sum td {
    border-top: 1px solid #dfe6ed;
    background: #f8fafc;
    color: #4c5b70;
    font-weight: 400;
}

/* 汇总行不参与斑马纹，保持自有底色 */
.table > tbody > tr.tbl-sum,
.table > tfoot > tr.tbl-sum {
    --bs-table-accent-bg: transparent;
}

.tbl-sum .sum-label {
    text-align: right;
    color: #6a778a;
    white-space: nowrap;
}

.tbl-sum .sum-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tbl-sum-all td {
    background: #eff7f3;
    color: #2e5e4e;
}

.stat-card {
    position: relative;
    min-height: 112px;
    overflow: hidden;
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    padding: 1.05rem 1.1rem .95rem;
    background: linear-gradient(145deg, #fff 0%, #fbfdfc 100%);
    box-shadow: var(--crm-shadow);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -34px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22, 163, 116, .09), transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #d8e6e0;
    box-shadow: 0 12px 30px rgba(21, 35, 56, .08);
}

.stat-card .stat-label {
    color: #718096;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .02em;
}

.stat-card .stat-value {
    margin-top: .38rem;
    color: var(--crm-ink);
    font-size: 1.48rem;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}

/* 模态弹框（不依赖 JS 库） */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(13, 24, 39, .48);
    backdrop-filter: blur(3px);
    z-index: 1050;
    overflow: auto;
    animation: modal-mask-in .18s ease both;
}

.modal-box {
    max-width: 900px;
    margin: 3rem auto;
    background: #fff;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 24px 70px rgba(10, 23, 40, .25);
    animation: modal-box-in .22s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes modal-mask-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-box-in {
    from { opacity: 0; transform: translateY(10px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 产品选择弹窗：加宽近满屏 + 左分类树右表格 */
.modal-box-wide {
    max-width: 1180px;
    width: 96%;
}

.picker-layout {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.picker-tree {
    flex: 0 0 200px;
    border-right: 1px solid #e3e8ee;
    padding-right: .75rem;
    max-height: 58vh;
    overflow: auto;
}

.picker-tree .picker-node {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .3rem .5rem;
    border-radius: 6px;
    cursor: pointer;
    color: #334155;
}

.picker-tree .picker-node.active {
    background: #e8f1fb;
    color: #1b6ec2;
    font-weight: 600;
}

.picker-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.picker-body {
    max-height: 58vh;
    overflow: auto;
    border: 1px solid #eef2f6;
    border-radius: 6px;
}


a, .btn-link {
    color: #128363;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover, .btn-link:hover {
    color: var(--crm-green-dark);
}

/* 表单控件：统一高度、边框、焦点与只读状态 */
.form-control, .form-select {
    min-height: 2.45rem;
    border-color: #dfe5ec;
    border-radius: 9px;
    color: var(--crm-ink);
    background-color: #fff;
    font-size: .88rem;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-control::placeholder {
    color: #a0aaba;
}

.form-control:hover:not(:disabled):not(:focus),
.form-select:hover:not(:disabled):not(:focus) {
    border-color: #c8d2dd;
}

.form-control:focus, .form-select:focus {
    border-color: var(--crm-green);
    box-shadow: var(--crm-focus);
}

.form-control:disabled, .form-control[readonly], .form-select:disabled {
    color: #7b8798;
    background-color: #f5f7fa;
    border-color: #e8ecf1;
}

.form-control-sm, .form-select-sm {
    min-height: 2.15rem;
    border-radius: 8px;
    font-size: .82rem;
}

.form-label {
    margin-bottom: .38rem;
    color: #5c697c;
    font-size: .8rem;
    font-weight: 400;
    letter-spacing: .015em;
}

.form-check-input {
    border-color: #b8c2cf;
}

.form-check-input:checked {
    background-color: var(--crm-green);
    border-color: var(--crm-green);
}

.form-check-input:focus {
    border-color: var(--crm-green);
    box-shadow: var(--crm-focus);
}

.input-group-text {
    border-color: #dfe5ec;
    background: #f7f9fb;
    color: #6b7789;
}

.btn {
    --bs-btn-font-weight: 400;
    border-radius: 8px;
    font-size: .84rem;
    line-height: 1.35;
    transition: transform .15s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}

.btn-sm {
    min-height: 2.15rem;
    padding: .36rem .78rem;
    border-radius: 7px;
    font-size: .8rem;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: var(--crm-focus);
}

.btn-outline-primary {
    --bs-btn-color: #128363;
    --bs-btn-border-color: #bfe2d5;
    --bs-btn-hover-bg: #eef9f4;
    --bs-btn-hover-border-color: #8fceb8;
    --bs-btn-hover-color: #0b654d;
    --bs-btn-active-bg: #dff4eb;
    --bs-btn-active-border-color: #79c2a6;
    --bs-btn-active-color: #0b654d;
}

.btn-outline-dark {
    --bs-btn-color: #536174;
    --bs-btn-border-color: #dce2e9;
    --bs-btn-hover-bg: #f6f8fa;
    --bs-btn-hover-border-color: #c8d1dc;
    --bs-btn-hover-color: #263449;
    --bs-btn-active-bg: #edf1f5;
    --bs-btn-active-border-color: #bcc7d3;
    --bs-btn-active-color: #263449;
}

.btn-outline-danger {
    --bs-btn-color: #c64b4b;
    --bs-btn-border-color: #efcccc;
    --bs-btn-hover-bg: #fff2f2;
    --bs-btn-hover-border-color: #e5a3a3;
    --bs-btn-hover-color: #a52f2f;
}

.btn-outline-info {
    --bs-btn-color: #287d9d;
    --bs-btn-border-color: #c7e3ec;
    --bs-btn-hover-bg: #eef8fb;
    --bs-btn-hover-border-color: #9ccfdd;
    --bs-btn-hover-color: #1b627d;
}

.btn:disabled, .btn.disabled {
    opacity: .46;
    box-shadow: none;
}

.badge {
    border-radius: 6px;
    font-weight: 400;
    letter-spacing: .02em;
}

.content {
    padding-top: 1.1rem;
}

/* 内容区白卡片：统一的浅灰工作台之上的主容器 */
.page-card {
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 16px;
    padding: 1.35rem 1.4rem 1.5rem;
    box-shadow: var(--crm-shadow);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* 含吸底分页条的卡片：取消底部内边距，使 sticky bottom:0 的分页条贴死卡片底边，
   不再在分页条下方留出透明 padding 缝而让表格行穿透（与 .cat-main 同一处理） */
.page-card:has(.pager-bar) {
    padding-bottom: 0;
}

/* 列表底部分页条：共X条 + 条/页 + 页码 + 前往N页；常驻吸底，内容短时靠 margin-top:auto 贴卡片底部
   自带 padding-bottom 作为底部呼吸空间；.cat-main 已取消底部内边距，使 sticky bottom:0 能贴死容器底、不再漏出表格行 */
.pager-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .85rem;
    margin-top: auto;
    padding-top: .85rem;
    padding-bottom: .85rem;
    border-top: 1px solid var(--crm-line);
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    z-index: 3;
}

.pager-total,
.pager-size {
    color: #64748b;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* 每页条数下拉：宽度随内容，字号与分页条一致 */
.pager-size-select {
    width: auto;
    font-size: 0.85rem;
    padding: 0.15rem 1.6rem 0.15rem 0.5rem;
}

.pager-jump {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #475569;
    font-size: 0.85rem;
    white-space: nowrap;
}

.pager-jump-input {
    width: 3.6rem;
    text-align: center;
}

.pagination {
    --bs-pagination-color: #647186;
    --bs-pagination-hover-color: #0b654d;
    --bs-pagination-hover-bg: #edf8f3;
    --bs-pagination-hover-border-color: #d7ebe3;
    --bs-pagination-active-bg: var(--crm-green);
    --bs-pagination-active-border-color: var(--crm-green);
    --bs-pagination-disabled-color: #b6bfcb;
    --bs-pagination-disabled-bg: #fff;
    --bs-pagination-disabled-border-color: #e8ecf1;
    gap: .25rem;
}

.page-link {
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px !important;
    font-size: .8rem;
    line-height: 1;
}

.page-item.active .page-link {
    box-shadow: 0 3px 8px rgba(22, 163, 116, .18);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* 左侧常驻竖向分类导航（CategoryNav 组件）：独立卡片，自然高度 + 黏性定位；
   高度跟随内容容器（顶栏+内边距已被 flex 链扣掉），防止卡片底边/滚动条溢出主页面 */
.cat-nav {
    position: sticky;
    top: 0.75rem;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    background: #fff;
    border: 1px solid var(--crm-line);
    border-radius: 12px;
    padding: .35rem;
    max-height: calc(100vh - 5.5rem);
    max-height: 100%;
    overflow-y: auto;
    box-shadow: var(--crm-shadow);
}

.cat-nav .cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    min-height: 2.45rem;
    padding: .62rem .8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: .86rem;
    font-weight: 400;
    color: #4b596d;
    user-select: none;
    transition: color .16s ease, background-color .16s ease;
}

.cat-nav .cat-item .cat-label {
    flex: 1 1 auto;
}

.cat-nav .cat-item:hover {
    color: #1f6f58;
    background: #f3f7f5;
}

.cat-nav .cat-item.active {
    color: #fff;
    background: linear-gradient(110deg, var(--crm-green), #14866f);
    box-shadow: 0 6px 14px rgba(22, 163, 116, .18), inset 3px 0 0 #58c9a4;
}

.cat-nav .cat-item .cat-cnt {
    min-width: 1.7rem;
    padding: .12rem .42rem;
    border-radius: 999px;
    color: #8a96a6;
    background: #f2f5f8;
    font-size: .72rem;
    line-height: 1.45;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.cat-nav .cat-item.active .cat-cnt {
    color: #fff;
    background: rgba(255, 255, 255, .18);
}

.cat-nav .cat-item.active .cat-arrow {
    color: #fff;
}

.cat-nav .cat-item.active .cat-dot {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .38);
}

/* 母子树：一级行带展开箭头，二级子项缩进 */
.cat-nav .cat-parent {
}

.cat-nav .cat-arrow {
    width: 1.2rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    transition: transform 0.15s ease;
    cursor: pointer;
}

    .cat-nav .cat-arrow.open {
        transform: rotate(90deg);
    }

    .cat-nav .cat-arrow.empty {
        cursor: default;
    }

.cat-nav .cat-child {
    font-size: .82rem;
    font-weight: 400;
    color: #687588;
}

/* 主内容区 + 左侧导航的两栏布局：左树与右侧内容各自独立成卡 */
.with-cat-nav {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}

.with-cat-nav > .cat-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 16px;
    padding: 1.25rem 1.35rem 0;
    box-shadow: var(--crm-shadow);
    min-height: 0;
    overflow-y: auto;
}

/* 带左侧分类树的页面：外层卡片退化为透明容器，避免卡中套卡双重边框 */
.page-card:has(.with-cat-nav) {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

/* 左侧菜单滚动条：细身 + 圆角 + 半透明白，跟深色渐变底融为一体；隐藏上下三角按钮 */
.sidebar .nav-scrollable {
    color-scheme: dark;
    scrollbar-width: thin;                                          /* Firefox */
    scrollbar-color: rgba(255, 255, 255, .3) transparent;           /* Firefox */
}

    .sidebar .nav-scrollable::-webkit-scrollbar {
        width: 8px;
    }

    .sidebar .nav-scrollable::-webkit-scrollbar-track {
        background: transparent;
        margin: 8px 0;
    }

    .sidebar .nav-scrollable::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .26);
        border-radius: 999px;
        transition: background .15s ease;
    }

    .sidebar .nav-scrollable::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, .5);
    }

    .sidebar .nav-scrollable::-webkit-scrollbar-thumb:active {
        background: rgba(255, 255, 255, .62);
    }

    .sidebar .nav-scrollable::-webkit-scrollbar-button,
    .sidebar .nav-scrollable::-webkit-scrollbar-corner {
        display: none;
        height: 0;
        width: 0;
    }

    /* 鼠标移到菜单上时滑条才变亮，平时更含蓄 */
    .sidebar:hover .nav-scrollable::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .34);
    }

/* ===== 左侧导航深色主题覆写 ===== */
.sidebar {
    background: linear-gradient(180deg, #142c30 0%, #10242d 42%, #0d1b28 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, .055);
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 15% 0%, rgba(40, 180, 137, .13), transparent 34%);
}

/* 品牌区 */
.sidebar .top-row {
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
}

/* 搜索框 */
.sidebar .nav-search input {
    background: rgba(255,255,255,0.055) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    color: #e8eef2 !important;
    border-radius: 9px !important;
}

.sidebar .nav-search input::placeholder {
    color: rgba(226, 238, 241, .38);
}

/* 分组标题 */
.sidebar .nav-group-toggle {
    color: rgba(233, 242, 245, 0.78) !important;
    border-radius: 10px !important;
}

.sidebar .nav-group-toggle:hover {
    background-color: rgba(255,255,255,0.055) !important;
    color: #fff !important;
}

.sidebar .nav-group-toggle.group-open {
    background-color: rgba(255,255,255,.045) !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* 子项容器：左侧连接线 */
.sidebar .nav-group-body {
    border-left: 1px solid rgba(126, 205, 181, .18) !important;
    margin-left: 1.75rem !important;
    padding-left: 1rem !important;
}

.sidebar .nav-group-body a.nav-link {
    color: rgba(221, 233, 237, 0.57) !important;
    background: none !important;
    border-radius: 7px !important;
}

.sidebar .nav-group-body a.nav-link:hover {
    color: #fff !important;
    background-color: rgba(255,255,255,0.055) !important;
}

.sidebar .nav-group-body a.nav-link.active {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(43, 181, 139, .19), rgba(43, 181, 139, .07)) !important;
    box-shadow: inset 2px 0 0 #31bd91;
}

/* 子项圆点 */
.sidebar .nav-group-body a.nav-link::before {
    content: "" !important;
    display: inline-block !important;
    width: 4px !important;
    height: 4px !important;
    border-radius: 50% !important;
    background: rgba(203, 226, 222, 0.28) !important;
    margin-right: 0.65rem !important;
}

.sidebar .nav-group-body a.nav-link:hover::before,
.sidebar .nav-group-body a.nav-link.active::before {
    background: #49caa2 !important;
    box-shadow: 0 0 0 3px rgba(73, 202, 162, .10);
}

/* 导航底部呼吸空间 */
.sidebar .nav-scrollable {
    padding-bottom: 1.25rem;
}

/* 分类下拉 + 齿轮：齿轮贴在右侧箭头前 */
.cat-field {
    position: relative;
}

    .cat-field > select {
        padding-right: 3.4rem;
    }

    .cat-field .cat-gear {
        position: absolute;
        top: 50%;
        right: 2.05rem;
        transform: translateY(-50%);
        border: 0;
        background: transparent;
        padding: 0 0.15rem;
        line-height: 1;
        font-size: 1.05rem;
        color: #64748b;
        cursor: pointer;
        border-radius: 4px;
    }

        .cat-field .cat-gear:hover:not(:disabled) {
            color: #1d4ed8;
            background: #eef2ff;
        }

        .cat-field .cat-gear:disabled {
            color: #cbd5e1;
            cursor: not-allowed;
        }

/* 分类字典编辑器：盖在业务弹框之上 */
.modal-mask-top {
    z-index: 1300;
}

/* 分类编辑弹窗可能再打开字典弹窗：去掉会建立包含块的滤镜与位移动画，
   让内层 fixed 弹窗真正覆盖视口；保留淡入，不影响其他弹窗。 */
.cat-edit-mask {
    z-index: 1290;
    backdrop-filter: none;
}

.cat-edit-mask > .modal-box {
    animation: cat-edit-box-in .18s ease;
}

@keyframes cat-edit-box-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cat-dict-table td,
.cat-dict-table th {
    vertical-align: middle;
}

.cat-dict-row {
    cursor: grab;
}

    .cat-dict-row.dragging {
        opacity: .45;
        background: #eef2ff;
    }

.cat-drag {
    margin-left: 0.4rem;
    color: #94a3b8;
    letter-spacing: -2px;
    cursor: grab;
}

/* 分类颜色小圆点（导航树与列表共用） */
.cat-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    margin-right: 0.45rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

/* ===================== 详情页/表单字号统一 ===================== */
/* 约定：stat-card 里的 stat-value 默认放「数字/金额」（1.35rem，一眼看结论）；
   放文字内容（名称、地址、银行、日期……）一律加 vtext，避免旧页面 fs-5 / fs-6 混排导致忽大忽小 */
.stat-value.vtext {
    font-size: .96rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    color: #344256;
    word-break: break-all;
}

/* 主标题右侧的补充说明（编号、客户名、规格等），全站一个口径 */
.h-sub {
    font-size: .82rem;
    font-weight: 400;
    color: #8490a1;
}

/* ===================== 操作日志（ChangeLog 组件 / 全局日志页） ===================== */
/* 折叠面板：默认收起，只显一行「展开查看（共 N 条）」，点开才列明细，避免长日志撑高页面触发滚动条 */
.chg-block {
    margin-top: .25rem;
}

.chg-summary {
    cursor: pointer;
    color: #6c757d;
    font-size: .9rem;
    user-select: none;
    padding: .1rem 0;
}

    .chg-summary:hover {
        color: #1b6ec2;
    }

    /* 展开后摘要行颜色加深并与明细拉开间距 */
    .chg-block[open] > .chg-summary {
        color: #475569;
        margin-bottom: .5rem;
    }

.chg-list {
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    background: #fbfcfe;
    padding: 0 .75rem;
    max-height: 22rem;
    overflow: auto;
}

.chg-item {
    padding: .45rem 0;
}

    .chg-item + .chg-item {
        border-top: 1px dashed #e6ebf2;
    }

.chg-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .85rem;
}

.chg-act {
    border-radius: 4px;
    padding: .05rem .4rem;
    font-size: .78rem;
    background: #eef2f7;
    color: #475569;
    white-space: nowrap;
}

    .chg-act.chg-new {
        background: #e6f6ec;
        color: #1a7f45;
    }

    .chg-act.chg-edit {
        background: #e8f1fb;
        color: #1b6ec2;
    }

    .chg-act.chg-del {
        background: #fdecec;
        color: #c0392b;
    }

.chg-user {
    color: #334155;
}

.chg-time {
    margin-left: auto;
    color: #94a3b8;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.chg-line {
    font-size: .85rem;
    color: #475569;
    padding-left: .55rem;
    margin-top: .2rem;
    line-height: 1.5;
    word-break: break-all;
}

.chg-old {
    color: #b0413e;
}

.chg-to {
    color: #94a3b8;
}

.chg-now {
    color: #1a7f45;
}

.chg-empty,
.chg-more {
    font-size: .82rem;
    color: #8a94a6;
    margin-top: .2rem;
}

/* 全局日志页：变更明细单元格 */
.log-detail {
    white-space: pre-line;
    font-size: .82rem;
    color: #475569;
    max-width: 640px;
    word-break: break-all;
}

/* ===================== 日期选择器 Flatpickr 主题定制 ===================== */
input[type="date"] {
    font-size: .88rem;
    min-height: 2.45rem;
    padding: 0.4rem 0.7rem;
}

/* Flatpickr 弹窗统一绿色主题 + 简化导航 */
.flatpickr-calendar {
    font-size: .9rem;
    border-radius: 14px !important;
    box-shadow: 0 18px 48px rgba(21, 35, 56, .18);
    border: 1px solid #e2e8ee;
    width: auto;
    overflow: hidden;
}

/* 月份头栏圆角跟随父容器 */
.flatpickr-calendar .flatpickr-months {
    border-radius: 13px 13px 0 0;
    overflow: hidden;
}

.flatpickr-calendar .flatpickr-day {
    width: 38px;
    height: 38px;
    line-height: 38px;
    border-radius: 9px;
    font-size: .86rem;
    border: none !important;
    box-shadow: none;
}

/* 去除日期网格容器边框 */
.flatpickr-calendar .flatpickr-days,
.flatpickr-calendar .dayContainer {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.selected:hover {
    background: #16b886;
    border-color: #16b886;
    color: #fff !important;
}

.flatpickr-calendar .flatpickr-day.today {
    border-color: #16b886;
    color: #16b886;
    font-weight: 700;
}

.flatpickr-calendar .flatpickr-day:hover {
    background: #e6f9f2;
    border-color: #e6f9f2;
}

.flatpickr-calendar .flatpickr-months .flatpickr-month {
    background: #f3f8f6;
    color: #28715b;
    fill: #28715b;
    font-weight: 400;
}

.flatpickr-calendar .flatpickr-current-month .cur-month,
.flatpickr-calendar .flatpickr-current-month input.cur-year {
    font-size: 1rem;
    color: #1a7a5a;
}

/* 年份编辑框的上下箭头保留（用于年份调节） */
.flatpickr-calendar .flatpickr-current-month .numInputWrapper span.arrowUp,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper span.arrowDown {
    display: block;
    opacity: 0.4;
}


.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month {
    color: #1a7a5a;
    fill: #1a7a5a;
    padding: 8px;
}

.flatpickr-calendar .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-next-month:hover {
    color: #16b886;
    fill: #16b886;
}

/* 去年份跳转按钮（《 》） */
/* 保留年份箭头，不隐藏 */

.flatpickr-calendar .flatpickr-weekday {
    background: transparent;
    color: #555;
    font-size: .85rem;
    font-weight: 600;
}

.flatpickr-calendar .flatpickr-innerContainer {
    padding: 4px 8px 8px;
}

.flatpickr-calendar .flatpickr-time .numInputWrapper span.arrowUp,
.flatpickr-calendar .flatpickr-time .numInputWrapper span.arrowDown {
    display: none;
}

/* ===================== 长明细表体内部滚动（单据编辑器明细用） ===================== */
/* 明细行很多时，让表格区域自身纵向滚动（表头吸顶、合计行吸底），
   避免整张 .page-card 被几十行明细撑高后出现整页长滚。与 .chg-list / .picker-body 同一“固定高 + 内滚”口径 */
.lines-scroll {
    max-height: 55vh;
    overflow: auto;
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    background: #fff;
}

    .lines-scroll > .table {
        margin-bottom: 0;
        border: none;
        border-radius: 0;
    }

    /* 吸顶表头 / 吸底合计：都给不透明底，滚动时下层行文字不会从缝里穿透；
       选择器比全局 .table>thead>th{position:relative}（列宽拖拽把手用）更具体，sticky 取而代之，把手绝对定位仍相对 th 生效 */
    .lines-scroll > .table > thead > tr > th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #f6f8fb;
    }

    .lines-scroll > .table > tfoot > tr > th,
    .lines-scroll > .table > tfoot > tr > td {
        position: sticky;
        bottom: 0;
        z-index: 2;
        background: #f3f8f6;
    }

/* ===================== 移动端响应式（≤640.98px，与 MainLayout 桌面断点 641px 共口径） ===================== */
/* 移动端只读卡片（MobileCardList 组件渲出的 m-card 结构）：卡片模板来自各页面的
   RenderFragment（带页面自己的 scoped 属性），故样式必须放全局 app.css 才能命中。
   口径复用：边框/圆角同 .stat-card，主色 #1b6ec2，金额数字同 .money */
.m-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 3px 14px rgba(21, 35, 56, .05);
}

/* 整卡点击热区（stretched-link）：空链接铺满卡片，跳转只读详情页 */
.m-stretch {
    position: static;
}

.m-stretch::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* 卡内真正的子链接（客户/订单等）需浮于整卡热区之上，才能单独点击 */
.m-card .m-main a,
.m-card .m-side a {
    position: relative;
    z-index: 2;
}

.m-card a {
    color: #128363;
    text-decoration: none;
}

.m-main {
    flex: 1 1 auto;
    min-width: 0;
}

.m-side {
    flex: 0 0 auto;
    text-align: right;
    padding-left: 0.5rem;
    border-left: 1px solid #f1f5f9;
}

.m-title {
    font-size: .96rem;
    font-weight: 400;
    color: #263449;
    line-height: 1.4;
    word-break: break-all;
}

.m-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.1rem;
    word-break: break-all;
}

.m-row {
    font-size: 0.85rem;
    color: #475569;
    margin-top: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
}

.m-amt {
    font-size: 1.02rem;
    font-weight: 400;
    color: #263449;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.m-amt-sub {
    font-size: 0.78rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    margin-top: 0.15rem;
    white-space: nowrap;
}

/* 卡片内轻量状态标签（纯展示，替代桌面端 BizStatusChips/StatusBadge 的只读呈现） */
.m-tag {
    display: inline-block;
    font-size: .74rem;
    line-height: 1;
    padding: 0.3rem 0.52rem;
    border-radius: 6px;
    background: #eef2f7;
    color: #475569;
    white-space: nowrap;
}

.m-tag.lit {
    background: #e6f6ec;
    color: #1a7f45;
}

.m-tag.pending {
    background: #fdecec;
    color: #c0392b;
}

.m-tag.info {
    background: #e8f1fb;
    color: #1b6ec2;
}

/* 分类色点：与 .cat-dot 同口径 */
.m-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
    margin-right: 0.3rem;
}

.m-empty {
    text-align: center;
    color: #8a94a6;
    font-size: 0.9rem;
    padding: 2rem 0;
}

/* 到期提醒页的移动端返回链接（桌面端工具条里已有同功能按钮，隐藏） */
.m-back { display: none; }

/* 视图切换约定：桌面 = 表格；移动 = 卡片。列表页把原 <div class="table-responsive"> 追加 m-table、
   其后并列 MobileCardList（m-cards）；工具条行追加 m-hide。未接入卡片的页面仅靠表格横滑兜底 */
.m-cards { display: none; }              /* 桌面隐藏卡片 */

/* 权限设置页布局：桌面左右并排，移动上下堆叠 */
.perm-layout { display: flex; gap: 16px; align-items: flex-start; }
.perm-cats { width: 200px; flex-shrink: 0; }
.perm-grid { flex: 1; min-width: 0; }

@media (max-width: 640.98px) {
    /* --- 双视图切换 --- */
    .m-table { display: none !important; }
    .m-cards { display: block; }
    .m-hide { display: none !important; }   /* 写操作入口（新增/多选/批量）手机不呈现 */

    /* --- 表格横滑兜底 --- */
    .table-responsive table { font-size: 0.85rem; }
    .table > thead > tr > th::before,
    .table > thead > tr > th::after { display: none; }   /* 列宽拖拽把手：触摸不可用，收起避免误触与溢出 */
    .table-responsive thead th { position: static !important; }  /* 短屏下吸顶意义不大，且规避 sticky 嵌套抖动 */
    /* 触屏无 hover：行悬停底色会变“粘滞残留”，关闭 */
    .table-hover > tbody > tr:hover { --bs-table-hover-bg: transparent; }

    /* --- 表格容器：横向滚动仍收在 .table-responsive 自身层，不污染整页 --- */

    /* --- 触摸热区：按钮/表单控件加大到 ~40px --- */
    .btn-sm { padding: 0.4rem 0.7rem; }
    .form-control-sm, .form-select-sm { min-height: 2.1rem; }
    .form-check-input { min-width: 1.15rem; min-height: 1.15rem; }
    .pagination .page-link { padding: 0.4rem 0.7rem; }

    /* --- 分页条：居中换行，跳转段不再右推成孤行 --- */
    .pager-bar { justify-content: center; row-gap: 0.4rem; }
    .pager-jump { margin-left: 0; }

    /* --- 弹层全屏化 --- */
    .modal-box, .modal-box-wide {
        max-width: none;
        width: 100%;
        min-height: 100dvh;
        margin: 0;
        border-radius: 0;
        padding: 1rem;
        overflow-y: auto;
    }

    /* --- 产品选择弹窗：左树右表改上下堆叠 --- */
    .picker-layout { flex-direction: column; }
    .picker-tree { flex: 0 0 auto; max-height: 30vh; border-right: none; border-bottom: 1px solid #e3e8ee; padding: 0 0 .5rem; }
    .picker-body { max-height: 45vh; }

    /* --- 分类字典弹框里的手柄拖拽：触摸不可用，隐藏 --- */
    .cat-drag { display: none; }

    /* --- 穿透页“＋新建”角标依赖 hover，触屏永远不可见；手机只读口径下直接收起 --- */
    .nav-tabs .nav-item .tab-new,
        .nav-pills .nav-item .tab-new { display: none; }

    /* --- 左侧分类树：手机只读口径下整体隐藏（筛选是桌面维护动作，卡片视图平铺全量数据） --- */
    .with-cat-nav { flex-direction: column; }
    .with-cat-nav > div:has(> .cat-nav) { display: none; }

    /* --- Flatpickr 日历 320px，375px 屏下留出安全边距 --- */
    .flatpickr-calendar { max-width: 94vw; }

    /* --- 卡片间距 --- */
    .m-cards > * + * { margin-top: 0.6rem; }

    .m-back {
        display: inline-block;
        margin-bottom: 0.6rem;
        font-size: 0.9rem;
    }

    /* --- 权限设置页移动端响应式 --- */
    .perm-layout {
        flex-direction: column;
    }
    .perm-cats {
        width: 100%;
    }
    .perm-cats .list-group {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
        -webkit-overflow-scrolling: touch;
    }
    .perm-cats .list-group-item {
        flex-shrink: 0;
        border-radius: 20px !important;
        border: 1px solid var(--bs-border-color);
        margin-right: 6px;
        padding: 0.35rem 0.8rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    .perm-grid .card .card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .perm-grid .card table {
        width: auto !important;
        min-width: 560px;
        table-layout: auto !important;
    }
}

/* ===== 全局卡片：克制边框与柔和层次，不使用厚重渐变 ===== */
.card {
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    box-shadow: var(--crm-shadow);
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
    background: #fff;
}

.card > .card-header:first-child {
    border-radius: 13px 13px 0 0;
    overflow: hidden;
}

.card:hover {
    border-color: #dfe6ed;
    box-shadow: 0 10px 30px rgba(21, 35, 56, .065);
}

/* 编辑页顶部工具条：
   ① flex-shrink:0 —— .page-card 是 flex 纵向容器，而 .card 带 overflow:hidden 会使其自动最小尺寸降为 0，
      内容超高时工具条会被 flex 收缩到只剩边框（约 1px）而被 overflow 裁空、表现为“顶部信息栏被彻底隐藏”；禁止收缩即恢复自然高度。
   ② sticky —— 随 .page-card 内容滚动时钉在卡片顶部内缘，保证「返回列表/取消/保存」在任何缩放与滚动位置都可见可点。 */
.editor-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
    border-color: #dfe8e3;
    background: linear-gradient(110deg, #fbfdfc, #ffffff 55%, #f8fbfa);
    box-shadow: 0 5px 18px rgba(21, 35, 56, .055);
}

.editor-toolbar .card-body {
    min-height: 3.8rem;
    padding: .8rem 1.15rem;
}

/* 卡片内表格强制不超出容器，内容自动换行 */
.card-body .table {
    width: 100%;
    table-layout: fixed;
}

.card-body .table td,
.card-body .table th {
    white-space: normal;
    overflow-wrap: break-word;
    padding: 0.48rem 0.55rem;
}

.card-header {
    background: #f8fafb;
    border-bottom: 1px solid var(--crm-line);
    font-weight: 400;
    font-size: .84rem;
    letter-spacing: .02em;
    color: #4e5d71;
    padding: .8rem 1.05rem;
}

.card-footer {
    background: #fafbfc;
    border-top: 1px solid var(--crm-line);
}

/* 编辑页分区标题：已有 .text-muted.small 结构，不改页面标记也能统一层级 */
.page-card .text-muted.small.mb-2 {
    margin-bottom: .65rem !important;
    padding-left: .65rem;
    border-left: 3px solid #8fd2b9;
    color: #516276 !important;
    font-size: .82rem;
    line-height: 1.35;
    letter-spacing: .025em;
}

/* 列表工具条：不改变内部控件顺序，只统一承载区域的视觉边界 */
.cat-main > .m-hide:first-child,
.page-card > .m-hide:first-child {
    margin-bottom: .85rem;
    padding: .65rem .7rem;
    border: 1px solid #edf0f4;
    border-radius: 11px;
    background: #fafbfd;
}

.cat-main > .m-hide:first-child .form-control,
.page-card > .m-hide:first-child .form-control {
    background: #fff;
}

/* ===== 全局按钮颜色优化（深翡翠主色 + 中性辅助色） ===== */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--crm-green);
    --bs-btn-border-color: var(--crm-green);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--crm-green-dark);
    --bs-btn-hover-border-color: var(--crm-green-dark);
    --bs-btn-active-bg: #096a4c;
    --bs-btn-active-border-color: #096a4c;
    --bs-btn-disabled-bg: #82cdb2;
    --bs-btn-disabled-border-color: #82cdb2;
    --bs-btn-disabled-opacity: .55;
    box-shadow: 0 3px 8px rgba(22, 163, 116, .16);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 5px 14px rgba(22, 163, 116, .22);
}

.btn-success {
    --bs-btn-bg: #318a9e;
    --bs-btn-border-color: #318a9e;
    --bs-btn-hover-bg: #267387;
    --bs-btn-hover-border-color: #267387;
    --bs-btn-active-bg: #1e5f70;
    --bs-btn-active-border-color: #1e5f70;
}

.btn-secondary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #748196;
    --bs-btn-border-color: #748196;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #5d6b7f;
    --bs-btn-hover-border-color: #5d6b7f;
    --bs-btn-active-bg: #4c596b;
    --bs-btn-active-border-color: #4c596b;
}

.btn-outline-secondary {
    --bs-btn-color: #657286;
    --bs-btn-border-color: #dce2e9;
    --bs-btn-hover-bg: #f5f7fa;
    --bs-btn-hover-border-color: #cbd4de;
    --bs-btn-hover-color: #3c4a5e;
    --bs-btn-active-bg: #edf1f5;
    --bs-btn-active-border-color: #c3cdd9;
    --bs-btn-active-color: #3c4a5e;
}

.btn-danger {
    --bs-btn-bg: #d95656;
    --bs-btn-border-color: #d95656;
    --bs-btn-hover-bg: #c44444;
    --bs-btn-hover-border-color: #c44444;
    --bs-btn-active-bg: #ad3939;
    --bs-btn-active-border-color: #ad3939;
}

/* 可搜索下拉：清除按钮内嵌在输入框右侧 */
.ss-wrap .ss-clear {
    position: absolute;
    top: 50%;
    right: 0.6rem;
    transform: translateY(-50%);
    z-index: 5;
    font-size: 0.75rem;
    opacity: 0.5;
}
.ss-wrap .ss-clear:hover { opacity: 1; }
.ss-wrap input { padding-right: 2rem; }

/* ===== 首页看板：分段筛选与分区标题 ===== */
.dashboard-toolbar {
    padding: .38rem .45rem;
    border: 1px solid #e5eaf0;
    border-radius: 11px;
    background: #f8fafc;
}

.dashboard-toolbar-label {
    padding: 0 .55rem 0 .35rem;
    color: #788497;
    font-size: .78rem;
    white-space: nowrap;
}

.dashboard-toolbar .btn {
    min-width: 3.5rem;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: #6e7b8e;
}

.dashboard-toolbar .btn-outline-primary:hover {
    color: #0f6f51;
    background: #edf6f2;
}

.dashboard-toolbar .btn-primary,
.dashboard-toolbar .btn-primary:hover {
    color: #fff;
    background: var(--crm-green);
    box-shadow: 0 3px 8px rgba(22, 163, 116, .16);
}

.dashboard-section-title {
    position: relative;
    padding-left: .75rem;
    color: #3c4b61;
    font-size: .9rem;
    font-weight: 400;
    letter-spacing: .025em;
}

.dashboard-section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: .9rem;
    border-radius: 999px;
    background: #7ec6aa;
    transform: translateY(-50%);
}

.login-footer {
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid #edf0f4;
    color: #9aa4b2;
    font-size: .72rem;
    text-align: center;
    letter-spacing: .05em;
}

.alert {
    border-radius: 10px;
    font-size: .84rem;
}

.sidebar > .top-row,
.sidebar > .nav-scrollable {
    position: relative;
    z-index: 1;
}

@media (max-width: 640.98px) {
    .dashboard-toolbar {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding: .35rem;
    }

    .dashboard-toolbar .btn {
        flex: 0 0 auto;
        min-width: auto;
        padding-left: .62rem;
        padding-right: .62rem;
    }

    .login-card {
        padding: 2rem 1.5rem 1.75rem;
        border-radius: 17px;
    }
}

/* ===== 系统设置 / 权限设置 / 打印模板：统一工作台容器与左侧导航 ===== */
.page-card:has(.settings-page),
.page-card:has(.studio-page) {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

.settings-page,
.studio-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    min-width: 0;
}

.settings-layout > * {
    min-width: 0;
}

.studio-title,
.settings-panel h5 {
    position: relative;
    padding-left: .75rem;
    color: var(--crm-ink);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: .02em;
    line-height: 1.35;
}

.studio-title::before,
.settings-panel h5::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #1aa97b, #75c8aa);
    transform: translateY(-50%);
}

.studio-workspace {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 250px;
    gap: 1rem;
    align-items: start;
    min-width: 0;
}

.studio-workspace.is-landscape {
    grid-template-columns: 220px minmax(0, 1fr) 230px;
}

.studio-sidebar,
.studio-center,
.studio-inspector {
    min-width: 0;
}

.studio-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.studio-action-buttons .btn {
    padding: .4rem .5rem;
    white-space: nowrap;
}

.settings-nav,
.studio-list {
    width: 100%;
    padding: .35rem;
    gap: .15rem;
    background: #fff;
    border: 1px solid var(--crm-line);
    border-radius: 12px;
    box-shadow: var(--crm-shadow);
}

.studio-type-tabs {
    display: contents;
}

.settings-nav > .list-group-item,
.studio-list > .studio-type-btn,
.studio-type-tabs > .studio-type-btn {
    border: 0 !important;
    border-radius: 8px !important;
}

.studio-type-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
}

.studio-type-btn.active {
    border-radius: 8px;
}

.studio-type-caret {
    flex: 0 0 auto;
    font-size: .72rem;
    opacity: .75;
    transition: transform .16s ease;
}

.studio-type-btn.active .studio-type-caret {
    transform: rotate(180deg);
}

.studio-template-list {
    margin: .15rem .25rem .25rem;
    padding: .25rem;
    background: #f4f8f6;
    border: 0;
    border-radius: 8px;
}

.studio-template-list .td-sub {
    border-color: transparent;
    background: transparent;
}

.studio-template-list .td-sub.td-sub-sel {
    border-color: #cdeadd;
    background: #e9f6f0;
}

.studio-canvas-card {
    min-width: 0;
}

.studio-canvas-card .card-body {
    padding: 1rem;
}

.studio-canvas-card .td-canvas {
    border-radius: 12px;
}

.nav-pills {
    --bs-nav-pills-border-radius: 8px;
    --bs-nav-pills-link-active-color: #fff;
    --bs-nav-pills-link-active-bg: var(--crm-green);
}

.nav-pills .nav-link {
    padding: .45rem .85rem;
    color: #4b596d;
}

.nav-pills .nav-link:hover {
    background: #eef8f4;
    color: #0f6f51;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: linear-gradient(110deg, var(--crm-green), #14866f);
    color: #fff;
    box-shadow: 0 6px 14px rgba(22, 163, 116, .18), inset 3px 0 0 #58c9a4;
}

/* 所有剩余 list-group 选中态统一为翡翠绿，不再露出 Bootstrap 默认蓝 */
.list-group {
    border-radius: 12px;
}

.list-group-item {
    border-color: #e5eaf0;
    color: #4b596d;
    font-size: .86rem;
    padding: .62rem .8rem;
}

.list-group-item-action:hover {
    background: #f3f8f6;
    color: #0f6f51;
}

.list-group-item-action.active,
.list-group-item-action.active:hover {
    background: linear-gradient(110deg, var(--crm-green), #14866f);
    border-color: var(--crm-green);
    color: #fff;
    box-shadow: 0 6px 14px rgba(22, 163, 116, .18), inset 3px 0 0 #58c9a4;
}

.settings-panel {
    min-width: 0;
    padding: 1.25rem 1.35rem 1.35rem;
    background: #fff;
    border: 1px solid var(--crm-line);
    border-radius: 16px;
    box-shadow: var(--crm-shadow);
}

.settings-panel .table-responsive {
    border-radius: 12px;
}

.settings-panel .table-responsive > .table {
    margin-bottom: 0;
}

@media (max-width: 1199.98px) {
    .settings-table-billno { min-width: 720px; }
    .settings-table-bank { min-width: 800px; }
    .settings-table-flow { min-width: 780px; }
}

.settings-panel .alert {
    margin-top: .75rem;
}

/* 设置页选中账户行：与全局选中态一致使用浅翡翠绿 */
.table > tbody > tr.table-primary {
    --bs-table-bg: #eef8f4;
    --bs-table-accent-bg: #eef8f4;
    --bs-table-hover-bg: #e6f5ef;
}

.table > tbody > tr.table-primary > td {
    background-color: #eef8f4;
}

/* 工资总表工具条：与列表页统一为浅灰承载面 */
.payroll-toolbar {
    padding: .65rem .7rem;
    border: 1px solid #e8edf2;
    border-radius: 11px;
    background: #fafbfd;
}

.payroll-toolbar .form-select {
    background-color: #fff;
}

/* 中等宽度下分类导航改为横向筛选条，把宽度完整让给主表 */
@media (min-width: 641px) and (max-width: 1100px) {
    .with-cat-nav {
        flex-direction: column;
        gap: .75rem;
    }

    .with-cat-nav > div:has(> .cat-nav) {
        flex: 0 0 auto !important;
        width: 100%;
    }

    .with-cat-nav .cat-nav {
        position: static;
        display: flex;
        align-items: center;
        gap: .25rem;
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: none;
        padding: .45rem;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .with-cat-nav .cat-nav .cat-item {
        flex: 0 0 auto;
        min-height: 2.15rem;
        padding: .42rem .7rem;
        border-radius: 8px;
    }

    .with-cat-nav .cat-nav .cat-child {
        padding-left: .7rem;
    }

    .with-cat-nav .cat-nav .cat-arrow {
        flex: 0 0 1rem;
    }

    .with-cat-nav > .cat-main {
        width: 100%;
    }
}

/* 打印设计器在窄桌面把属性面板移到画布下方；平板/手机改为单列 */
@media (max-width: 1199.98px) {
    .studio-workspace,
    .studio-workspace.is-landscape {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .studio-inspector {
        grid-column: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .studio-inspector .card {
        margin-bottom: 0 !important;
    }

    .studio-inspector .card-header {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .studio-inspector .card-header .form-select {
        width: 100% !important;
        max-width: none;
    }
}

@media (max-width: 991.98px) {
    .settings-layout,
    .studio-workspace,
    .studio-workspace.is-landscape {
        grid-template-columns: 1fr;
    }

    .studio-inspector {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .studio-list {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: .3rem;
        padding: .35rem;
        overflow: visible;
    }

    .studio-type-tabs {
        display: flex;
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: .3rem;
        width: 100%;
        padding-bottom: .15rem;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .studio-list .list-group-item {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
        border: 1px solid #e5eaf0 !important;
        border-radius: 8px !important;
        padding: .45rem .7rem;
    }

    .studio-template-list .list-group-item + .list-group-item {
        border-top: 1px solid #e5eaf0 !important;
    }

    .studio-template-list {
        flex: 0 0 auto;
        width: 100%;
        display: flex;
        gap: .3rem;
        margin: 0;
        padding: .35rem 0 0;
        overflow-x: auto;
        background: transparent;
        border: 0;
    }

    .studio-template-list .td-sub {
        flex: 0 0 210px;
        border: 1px solid #e5eaf0 !important;
        border-radius: 8px !important;
        background: #fff;
    }

    .settings-nav,
    .perm-nav {
        display: flex;
        flex-direction: row;
        gap: .3rem;
        padding: .35rem;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .settings-nav .list-group-item,
    .perm-nav .list-group-item {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
        border: 1px solid #e5eaf0 !important;
        border-radius: 8px !important;
        padding: .45rem .75rem;
    }

    .settings-nav .list-group-item + .list-group-item,
    .perm-nav .list-group-item + .list-group-item {
        border-top: 1px solid #e5eaf0 !important;
    }

    .studio-list .list-group-item.active,
    .settings-nav .list-group-item.active,
    .perm-nav .list-group-item.active {
        border-color: var(--crm-green) !important;
    }
}

@media (max-width: 640.98px) {
    .studio-inspector {
        grid-template-columns: 1fr;
    }

    .settings-panel {
        padding: .95rem .85rem 1rem;
    }

    .studio-canvas-card .card-body {
        padding: .75rem;
    }

    .td-canvas textarea {
        width: 100% !important;
    }

    .td-pager {
        flex-wrap: wrap;
        gap: .35rem .6rem;
    }

    .td-pager button {
        white-space: nowrap;
    }

    .td-pager > span {
        width: 100%;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

