/* ============================================================
   酷柚易汛 ERP · 全局样式（笔记本优先 · 方正扁平企业后台 v2）
   布局：白色方正侧栏(152px, 可折叠56px) + 白色顶栏(48px) + 主内容区
   断点：≤1400px（笔记本/高分缩放）侧栏自动收起为抽屉，内容全宽不横向溢出
   颜色规范：仅主操作实心蓝；危险操作描边红；其余按钮中性灰描边、线条清晰
   字体：macOS 真实苹方优先，Windows 落微软雅黑 UI
   尺寸规范：主按钮28px / mini22px；输入框30px；表格13px、单元格8px，纵向横向双紧凑
   ============================================================ */
:root {
    --color-primary: #165DFF;
    --color-primary-hover: #4080FF;
    --color-primary-active: #0E42D2;
    --color-primary-light: #E8F3FF;
    --color-bg-1: #F5F6F8;
    --color-bg-2: #F7F8FA;
    --color-text-1: #1D2129;
    --color-text-2: #4E5969;
    --color-text-3: #86909C;
    --color-text-4: #C9CDD4;
    --color-border: #E5E6EB;
    --color-border-strong: #C9CDD4;
    --color-success: #00B42A;
    --color-warning: #FF7D00;
    --color-danger: #F53F3F;
    --sidebar-width: 152px;
    --sidebar-collapsed: 56px;
    --header-height: 48px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --shadow-card: none;
    --shadow-hover: 0 4px 12px rgba(15, 23, 42, .12);
    /* 字体：macOS 真实苹方优先；Windows 无苹方，落微软雅黑 UI（Win10/11 内置、比雅黑更精致）；
       如需 Windows 也呈现苹方效果需另行引入字体文件（体积约数 MB），当前不内置 */
    --font: "PingFang SC", -apple-system, BlinkMacSystemFont, "Microsoft YaHei UI", "Microsoft YaHei", "Helvetica Neue", "Segoe UI", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--color-bg-1);
    color: var(--color-text-1);
    font-size: 14px;
    line-height: 1.5715;
    letter-spacing: .01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--header-height);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: none; }

::selection { background: rgba(22, 93, 255, .18); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #C9CDD4; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #A9AEB8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 顶栏（白色 · 48px） ---------------- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 14px;
    z-index: 130;
}
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--color-text-1);
    white-space: nowrap;
}
.topbar .brand:hover { color: var(--color-primary); }
.topbar .brand .logo-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--color-primary); display: inline-block; flex: none;
}
.topbar .top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar .user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 10px 0 3px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--color-text-2);
    white-space: nowrap;
    max-width: 220px;
}
.topbar .user-chip:hover { background: var(--color-bg-2); }
.topbar .user-chip .u-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--color-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; font-style: normal;
    flex: none;
}
.topbar .user-chip .u-name { overflow: hidden; text-overflow: ellipsis; }
.topbar .logout-link {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 2px;
    font-size: 13px;
    color: var(--color-text-2);
    white-space: nowrap;
}
.topbar .logout-link:hover { color: var(--color-primary); background: var(--color-bg-2); }
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    height: 30px;
    width: 30px;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: var(--color-text-2);
    border-radius: 2px;
    cursor: pointer;
    flex: none;
}
.menu-toggle:hover { color: var(--color-primary); background: var(--color-bg-2); }

/* ---------------- 布局壳 ---------------- */
.shell { display: flex; min-height: calc(100vh - var(--header-height)); }

/* ---------------- 左侧导航（白色 · 方正扁平 · 152px · 可折叠 56px） ---------------- */
.sidebar {
    position: fixed;
    top: var(--header-height); bottom: 0; left: 0;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 120;
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 0; }

/* 菜单项全宽平铺、直角、无阴影：方正扁平 */
.nav-group { margin-bottom: 0; }
.nav-group + .nav-group { border-top: 1px solid #F2F3F5; }
.nav-group-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-1);
    cursor: pointer;
    user-select: none;
    text-align: left;
    white-space: nowrap;
}
.nav-group-toggle .nav-icon {
    width: 20px;
    margin-right: 8px;
    text-align: center;
    font-size: 14px;
    color: var(--color-text-3);
    flex: none;
}
.nav-group-toggle .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-toggle:hover { background: var(--color-bg-2); color: var(--color-primary); }
.nav-group.open .nav-group-toggle { color: var(--color-primary); }
.nav-group.open .nav-group-toggle .nav-icon { color: var(--color-primary); }
.nav-arrow {
    width: 5px; height: 5px;
    margin-left: 4px;
    border-right: 1.5px solid var(--color-text-3);
    border-bottom: 1.5px solid var(--color-text-3);
    transform: rotate(-45deg);
    flex: none;
}
.nav-group.open .nav-arrow { transform: rotate(45deg); border-color: var(--color-primary); }

/* 二级菜单：全宽平铺、浅缩进（显示全文字）、active 左侧 3px 蓝条 + 浅蓝底 */
.nav-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
}
.nav-group.open .nav-tree { max-height: 760px; padding-bottom: 2px; }
.nav-tree a {
    display: flex;
    align-items: center;
    height: 36px;
    margin: 0;
    padding: 0 10px 0 26px;
    border-radius: 0;
    font-size: 13px;
    color: var(--color-text-2);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-tree a:hover { color: var(--color-primary); background: var(--color-bg-2); }
.nav-tree a.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: inset 3px 0 0 var(--color-primary);
    font-weight: 600;
}

/* 侧栏折叠（宽表场景释放横向空间） */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-top: 1px solid var(--color-border);
    background: transparent;
    border-radius: 0;
    color: var(--color-text-3);
    font-size: 12px;
    cursor: pointer;
    flex: none;
}
.sidebar-collapse-btn:hover { color: var(--color-text-1); background: var(--color-bg-2); }
.sidebar-collapse-btn .col-icon { margin-right: 6px; font-size: 13px; }

body.sidebar-collapsed .nav-group-toggle { display: none; }
body.sidebar-collapsed .nav-tree { max-height: none; padding-bottom: 0; }
body.sidebar-collapsed .nav-tree a { justify-content: center; padding: 0; height: 34px; font-size: 12px; box-shadow: none; }
body.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar-collapse-btn .col-icon { margin-right: 0; }
body.sidebar-collapsed .sidebar-collapse-btn .col-label { display: none; }

/* ---------------- 主内容区 ---------------- */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 16px 16px 32px;
}
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }
.shell-plain .main-content { margin-left: 0; padding: 32px 16px; }

.sidebar-mask {
    display: none;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: rgba(0, 0, 0, .45);
    z-index: 115;
}

/* ---------------- 卡片 ---------------- */
.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: none;
    padding: 16px;
}
/* 单据编辑/开单窗口顶部收紧（旧系统编辑页按钮行贴顶，无标题卡片大留白） */
.card.order-edit { padding-top: 8px; }
.card.order-edit .page-head { margin-bottom: 2px; }
.card.order-edit .order-head { margin-bottom: 2px; }

/* ---------------- 页头 / 面包屑 ---------------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.page-head .head-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.page-head h2 { font-size: 17px; font-weight: 600; color: var(--color-text-1); white-space: nowrap; }
.page-head .crumb { display: flex; align-items: center; gap: 4px; color: var(--color-text-3); font-size: 12px; white-space: nowrap; }
.page-head .crumb a { color: var(--color-text-2); }
.page-head .crumb a:hover { color: var(--color-primary); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.page-actions .toolbar { margin: 0; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    color: var(--color-text-1);
    background: #fff;
    border: 1px solid var(--color-border-strong);
    border-radius: 2px;
    font-size: 13px;
    text-decoration: none;
}
.back-link:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }

/* ---------------- 按钮（颜色规范：仅主操作实心蓝；危险描边红；其余中性灰描边，hover 转主题蓝） ---------------- */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 2px;
    background: var(--color-primary);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}
button:hover { background: var(--color-primary-hover); }
button:active { background: var(--color-primary-active); }
button:focus-visible { outline: 2px solid rgba(22, 93, 255, .35); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.btn-primary:active { background: var(--color-primary-active); border-color: var(--color-primary-active); color: #fff; }
.btn-plain { background: #fff; border-color: var(--color-border-strong); color: var(--color-text-1); }
.btn-plain:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.btn-plain:active { border-color: var(--color-primary-active); color: var(--color-primary-active); background: var(--color-primary-light); }
.btn-danger { background: #fff; border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger:hover { background: #FFF1F0; border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger:active { background: #FFE4E1; border-color: var(--color-danger); color: var(--color-danger); }
.btn-warning { background: #fff; border-color: var(--color-warning); color: var(--color-warning); }
.btn-warning:hover { background: #FFF3E8; border-color: var(--color-warning); color: var(--color-warning); }
.btn-outline { background: #fff; color: var(--color-text-1); border-color: var(--color-border-strong); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.btn-mini {
    height: 26px;
    padding: 0 12px;
    border-radius: 2px;
    background: #fff;
    border-color: var(--color-border-strong);
    color: var(--color-text-1);
    font-size: 13px;
    margin-right: 4px;
    white-space: nowrap;
    line-height: 1;
}
.btn-mini:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.btn-mini.btn-danger { background: #fff; border-color: var(--color-danger); color: var(--color-danger); }
.btn-mini.btn-danger:hover { background: #FFF1F0; border-color: var(--color-danger); color: var(--color-danger); }
.btn-mini.btn-plain { background: #fff; border-color: var(--color-border-strong); color: var(--color-text-1); }
.btn-mini.btn-plain:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }

/* 旧系统同款：明细行增删图标按钮（fa fa-plus / fa fa-trash） */
.row-op { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.row-op .add, .row-op .del { cursor: pointer; font-size: 13px; color: var(--color-text-3); line-height: 1; padding: 2px; }
.row-op .add:hover { color: var(--color-primary); }
.row-op .del:hover { color: var(--color-danger); }
.btn-mini i.fa { margin-right: 2px; }
.btn-mini.btn-add, .btn-mini.btn-del { display: inline-flex; align-items: center; justify-content: center; width: 26px; min-width: 26px; height: 26px; margin: 0 2px; padding: 0; font-size: 13px; }
.toolbar .tb-btn i.fa, .toolbar button i.fa, .page-actions button i.fa, .page-actions a i.fa { margin-right: 4px; }
/* a 标签按钮补齐 button 同款盒模型（打印/返回/前往反审核等链接型按钮） */
a.btn-plain, a.btn-outline, a.btn-danger, a.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-width: 1px;
    border-style: solid;
    line-height: 1;
    font-weight: 500;
    text-decoration: none;
}
a.btn-plain, a.btn-outline, a.btn-danger { height: 32px; padding: 0 16px; border-radius: 2px; font-size: 14px; }
a.btn-mini { height: 26px; padding: 0 12px; border-radius: 2px; font-size: 13px; white-space: nowrap; background: #fff; border-color: var(--color-border-strong); color: var(--color-text-1); }
a.btn-mini:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
a.btn-danger { background: #fff; color: var(--color-danger); border-color: var(--color-danger); }
a.btn-danger:hover { background: #FFF1F0; color: var(--color-danger); border-color: var(--color-danger); }
a.btn-outline { background: #fff; color: var(--color-text-1); border-color: var(--color-border-strong); }
a.btn-outline:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); }
a.btn-mini.btn-danger { background: #fff; color: var(--color-danger); border-color: var(--color-danger); }
a.btn-mini.btn-danger:hover { background: #FFF1F0; color: var(--color-danger); border-color: var(--color-danger); }
a.btn-mini.btn-plain { background: #fff; border-color: var(--color-border-strong); color: var(--color-text-1); }
a.btn-mini.btn-plain:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }

/* 行内超小按钮（成本核算列表等 JS 生成）：中性灰描边，btn-primary 为主操作实心蓝 */
.btn-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 12px;
    border-radius: 2px;
    border: 1px solid var(--color-border-strong);
    background: #fff;
    color: var(--color-text-1);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}
.btn-xs:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.btn-xs.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-xs.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.btn-xs.btn-warning { border-color: var(--color-warning); color: var(--color-warning); }
.btn-xs.btn-warning:hover { background: #FFF3E8; border-color: var(--color-warning); color: var(--color-warning); }

/* ---------------- 表单控件 ---------------- */
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    border: 1px solid var(--color-border);
    border-radius: 2px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    height: 32px;
    line-height: 1.5715;
    background: #fff;
    color: var(--color-text-1);
}
textarea { height: auto; min-height: 32px; padding: 7px 12px; resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: var(--color-text-4); }
input:hover, select:hover, textarea:hover { border-color: var(--color-primary-hover); }
input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, .12);
}
input[readonly] { background: var(--color-bg-2); }
input:disabled, select:disabled { background: var(--color-bg-2); color: var(--color-text-3); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-primary); width: 14px; height: 14px; }

label.form-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.form-label span { color: var(--color-text-2); }
.form-label .req, .req { color: var(--color-danger); font-style: normal; margin-left: 2px; }

/* 表单栅格：自适应列数，窄屏自动减列，不横向溢出 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 14px;
}
.form-grid label, .form-grid .form-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    min-width: 0;
}
.form-grid label > span, .form-grid .form-label > span {
    color: var(--color-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.form-grid input, .form-grid select, .form-grid textarea, .form-grid .picker { width: 100%; }
.form-actions { display: flex; justify-content: flex-start; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* 工具栏（列表页搜索行） */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type="text"] { width: 240px; max-width: 100%; }
.pager { margin-top: 10px; font-size: 12px; color: var(--color-text-3); text-align: right; }
.pager select.pager-sel { width: 64px; height: 26px; padding: 0 4px; font-size: 12px; border-radius: 2px; }

/* ---------------- 表格（统一浅灰线条；列表页限高滚动 + 吸顶表头） ---------------- */
.table-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
th { background: var(--color-bg-2); color: var(--color-text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
td { color: var(--color-text-1); word-break: break-word; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--color-bg-2); }
/* 金额/数值：纯黑色、不加粗、等宽数字（金额易读不乱） */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 400; color: #000; }

/* 数值/金额列（list.html renderRows 对 align=right 列自动加 cell-num） */
td.cell-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 400; color: #000; }

/* 长文本列（备注等）：cell-text 统一限宽省略，悬停 title 显示全文，点击弹出浮层 */

/* 长文本单元格点击浮层：可左右/上下拖动查看全文（list.html 渲染后自动为截断列挂 title） */
.text-tip {
    position: fixed;
    z-index: 400;
    max-width: 520px;
    max-height: 60vh;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    overflow: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-text-1);
    word-break: break-all;
    white-space: normal;
    cursor: default;
}

/* ---------------- 列表页表格：舒适行高、吸顶表头、轻 hover ---------------- */
#dataTable { font-size: 14px; }
#dataTable thead th {
    background: #F2F3F5;
    color: var(--color-text-1);
    font-weight: 600;
    font-size: 13px;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 3;
}
#dataTable thead th:first-child { border-left: none; }
/* 长文本列限宽截断：仅纯文本/链接列生效（260px 合理显示宽度），
   操作列与开关/徽标等控件列绝不截断 */
#dataTable tbody td {
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    padding: 9px 12px;
    white-space: nowrap;
    word-break: normal;
}
#dataTable tbody td.cell-text {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}
#dataTable tbody td.cell-actions { max-width: none; overflow: visible; }
#dataTable tbody td:first-child { border-left: none; }
#dataTable tbody tr:hover td { background: var(--color-bg-1); }
#dataTable tbody tr:last-child td { border-bottom: none; }
/* 小计/合计行（采购订单跟踪表：服务端插入分组小计与总计行） */
#dataTable tbody tr.subtotal-row td { background: var(--color-bg-2); font-weight: 600; }
#dataTable tbody td.cell-strong { font-weight: 700; }
/* 汇总行内金额仍保持纯黑不加粗 */
#dataTable tbody tr.subtotal-row td.cell-num,
#dataTable tbody tr.subtotal-row td.num,
#dataTable tr.total-row td.cell-num,
#dataTable tr.total-row td.num { font-weight: 400; color: #000; }
/* 可排序列头（旧 layui 表头点击排序同款） */
#dataTable thead th.th-sortable { cursor: pointer; user-select: none; }
#dataTable thead th.th-sortable:hover { color: var(--color-primary); }
#dataTable thead th .sort-ind { margin-left: 4px; font-size: 11px; color: var(--color-primary); }

/* 详情页键值表 */
table.kv-table { margin-top: 12px; table-layout: fixed; }
table.kv-table th {
    width: 130px;
    background: transparent;
    color: var(--color-text-3);
    font-weight: 500;
    text-align: right;
}
table.kv-table td { background: #fff; word-break: break-all; }
table.kv-table tbody tr:hover td { background: #fff; }

/* 单据开单表：自适应容器宽度（弹窗内不横向滚动），超窄屏 880px 兜底；与列表页同款表格网格，紧凑显示全字段 */
table.order-form {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
    font-size: 13px;
}
table.order-form th {
    background: var(--color-bg-2);
    color: var(--color-text-2);
    padding: 7px 5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.35;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
}
table.order-form th:first-child { border-left: none; }
table.order-form td {
    padding: 5px 4px;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    vertical-align: top;
}
table.order-form td:first-child { border-left: none; }
table.order-form tbody tr:last-child td { border-bottom: none; }
table.order-form tbody tr:hover td { background: var(--color-bg-2); }
table.order-form td input,
table.order-form td select {
    border: none;
    border-radius: 2px;
    padding: 0 4px;
    font-size: 14px;
    height: 28px;
    line-height: 1.3;
    width: 100%;
    min-width: 36px;
    background: transparent;
}
table.order-form td input:hover,
table.order-form td select:hover { background: var(--color-primary-light); }
table.order-form td input:focus,
table.order-form td select:focus {
    border: none;
    outline: none;
    box-shadow: 0 0 0 1.5px var(--color-primary);
    background: #fff;
}
table.order-form td input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
/* 旧系统同款：保留原生上下微调按钮（旧 bootstrap height:auto 恢复默认 spinner，无任何隐藏规则） */
table.order-form td input[readonly] { background: transparent; color: var(--color-text-3); }
table.order-form td input.goodsName { min-width: 160px; }
table.order-form td input.goodsNote { min-width: 64px; }
table.order-form td input.remark { min-width: 60px; }
table.order-form td input.purchaseOrderId { min-width: 88px; }
table.order-form td select.goodsUnit { min-width: 54px; }
/* 旧系统同款：明细行操作列（加/删行按钮组） */
table.order-form th.col-op, table.order-form td.col-op { width: 92px; min-width: 92px; }
table.order-form td.col-op .btn-mini { margin: 0 2px; }
table.order-form td select.storesId { min-width: 66px; }
table.order-form td input.allowStock { min-width: 48px; }
table.order-form td input.batchSec { min-width: 76px; padding-right: 36px; }
table.order-form td input.defaultUnit { min-width: 48px; }
table.order-form td input.basicNmber { min-width: 44px; }
table.order-form td input.taxRate { min-width: 44px; }
/* 金额等关键列：保证完整显示（千分位+小数不截断），同时压缩非关键列宽度；金额纯黑不加粗 */
table.order-form td input.number { min-width: 48px; color: #000; font-weight: 400; }
table.order-form td input.unitPrice,
table.order-form td input.taxIncluded,
table.order-form td input.allMoney,
table.order-form td input.taxMoney,
table.order-form td input.moneyTaxPrice { min-width: 76px; color: #000; font-weight: 400; }
table.order-form td .btn-mini { margin: 0; padding: 0 8px; height: 24px; }
table.order-form td:last-child { white-space: nowrap; }
table.order-form td .picker { position: relative; min-width: 0; }
table.order-form td .picker > input { width: 100%; }

/* 采购单列显隐（旧 kuyou.css purchase-form-slim 同款 nth-child）：
   商品备注/生产日期/保质期/有效期至/折扣/折扣额 隐藏 */
#itemsTable.purchase-form-slim tr > *:nth-child(3),
#itemsTable.purchase-form-slim tr > *:nth-child(9),
#itemsTable.purchase-form-slim tr > *:nth-child(10),
#itemsTable.purchase-form-slim tr > *:nth-child(11),
#itemsTable.purchase-form-slim tr > *:nth-child(17),
#itemsTable.purchase-form-slim tr > *:nth-child(18) { display: none !important; }
/* 请购单列显隐（Q2 对齐客户 kuyou.css:781 #goods_table.purchase-order-form-slim 同款：第 3 列商品备注隐藏） */
#itemsTable.purchase-order-form-slim tr > *:nth-child(3) { display: none !important; }

/* 操作列（旧首列 +/垃圾桶图标，浅色底符号按钮） */
table.order-form td.op-cell { white-space: nowrap; text-align: center; }
table.order-form td.op-cell .btn-mini { margin: 0 2px 0 0; width: 26px; padding: 0; border-radius: 2px; }
table.order-form td.op-cell .btn-add {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: none;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}
table.order-form td.op-cell .btn-add:hover { background: #D3E5FF; }
table.order-form td.op-cell .btn-del { background: #FDECEC; color: var(--color-danger); border: none; }
table.order-form td.op-cell .btn-del:hover { background: #FFD6D3; }

/* 批次列：批次号输入 + 右侧批次选择按钮（旧 batch_div 绝对定位按钮模式） */
table.order-form td.batch-cell { position: relative; }
table.order-form td.batch-cell input.batchSec { width: 100%; padding-right: 40px; }
table.order-form td.batch-cell .btn-mini { position: absolute; right: 6px; top: 7px; height: 24px; }

/* 表头商品列内扫码枪开关（旧 smq_switch） */
.smq-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-weight: 400;
    font-size: 13px;
    color: var(--color-text-3);
    white-space: nowrap;
}
/* 扫码枪开启：隐藏行内商品库按钮（旧 c-switch=1 时隐藏 goods_code_span） */
table.order-form.scan-on td.goods-cell .btn-mini { display: none; }

/* 商品单元格：搜索框全宽 + 右侧"选择"按钮（旧 goods_code_span 绝对定位模式），下拉层悬浮不撑宽 */
table.order-form td.goods-cell { position: relative; }
table.order-form td.goods-cell .picker { margin-right: 40px; }
table.order-form td.goods-cell .picker > input { width: 100%; }
table.order-form td.goods-cell > .btn-mini { position: absolute; right: 6px; top: 7px; height: 24px; }
/* 商品列左侧竖线移除（旧系统商品输入框前无竖线，紧邻操作列的竖线网格显突兀） */
table.order-form th:nth-child(2),
table.order-form td.goods-cell { border-left: none; }

/* ---------------- 选择器下拉 ---------------- */
.picker { position: relative; min-width: 0; }
.picker > input { width: 100%; }
.picker-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    max-height: 260px;
    overflow: auto;
    z-index: 50;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}
.picker-item { padding: 10px 14px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--color-border); color: var(--color-text-2); }
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover { background: var(--color-primary-light); color: var(--color-primary); }
/* 空下拉层隐藏：未打开时 0 高度+边框会渲染成字段下方横线，且溢出表格容器造成多余竖向滚动条 */
.picker-list:empty { display: none; }
/* 商品搜索下拉：旧 chose_goods_box 同款 7 列表格弹层（灰表头/黄 hover/名称规格列左对齐） */
.picker-list.chose-goods-list {
    position: fixed;
    z-index: 120;
    min-width: 0;
    max-height: 360px;
    max-width: calc(100vw - 40px);
    overflow: auto;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    border: none;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
}
.picker-list.chose-goods-list table { width: max-content; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.picker-list.chose-goods-list th {
    background: #d3d3d3;
    border: solid 1px #e2e2e2;
    text-align: center;
    padding: 3px 5px;
    white-space: nowrap;
}
.picker-list.chose-goods-list td { text-align: center; padding: 3px 5px; white-space: nowrap; }
.picker-list.chose-goods-list tr:hover { background: rgba(255, 195, 10, .32); }
.picker-list.chose-goods-list th:nth-child(2),
.picker-list.chose-goods-list td:nth-child(2) { min-width: 180px; text-align: left; }
.picker-list.chose-goods-list th:nth-child(3),
.picker-list.chose-goods-list td:nth-child(3) { min-width: 240px; text-align: left; }

/* 供应商下拉：右侧箭头指示可展开（旧 xm-select 视觉） */
.picker-with-arrow > input { padding-right: 28px; }
.picker-with-arrow::after {
    content: '';
    position: absolute;
    right: 11px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 1.5px solid var(--color-text-3);
    border-bottom: 1.5px solid var(--color-text-3);
    transform: rotate(45deg);
    pointer-events: none;
}
.picker-with-arrow:has(> input[readonly])::after { opacity: .35; }

/* ---------------- 弹窗（Arco Modal） ---------------- */
.mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}
.dialog {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    width: 520px;
    max-width: 94vw;
    max-height: 88vh;
    overflow: auto;
    box-shadow: var(--shadow-hover);
}
.dialog h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--color-text-1); }
.dialog form { display: flex; flex-direction: column; gap: 12px; }
.dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.dialog label span { color: var(--color-text-2); }
.dialog input, .dialog select { width: 100%; }
/* 批次选择弹层（旧 batch_span layer 780px） */
.dialog.batch-pick { width: 780px; }
.dialog.batch-pick table td, .dialog.batch-pick table th { white-space: nowrap; }
/* 序列号/批次选择表（旧 chose_serial_table / serial_table） */
.dialog .serial-pick { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.dialog .serial-pick th, .dialog .serial-pick td {
    border: 1px solid var(--color-border);
    padding: 6px 8px;
    text-align: left;
    font-size: 13px;
}
.dialog .serial-pick th { background: var(--color-bg-2); font-weight: 600; }
.dialog .serial-pick input[type="checkbox"], .dialog .serial-pick input[type="radio"] { width: auto; }
.dialog .serial-pick input[type="text"] { width: 100%; }
/* 序列号录入页签（旧 layui-tab 标题条） */
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 12px; }
.tab-item { padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--color-text-2); border-bottom: 2px solid transparent; }
.tab-item.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
/* 批量录入序列号面板（旧 more_period row） */
.serial-auto-panel { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.serial-auto-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--color-text-2); }
.serial-auto-panel input { width: 130px; }
/* 商品库弹窗（多选 + 分页） */
.dialog.goods-lib { width: 900px; max-width: 96vw; }
.dialog.goods-lib table td, .dialog.goods-lib table th { white-space: nowrap; }
.dialog.goods-lib table { margin-top: 6px; }

/* ---------------- 整页弹窗（列表页 iframe 编辑/详情；iframe 内为无侧栏顶栏的 blank 布局） ---------------- */
.page-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.page-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}
/* 编辑/详情弹窗收紧宽度：笔记本 1366 下不再铺满整屏，内容紧凑不空荡 */
.page-modal-dialog {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: min(1280px, 96vw);
    height: min(780px, 92vh);
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}
.page-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    background: #fff;
    flex: none;
    cursor: move;
    user-select: none;
}
.page-modal-head span { font-size: 15px; font-weight: 600; color: var(--color-text-1); }
.page-modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-3);
    font-size: 22px;
    line-height: 1;
}
.page-modal-close:hover { background: var(--color-bg-2); color: var(--color-text-1); }
.page-modal-dialog iframe { flex: 1; width: 100%; border: none; background: #fff; }
/* 右下角拉伸手柄 */
.page-modal-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 5;
}
.page-modal-resize::after {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-text-4);
    border-bottom: 2px solid var(--color-text-4);
}

/* 弹窗内嵌页（blank 布局）：白底、无卡片外框阴影，顶部紧凑（标准 8px 间距）直接展示编辑区域 */
body.blank-body { background: #fff; }
body.blank-body .card { border: none; box-shadow: none; padding: 4px 12px 10px; }
body.blank-body .card .page-actions { margin-bottom: 6px; }

/* ---------------- 提示 / 状态 ---------------- */
.error {
    color: var(--color-danger);
    margin: 10px 0;
    font-size: 14px;
    background: #FFECE8;
    border: 1px solid #FFCFC5;
    border-radius: 6px;
    padding: 10px 14px;
}
.empty-tip { padding: 32px 0; text-align: center; color: var(--color-text-3); }

/* ---------------- 登录页 ---------------- */
.login-box {
    max-width: 380px;
    width: 100%;
    padding: 40px 36px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 16px rgba(0, 0, 0, .1);
}
.login-box h1 { font-size: 20px; font-weight: 600; margin-bottom: 6px; color: var(--color-text-1); text-align: center; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box input { width: 100%; }
.login-box button { width: 100%; height: 40px; font-size: 15px; }
.login-box .captcha-row { display: flex; gap: 10px; align-items: center; }
.login-box .captcha-row input { flex: 1; width: auto; }
.login-box .captcha-img { border-radius: 2px; cursor: pointer; flex: none; }
.login-box .remember-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text-2); cursor: pointer; }
.login-box .remember-row input { width: auto; }

/* ---------------- 小标签（Arco Tag） ---------------- */
.tag { display: inline-block; padding: 2px 10px; border-radius: 2px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.tag-blue { background: var(--color-primary-light); color: var(--color-primary); }
.tag-orange { background: #FFF7E8; color: var(--color-warning); }

/* ---------------- 响应式 ---------------- */
/* 笔记本优先：≤1400px（1366×768、1920×1080@125%/150% 缩放等）侧栏收起为抽屉，
   内容区全宽，解决列表页左右过长显示不全；顶栏汉堡按钮展开导航 */
@media (max-width: 1400px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-mask { display: block; }
    .menu-toggle { display: inline-flex; }
    .main-content { margin-left: 0; }
    body.sidebar-collapsed .main-content { margin-left: 0; }
    /* 抽屉模式：中和折叠态覆盖，始终渲染完整导航 */
    body.sidebar-collapsed .sidebar { width: var(--sidebar-width); }
    body.sidebar-collapsed .nav-group-toggle { display: flex; }
    body.sidebar-collapsed .nav-tree { max-height: 0; padding-bottom: 0; }
    body.sidebar-collapsed .nav-tree a { justify-content: flex-start; padding: 0 10px 0 26px; height: 36px; font-size: 14px; }
    body.sidebar-collapsed .sidebar-collapse-btn { justify-content: flex-start; padding: 0 14px; }
    body.sidebar-collapsed .sidebar-collapse-btn .col-icon { margin-right: 6px; }
    body.sidebar-collapsed .sidebar-collapse-btn .col-label { display: inline; }
}
@media (max-width: 760px) {
    body { padding-top: var(--header-height); }
    .topbar { padding: 0 8px 0 12px; gap: 8px; }
    .topbar .brand { font-size: 14px; }
    .sidebar { top: var(--header-height); }
    .sidebar-mask { inset: var(--header-height) 0 0 0; }
    .main-content { padding: 12px 10px 24px; }
    .card { padding: 12px 10px; }
    .form-grid { grid-template-columns: 1fr; }
    .toolbar input[type="text"] { width: 100%; }
    .page-head h2 { font-size: 15px; }
}

/* ---------------- 报表宽表 ---------------- */
/* 与主表格同套 Arco 行式样式；table-layout:fixed 定宽不重排，超宽保留横向滚动 */
.report-table { table-layout: fixed; width: max-content; min-width: 100%; font-size: 12px; border-collapse: separate; border-spacing: 0; }
.report-table th, .report-table td {
    padding: 5px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid #F2F3F5;
}
.report-table th:last-child, .report-table td:last-child { border-right: none; }
.report-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--color-bg-2);
}
.report-table th { font-size: 12px; color: var(--color-text-2); font-weight: 600; }
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover td { background: var(--color-bg-2); }
.report-table .num, .report-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 400; color: #000; }
.report-table .subtotal-row td.num,
.report-table .total-row td.num,
.report-table .subtotal-row td.cell-num,
.report-table .total-row td.cell-num { font-weight: 400; color: #000; }
.report-table .subtotal-row td { background: var(--color-bg-2); font-weight: 600; }
.report-table .opening-row td { background: #FFF7E8; }
.report-table .total-row td { background: #E8FFEA; font-weight: 700; }
/* 列表页合计行（旧 layui totalRow：采购明细表等服务端 count 驱动） */
#dataTable tr.total-row td { background: #E8FFEA; font-weight: 700; border-top: 1px solid var(--color-border); }

/* ---------------- 内联筛选/操作表单行（kv-form） ---------------- */
.kv-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.kv-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 160px; }
.kv-form label span { color: var(--color-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv-form input, .kv-form select { width: 100%; min-width: 150px; }

/* ---------------- 列表搜索表单（对齐旧系统 layui-search） ---------------- */
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--color-bg-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.search-item { display: flex; align-items: center; gap: 6px; }
.search-item label { font-size: 12px; color: var(--color-text-2); white-space: nowrap; }
.search-item input[type="text"], .search-item select { width: 130px; }
.range-box { display: flex; align-items: center; gap: 4px; }
.range-box input[type="date"] { width: 130px; }
.range-sep { color: var(--color-text-3); font-size: 12px; }
.search-actions { margin-left: auto; }

/* ---------------- 多选列 ---------------- */
.col-check { width: 32px; text-align: center; }
.col-check input { vertical-align: middle; }

/* ---------------- 状态徽标 ---------------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.badge-blue { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.badge-red { background: #FDECEC; color: var(--color-danger); font-weight: 600; }
.badge-green { background: #E8F8EE; color: #00B42A; font-weight: 600; }
.badge-orange { background: #FFF3E8; color: #FF7D00; font-weight: 600; }
.badge-gray { background: #F2F3F5; color: #86909C; font-weight: 600; }

@media (max-width: 768px) {
    .search-item input[type="text"], .search-item select { width: 100%; }
    .search-item { flex: 1 1 100%; }
    .range-box input[type="date"] { flex: 1; width: auto; }
}

/* ---------------- 已审核印章（经典圆形红章，置于页头按钮区，不遮挡表单数据） ---------------- */
.audit-seal {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border: 2.5px solid #E03535;
    border-radius: 50%;
    color: #E03535;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 3px;
    text-indent: 3px;
    line-height: 1;
    transform: rotate(-14deg);
    flex: none;
    position: relative;
    background: rgba(224, 53, 53, .03);
    user-select: none;
}
.audit-seal::before {
    content: '★';
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0;
    text-indent: 0;
    color: #E03535;
}
.audit-seal::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid #E03535;
    border-radius: 50%;
    opacity: .7;
}
.audit-seal .seal-text { margin-top: 9px; }
/* 编辑页：已审核印章覆盖于明细表格右下方（旧 #mark.has-audit：right 40px / bottom 30px），不拦截鼠标；
   右下角为锚点放大 1.3 倍（约 100px），向左上扩展，不偏移锚定位置 */
.audit-seal-overlay {
    position: absolute;
    right: 40px;
    bottom: 30px;
    z-index: 100;
    pointer-events: none;
    transform: rotate(-14deg) scale(1.3);
    transform-origin: right bottom;
}

/* ---------------- 已审核图章（旧 kuyou.css:89-97 .has-audit 同款：audit.png 150×74，置于 .table_box 内右下角） ---------------- */
.has-audit {
    width: 150px;
    height: 74px;
    background: url(/assets/addons/kuyou/img/audit.png) 0 0 no-repeat;
    position: absolute;
    right: 40px;
    bottom: 30px;
    z-index: 100;
}

/* ---------------- 已审核「禁用保留」锁定表：操作列隐藏（旧 {$exclass}=hiddens 隐藏 th/td 同款） ---------------- */
.form-locked .col-op { display: none !important; }

/* ---------------- 单据头部字段栅格（老系统 form-horizontal：4 字段一行各 25%，标签在左带冒号；附单据第二行） ---------------- */
.order-head {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 12px;
    margin-bottom: 6px;
}
.order-head label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    min-width: 0;
}
.order-head label > span {
    flex: none;
    width: 72px;
    text-align: right;
    color: var(--color-text-2);
    white-space: nowrap;
}
.order-head label input,
.order-head label select,
.order-head label .picker { flex: 1; min-width: 0; }
/* 附单据格：老系统第二行第一格整行文本样式（无字段标签头） */
.order-head label.enclosure-field { grid-column: 1; justify-content: flex-start; }
.order-head label.enclosure-field > span { display: none; }
@media (max-width: 1100px) {
    .order-head { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}
@media (max-width: 640px) {
    .order-head { grid-template-columns: 1fr; }
}

/* Q4：单据类型 radio 组（旧 Bootstrap .radio add.html:43-47 同款；外框为普通容器，避免 label 嵌套误触） */
.order-head .radio-field { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; min-width: 0; }
.order-head .radio-field > .radio-label { flex: none; width: 72px; text-align: right; color: var(--color-text-2); white-space: nowrap; }
.order-head .radio-group { display: flex; gap: 14px; align-items: center; }
.order-head .radio-group label { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; cursor: pointer; }

/* 备注（旧系统表格下方全宽 textarea，左右对齐表单） */
.note-field { display: block; margin-top: 8px; }
.note-field > span { display: block; color: var(--color-text-2); margin-bottom: 6px; }
.note-field textarea { width: 100%; resize: vertical; }

/* 单据页脚（老系统 purchase-form-footer：25% 窄列，标签在左带冒号水平排布） */
.order-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 25%;
    min-width: 180px;
    max-width: 320px;
}
.order-foot label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    min-width: 0;
}
.order-foot label > span {
    flex: none;
    width: 72px;
    text-align: right;
    color: var(--color-text-2);
    white-space: nowrap;
}
.order-foot label input,
.order-foot label select { flex: 1; min-width: 0; }
@media (max-width: 640px) {
    .order-foot { width: 100%; max-width: none; }
}

/* ---------------- 列表单元格链接（单据编号直达） ---------------- */
.cell-link { color: var(--color-primary); text-decoration: none; }
.cell-link:hover { text-decoration: underline; }

/* ---------------- 商品库表单（旧 kuyou/goods add/edit 对齐） ---------------- */
.goods-form { display: flex; flex-direction: column; gap: 14px; }
.goods-form .help { color: var(--color-text-3); font-style: normal; font-size: 12px; }
.check-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 4px 0; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--color-text-1); cursor: pointer; white-space: nowrap; }
.checkbox-label input { margin: 0; }
.mini-input { width: 90px; height: 30px; display: inline-block; margin: 0 4px; }
.input-group { display: flex; align-items: center; gap: 8px; width: 100%; }
.input-group input[type="text"] { flex: 1; min-width: 0; }
.input-group .upload-file { width: 90px; font-size: 12px; }
.input-group .upload-btn { flex: none; }

/* 表单内嵌表格（多单位价格/分仓预警/期初分录/属性组合） */
.goods-form .list { overflow-x: auto; }
.goods-form .list table { min-width: 860px; }
.goods-form .list th, .goods-form .list td { padding: 6px 8px; }
.goods-form .list td input, .goods-form .list td select { height: 30px; min-width: 64px; padding: 0 6px; font-size: 13px; }
.goods-form .list td input[type="number"] { width: 90px; }
.goods-form .list td input[type="date"] { width: 130px; }
.goods-form .list td input[type="text"] { width: 110px; }
.goods-form .list td select { min-width: 96px; }
.goods-form .list .btn-mini { margin: 0 2px 0 0; width: 24px; padding: 0; }
.mu-tag { white-space: nowrap; color: var(--color-text-3); font-size: 12px; }
.mu-name { white-space: nowrap; font-size: 13px; }
.aux-box { margin: 4px 0; }
.aux-title, .aux-title-inline { font-size: 14px; color: var(--color-text-2); margin-right: 10px; }
.aux-checks, .aux-children, .aux-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 0; }
.aux-toolbar { margin-top: 4px; }
.auxiliary_form { margin-top: 6px; }
#auxiliary_table { min-width: 980px; }
#auxiliary_table td input { width: 90px; }
#stock_table td input[type="number"] { width: 96px; }

/* 列表页状态开关（旧 lay-skin switch 上架|下架 → CSS 拨杆，开启绿/关闭灰） */
.switch-cell { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.switch-cell input {
    appearance: none; -webkit-appearance: none;
    width: 38px; height: 20px; margin: 0; flex: none;
    border-radius: 999px; background: #C9CDD4; position: relative;
    cursor: pointer; transition: background .18s ease; outline: none; border: 0;
}
.switch-cell input::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: left .18s ease;
}
.switch-cell input:checked { background: var(--color-success); }
.switch-cell input:checked::after { left: 20px; }
.switch-cell input:disabled { opacity: .55; cursor: not-allowed; }
.switch-text { font-size: 13px; color: var(--color-text-2); }

/* 列表单元格进度条（value/total → 百分比；满额绿色） */
.cell-progress { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin-left: 6px; }
.cell-progress-track { width: 64px; height: 8px; background: #E5E6EB; border-radius: 999px; overflow: hidden; flex: none; }
.cell-progress-fill { height: 100%; background: var(--color-primary); border-radius: 999px; transition: width .2s ease; }
.cell-progress-fill.cell-progress-done { background: var(--color-success); }
.cell-progress-text { font-size: 12px; color: var(--color-text-2); line-height: 1; }


/* 列表页商品主图 */
#dataTable .cell-img { border-radius: 2px; background: var(--color-bg-2); border: 1px solid var(--color-border); }

/* ---------------- 轻提示（kuyou_port.js 原生实现，替换 layui layer.msg） ---------------- */
.kp-toast-box {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.kp-toast {
    max-width: 80vw;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-success);
    box-shadow: var(--shadow-hover);
    color: var(--color-text-1);
    font-size: 13px;
    line-height: 1.7;
    transition: opacity .2s ease;
}
.kp-toast.kp-toast-error { border-left-color: var(--color-danger); }
.kp-toast.kp-toast-out { opacity: 0; }

/* ---------------- 信息提示条（浅蓝） ---------------- */
.tip-info {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid #B8D4FF;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    line-height: 1.9;
    margin-bottom: 14px;
    font-size: 13px;
}

/* 表单字段说明文字 */
.form-label .help { color: var(--color-text-3); font-style: normal; font-size: 12px; line-height: 1.6; }

/* 明细页键值信息条（浅灰底一行展示单据关键信息） */
.info-strip {
    background: var(--color-bg-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
    color: var(--color-text-2);
    font-size: 13px;
}
.info-strip strong { color: var(--color-text-1); font-weight: 600; }

/* 卡片内小节标题 */
.section-title { margin: 18px 0 8px; font-size: 14px; font-weight: 600; color: var(--color-text-1); }

/* ---------------- 角色权限树（auth/group_edit） ---------------- */
.perm-tree {
    max-height: calc(100vh - 380px);
    min-height: 240px;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: #fff;
}
.perm-tree ul { list-style: none; margin: 0; padding-left: 18px; }
.perm-tree > ul { padding-left: 0; }
.perm-row { display: flex; align-items: center; line-height: 24px; white-space: nowrap; padding: 0 4px; border-radius: 2px; }
.perm-row:hover { background: var(--color-bg-2); }
.perm-arrow { display: inline-block; width: 16px; text-align: center; cursor: pointer; color: var(--color-text-3); user-select: none; font-size: 11px; }
.perm-arrow:hover { color: var(--color-primary); }
.perm-arrow-empty, .perm-arrow-empty:hover { cursor: default; color: var(--color-text-4); }
.perm-check { margin: 0 6px 0 0; }
.perm-title { font-weight: normal; color: var(--color-text-1); }
.perm-tree .empty-tip { padding: 18px 0; }

/* ---------------- 工序子件明细表（bom/procedure_add|edit 共用，基于 order-form 扩展列宽） ---------------- */
#purchase_table th:nth-child(2), #purchase_table td:nth-child(2) { width: 58px; text-align: center; }
#purchase_table th:nth-child(3), #purchase_table td:nth-child(3) { min-width: 240px; }
#purchase_table td .goods_code_box { display: flex; align-items: center; gap: 2px; }
#purchase_table td .goods_code_box .goods_code_span { flex: none; cursor: pointer; padding: 0 2px; }
#purchase_table td .goods_code_box .goods_code_span img { width: 14px; height: 14px; vertical-align: middle; display: block; }
#purchase_table td .goods_code_box .goods_name { min-width: 150px; }
#purchase_table .btn-switcher { color: var(--color-text-4); font-size: 18px; line-height: 1; }
#purchase_table .btn-switcher.on { color: var(--color-success); }
.procedure-detail-scroll { max-height: calc(100vh - 300px); min-height: 180px; overflow: auto; }
.col-resize-handle { position: absolute; right: -3px; top: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 20; }
body.col-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.col-resizing * { cursor: col-resize !important; }

/* ---------------- 下拉选择控件（旧 xm-select 等效，见 assets/xm_picker.js；筛选栏可搜索/多选/分页） ---------------- */
.xmp { position: relative; display: inline-block; vertical-align: middle; }
.xmp-box {
    display: flex; align-items: center; gap: 4px;
    min-width: 130px; min-height: 30px; padding: 2px 22px 2px 6px;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: #fff; cursor: pointer; position: relative;
}
.xmp-box:hover { border-color: var(--color-border-strong); }
.xmp-open .xmp-box { border-color: var(--color-primary); }
.xmp-arrow {
    position: absolute; right: 7px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
    border-right: 1.5px solid var(--color-text-3); border-bottom: 1.5px solid var(--color-text-3);
    transform: rotate(45deg); transition: transform .15s;
}
.xmp-open .xmp-arrow { transform: rotate(225deg); margin-top: -2px; }
.xmp-tags { display: flex; flex-wrap: wrap; gap: 3px; max-width: 100%; overflow: hidden; }
.xmp-ph { color: var(--color-text-4); font-size: 13px; line-height: 22px; }
.xmp-tag {
    display: inline-flex; align-items: center; gap: 3px; max-width: 150px; padding: 0 4px;
    background: var(--color-primary-light); color: var(--color-primary);
    border-radius: 2px; font-size: 12px; line-height: 20px;
}
.xmp-tag-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xmp-tag i { cursor: pointer; font-style: normal; color: var(--color-primary); opacity: .7; }
.xmp-tag i:hover { opacity: 1; }
.xmp-panel {
    display: none; position: absolute; left: 0; top: calc(100% + 4px); z-index: 60;
    width: max(100%, 180px); background: #fff;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.xmp-open .xmp-panel { display: block; }
.xmp-search { padding: 6px; border-bottom: 1px solid var(--color-border); }
.xmp .xmp-search input[type="text"] {
    width: 100%; height: 26px; padding: 0 6px; font-size: 12px;
    border: 1px solid var(--color-border); border-radius: 2px;
}
.xmp-list { max-height: 200px; overflow: auto; padding: 2px 0; }
.xmp-item {
    display: flex; align-items: center; gap: 6px; padding: 4px 8px;
    font-size: 13px; color: var(--color-text-1); cursor: pointer; white-space: nowrap;
}
.xmp-item:hover { background: var(--color-bg-2); }
.xmp-item.selected { background: var(--color-primary-light); }
.xmp-mark { width: 12px; height: 12px; flex: 0 0 12px; border: 1px solid var(--color-border-strong); border-radius: 2px; position: relative; }
.xmp:not(.xmp-multi) .xmp-mark { border-radius: 50%; }
.xmp-item.selected .xmp-mark { border-color: var(--color-primary); background: var(--color-primary); }
.xmp-item.selected .xmp-mark::after {
    content: ''; position: absolute; left: 3px; top: 0; width: 4px; height: 7px;
    border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg);
}
.xmp:not(.xmp-multi) .xmp-item.selected .xmp-mark::after { left: 3px; top: 0; width: 3px; height: 6px; }
.xmp-name { overflow: hidden; text-overflow: ellipsis; }
.xmp-empty { display: none; padding: 8px; text-align: center; color: var(--color-text-3); font-size: 12px; }
.xmp-pager {
    display: none; align-items: center; justify-content: space-between; gap: 6px;
    padding: 4px 6px; border-top: 1px solid var(--color-border); font-size: 12px; color: var(--color-text-2);
}
.xmp-pager button {
    height: 22px; padding: 0 6px; font-size: 12px;
    background: #fff; border: 1px solid var(--color-border); border-radius: 2px; cursor: pointer;
}
.xmp-pager button:disabled { color: var(--color-text-4); cursor: default; }

/* 旧 laydate datetime 范围（看板搜索）：日期时间输入框（批次3，与旧 type:'datetime' 同款口径） */
.range-box input[type="datetime-local"] { width: 170px; }
@media (max-width: 768px) {
    .range-box input[type="datetime-local"] { flex: 1; width: auto; }
}

/* ============================================================
   数据面板（2026-09-14 UI 细节批：登录落地页，一眼看清经营数据）
   ============================================================ */
.dp-page { display: flex; flex-direction: column; gap: 12px; }
.dp-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dp-title { font-size: 18px; font-weight: 600; color: var(--color-text-1); }
.dp-subtitle { font-size: 12px; color: var(--color-text-3); margin-top: 2px; }
.dp-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.dp-quick .btn-plain { display: inline-flex; align-items: center; gap: 5px; }

.dp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dp-kpi {
    display: flex; gap: 12px; align-items: flex-start;
    background: #fff; border: 1px solid var(--color-border); border-radius: 8px; padding: 16px;
}
.dp-kpi .kpi-ico {
    width: 42px; height: 42px; border-radius: 8px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.kpi-blue .kpi-ico { background: #E8F3FF; color: #165DFF; }
.kpi-cyan .kpi-ico { background: #E8FFFB; color: #0FC6C2; }
.kpi-green .kpi-ico { background: #E8FFEA; color: #00B42A; }
.kpi-orange .kpi-ico { background: #FFF7E8; color: #FF7D00; }
.dp-kpi .kpi-main { min-width: 0; }
.kpi-label { font-size: 12px; color: var(--color-text-3); }
.kpi-num {
    font-size: 22px; font-weight: 600; line-height: 1.35; margin-top: 2px;
    color: var(--color-text-1); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-num-sm { font-size: 19px; }
.kpi-unit { font-size: 12px; font-weight: 400; color: var(--color-text-3); }
.kpi-foot { font-size: 12px; color: var(--color-text-3); margin-top: 2px; }

.dp-mid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.dp-panel { background: #fff; border: 1px solid var(--color-border); border-radius: 8px; padding: 14px 16px; }
.dp-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dp-panel-head h3 { font-size: 14px; font-weight: 600; color: var(--color-text-1); }
.dp-panel-extra { font-size: 12px; color: var(--color-text-3); }
.dp-more { font-size: 12px; color: var(--color-primary); white-space: nowrap; }
.dp-more i { font-size: 12px; }

.dp-progress { height: 10px; background: var(--color-bg-2); border-radius: 5px; overflow: hidden; margin: 4px 0 10px; }
.dp-progress-bar { height: 100%; min-width: 2px; background: var(--color-primary); border-radius: 5px; }
.dp-progress-meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12px; color: var(--color-text-3); }
.dp-progress-meta b { color: var(--color-text-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.dp-mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.dp-mini-stats > div {
    background: var(--color-bg-2); border-radius: 6px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 3px;
}
.mini-label { font-size: 12px; color: var(--color-text-3); }
.mini-value { font-size: 16px; font-weight: 600; color: var(--color-text-1); font-variant-numeric: tabular-nums; }

.dp-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dp-links a {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 6px;
    color: var(--color-text-1); background: #fff;
}
.dp-links a:hover { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); }
.dp-links a i { font-size: 15px; color: var(--color-primary); }
.dp-links a span { font-size: 13px; font-weight: 500; }
.dp-links a em { font-style: normal; font-size: 11px; color: var(--color-text-3); }

.dp-seg { display: inline-flex; background: var(--color-bg-2); border-radius: 6px; padding: 2px; }
.dp-seg a { padding: 5px 14px; font-size: 13px; color: var(--color-text-2); border-radius: 4px; }
.dp-seg a.active { background: #fff; color: var(--color-primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.dp-chart { width: 100%; height: 340px; }

.dp-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dp-table th {
    text-align: left; font-weight: 500; color: var(--color-text-3); font-size: 12px;
    padding: 8px 8px; border-bottom: 1px solid var(--color-border); background: var(--color-bg-2);
}
.dp-table th:first-child { border-radius: 4px 0 0 4px; }
.dp-table th:last-child { border-radius: 0 4px 4px 0; }
.dp-table td { padding: 9px 8px; border-bottom: 1px solid #F2F3F5; color: var(--color-text-2); }
.dp-table tr:last-child td { border-bottom: none; }
.dp-table tr:hover td { background: #FAFBFC; }
.dp-table .ta-r { text-align: right; }
.dp-code { font-variant-numeric: tabular-nums; color: var(--color-text-1); }
.dp-date { color: var(--color-text-3); }
.dp-money { font-weight: 600; color: var(--color-text-1); font-variant-numeric: tabular-nums; }
.dp-empty { text-align: center; color: var(--color-text-3); padding: 18px 0; }
.dp-tag { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 8px; border-radius: 9px; }
.dp-tag.ok { background: #E8FFEA; color: #00B42A; }
.dp-tag.wait { background: #FFF7E8; color: #FF7D00; }

.dp-footer-stats {
    display: flex; gap: 26px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--color-border); border-radius: 8px;
    padding: 12px 16px; font-size: 13px; color: var(--color-text-3);
}
.dp-footer-stats i { color: var(--color-text-4); margin-right: 4px; }
.dp-footer-stats b { color: var(--color-text-1); font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 1280px) {
    .dp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dp-mid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .dp-kpis { grid-template-columns: 1fr; }
    .dp-lists { grid-template-columns: 1fr; }
    .dp-chart { height: 280px; }
}

/* ============================================================
   统计行强化（2026-09-14 UI 细节批：报表/明细金额统计更醒目、更正规）
   合计=主色底+主色顶边+主色金额；小计=浅蓝底+虚线分隔；金额均等宽数字
   ============================================================ */
#dataTable tr.total-row td,
.report-table tr.total-row td,
.report-table .total-row td {
    background: var(--color-primary-light);
    border-top: 2px solid var(--color-primary);
    font-weight: 700;
    color: var(--color-text-1);
}
#dataTable tr.total-row td:first-child,
.report-table tr.total-row td:first-child { box-shadow: inset 3px 0 0 var(--color-primary); }
#dataTable tr.total-row td.cell-num,
#dataTable tr.total-row td.num,
#dataTable tr.total-row td.cell-money,
.report-table tr.total-row td.cell-num,
.report-table tr.total-row td.num,
.report-table .total-row td.cell-num,
.report-table .total-row td.num {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: .2px;
    font-variant-numeric: tabular-nums;
}
#dataTable tbody tr.subtotal-row td,
.report-table tr.subtotal-row td,
.report-table .subtotal-row td {
    background: #F2F6FF;
    border-top: 1px dashed var(--color-border-strong);
    font-weight: 600;
}
#dataTable tbody tr.subtotal-row td.cell-num,
#dataTable tbody tr.subtotal-row td.num,
.report-table tr.subtotal-row td.cell-num,
.report-table tr.subtotal-row td.num,
.report-table .subtotal-row td.cell-num,
.report-table .subtotal-row td.num {
    color: var(--color-text-1);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
/* 报表首行“期初/结存”类强调行保留 */
.report-table .opening-row td { background: #FFF7E8; }

/* ============================================================
   角色权限页（2026-09-14 UI 细节批：左信息右权限树，结构清晰）
   ============================================================ */
.gp-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.gp-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--header-height) + 12px); }
.gp-side-block { border: 1px solid var(--color-border); border-radius: 8px; padding: 14px; background: #fff; }
.gp-side-title { font-size: 13px; font-weight: 600; color: var(--color-text-1); margin-bottom: 12px; }
.gp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.gp-field:last-child { margin-bottom: 0; }
.gp-field label { font-size: 12px; color: var(--color-text-2); }
.gp-field .req { color: var(--color-danger); margin-right: 2px; }
.gp-count-box { display: flex; align-items: baseline; gap: 8px; background: var(--color-primary-light); border-radius: 6px; padding: 12px 14px; }
.gp-count-num { font-size: 26px; font-weight: 700; color: var(--color-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.gp-count-label { font-size: 12px; color: var(--color-text-2); }
.gp-hint { font-size: 12px; color: var(--color-text-3); margin-top: 10px; line-height: 1.7; }
.gp-save-bar { display: flex; gap: 10px; }
.gp-save-btn {
    height: 32px; padding: 0 28px; font-size: 13px;
    background: var(--color-primary); color: #fff; border: 1px solid var(--color-primary); border-radius: 4px; cursor: pointer;
}
.gp-save-btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

.gp-main { border: 1px solid var(--color-border); border-radius: 8px; background: #fff; padding: 14px 16px; min-height: 460px; }
.gp-main-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gp-main-head h3 { font-size: 14px; font-weight: 600; color: var(--color-text-1); }
.gp-main-sub { font-size: 12px; color: var(--color-text-3); margin-top: 3px; }
.gp-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gp-search { width: 200px; height: 30px; padding: 0 10px; border: 1px solid var(--color-border); border-radius: 4px; font-size: 13px; }
.gp-search:focus { border-color: var(--color-primary); outline: none; }
.gp-super-tip { margin: 0 0 10px; }

/* 权限树：层级引导线 + 勾选高亮 + 一级分组加粗 */
.gp-tree { max-height: calc(100vh - 300px); overflow: auto; border: 1px solid var(--color-bg-2); border-radius: 6px; padding: 10px 12px; }
.gp-tree .perm-children { margin-left: 8px; border-left: 1px dashed #E5E6EB; padding-left: 8px; }
.gp-tree .perm-row { line-height: 26px; padding: 0 6px; border-radius: 4px; }
.gp-tree > ul > li > .perm-row .perm-title { font-weight: 600; color: var(--color-text-1); }
.gp-tree .perm-row:has(> .perm-check:checked) { background: var(--color-primary-light); }
.gp-tree .perm-check:checked + .perm-title { color: var(--color-primary); }
.gp-tree .perm-title { font-size: 13px; }
.gp-tree .perm-check { cursor: pointer; }
.gp-tree .perm-arrow:hover { color: var(--color-primary); }

@media (max-width: 1100px) {
    .gp-layout { grid-template-columns: 1fr; }
    .gp-side { position: static; }
    .gp-tree { max-height: none; }
}

/* ============================================================
   内页编辑体验细节（2026-09-14 UI 细节批）
   - 开单页操作按钮吸底常驻（长单不必滚到底保存）
   - 明细行聚焦高亮当前行
   - 单据页脚合计区轻底面板，金额更聚焦
   ============================================================ */
.card.order-edit .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: 12px 0 6px;
    margin-top: 16px;
}
table.order-form tbody tr:focus-within td { background: #F2F6FF; }
table.order-form tbody tr:focus-within td input,
table.order-form tbody tr:focus-within td select { background: #fff; }

.order-foot {
    background: var(--color-bg-2);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 10px 14px;
}
.order-foot label { font-size: 13px; }
.order-foot label > span { width: 84px; }

/* 数据面板图表空态提示 */
.dp-panel { position: relative; }
.dp-chart-empty {
    position: absolute; left: 0; right: 0; top: 52%;
    text-align: center; color: var(--color-text-3); font-size: 13px;
    pointer-events: none;
}

/* 开单页明细区：容器限高与页面动作条联动，避免整页滚动导致吸顶表头失效 */
.card.order-edit .table-scroll { max-height: calc(100vh - 330px); }
@media (max-height: 700px) {
    .card.order-edit .table-scroll { max-height: calc(100vh - 290px); }
}
.dp-chart-box { position: relative; }
