/* ============================================================
 * 计费检测过程质量控制系统 - Web 管理端全局样式
 * 低饱和暖色调企业后台风（无任何框架/CDN 依赖，内网离线可用）
 * 底色 #F7F4EE / 卡片白 / 主色朱砂 #B4552D / 文字 #2A2520 / 边框 #E7E1D6
 * ============================================================ */

:root {
  --bg: #F7F4EE;
  --card: #FFFFFF;
  --primary: #B4552D;
  --primary-dark: #9A4623;
  --primary-light: #F4E4DA;
  --text: #2A2520;
  --text-sub: #7A7166;
  --border: #E7E1D6;
  --sidebar: #2B2723;
  --sidebar-active: #3A342E;
  --amber: #A87C2A;
  --amber-bg: #F6EBD3;
  --slate: #5F7384;
  --slate-bg: #E4EAF0;
  --pine: #4F6B5C;
  --pine-bg: #E2EBE4;
  --brick: #A9483A;
  --brick-bg: #F4DFDA;
  --gray: #8A8378;
  --gray-bg: #EDE9E0;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(42, 37, 32, .07);
}

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

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

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

/* ---------- 布局：侧边栏 + 顶栏 + 内容区 ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: #D8D1C6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 22px 18px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #F4EFE7;
  line-height: 1.5;
  border-bottom: 1px solid #3A342E;
}
.sidebar .brand small { display: block; font-size: 11px; font-weight: 400; color: #9A9184; margin-top: 4px; letter-spacing: 1px; }

.sidebar nav { flex: 1; padding: 12px 0; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: #BDB4A6;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: var(--sidebar-active); color: #F4EFE7; }
.sidebar nav a.active {
  background: var(--sidebar-active);
  color: #F4EFE7;
  border-left-color: var(--primary);
}
.sidebar nav a .ico { width: 18px; text-align: center; font-size: 15px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .sys-name { font-size: 15px; font-weight: 600; }

/* 顶栏消息铃铛：有未读时图标摇晃动画 + 红色角标 */
.topbar .msg-bell {
  position: relative; margin-left: auto;
  width: 38px; height: 38px; border: none; border-radius: 10px;
  background: transparent; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.topbar .msg-bell:hover { background: var(--primary-light, #f0f4ff); }
.topbar .msg-bell .bell-ico {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: #7A7166;
  transition: color .15s;
}
.topbar .msg-bell .bell-ico svg { width: 20px; height: 20px; display: block; }
.topbar .msg-bell:hover .bell-ico { color: #5A5248; }
.topbar .msg-bell.has-unread .bell-ico { color: #B4552D; }
.topbar .msg-bell .bell-badge {
  position: absolute; top: 2px; right: 0;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: #e5484d; color: #fff;
  font-size: 11px; line-height: 17px; text-align: center; font-weight: 600;
}
.topbar .msg-bell.has-unread .bell-ico {
  display: inline-block;
  animation: bell-shake 1.2s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes bell-shake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-12deg); }
  30% { transform: rotate(8deg); }
  40% { transform: rotate(-6deg); }
  50% { transform: rotate(0deg); }
}
.topbar .user-box { display: flex; align-items: center; gap: 12px; color: var(--text-sub); }
.topbar .user-box .uname { color: var(--text); font-weight: 600; }
.topbar .user-box .urole {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary);
}

.content { padding: 24px; flex: 1; }

.page-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.page-desc { color: var(--text-sub); font-size: 13px; margin-bottom: 18px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card .card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.stat-card .num { font-size: 30px; font-weight: 700; margin-top: 8px; }
.stat-card .lbl { color: var(--text-sub); font-size: 13px; }
.stat-card.c-slate .num { color: var(--slate); }
.stat-card.c-amber .num { color: var(--amber); }
.stat-card.c-brick .num { color: var(--brick); }
.stat-card.c-pine  .num { color: var(--pine); }

/* ---------- 筛选条 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }

/* ---------- 表单控件 ---------- */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], select, textarea {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #FFF;
  outline: none;
  transition: border-color .15s;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input:disabled, select:disabled, textarea:disabled { background: #F3F0E9; color: var(--text-sub); }

.form-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.form-row label { width: auto; min-width: 108px; flex-shrink: 0; padding-top: 8px; font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.form-row label .req { color: var(--brick); margin-left: 2px; }
.form-row .field { flex: 1; }
.form-row .field label { width: auto; padding-top: 0; color: var(--text); }
.form-row .field input, .form-row .field select, .form-row .field textarea { width: 100%; }
.form-row .hint { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
/* 勾选组（身份/权限点多选）：横向排列自动换行，勾选框不被 field 的 100% 宽度撑开 */
.chk-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.chk-row label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.chk-row input[type="checkbox"], .chk-row input[type="radio"] { width: auto; height: auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #FFF; color: var(--text);
  font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.btn-primary { background: var(--primary); border-color: var(--primary); color: #FFF; }
.btn.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn.btn-danger { color: var(--brick); border-color: var(--brick); }
.btn.btn-danger:hover { background: var(--brick); color: #FFF; }
.btn:disabled, .btn.disabled {
  background: #F3F0E9; border-color: var(--border); color: #B7AE9F;
  cursor: not-allowed; pointer-events: none;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
table.tbl th {
  background: #FBF9F4;
  color: var(--text-sub);
  font-weight: 600;
  white-space: nowrap;
}
table.tbl tbody tr:hover { background: #FBF8F2; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl .ops { display: flex; flex-wrap: wrap; gap: 6px; }
table.tbl tr.row-warn td { background: #FCF6E3; }
table.tbl tr.row-danger td { background: #FAECE8; }
table.tbl td.cell-warn { color: var(--amber); font-weight: 600; }
table.tbl td.cell-danger { color: var(--brick); font-weight: 600; }
table.tbl .column-header-content {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0;
}
table.tbl .column-header-label { flex: 1; min-width: 0; }
table.tbl .column-filter-trigger {
  position: relative; flex: 0 0 auto; width: 28px; height: 28px;
  margin: -4px -5px -4px 0; padding: 5px;
  border: 0; border-radius: 6px; background: transparent; color: #9A9184;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
table.tbl .column-filter-trigger svg { width: 17px; height: 17px; display: block; }
table.tbl .column-filter-trigger:hover { color: var(--primary); background: var(--primary-light); }
table.tbl .column-filter-trigger:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
table.tbl .column-filter-trigger.active { color: var(--primary); background: var(--primary-light); }
table.tbl .column-filter-trigger.active::after {
  content: ''; position: absolute; right: 3px; top: 3px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--primary); border: 1px solid #FBF9F4;
}
.column-filter-popover {
  position: fixed; z-index: 140; width: 280px; max-width: calc(100vw - 24px);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(42, 37, 32, .16);
  animation: column-filter-in .14s ease-out;
}
.column-filter-popover-head {
  min-height: 44px; padding: 10px 12px 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--text); font-size: 13px; font-weight: 600;
}
.column-filter-close {
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-sub); cursor: pointer; font-size: 20px; line-height: 1;
}
.column-filter-close:hover { color: var(--primary); background: var(--primary-light); }
.column-filter-close:focus-visible, .column-filter-action:focus-visible, .column-filter-done:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
.column-filter-popover-body { padding: 0 16px 16px; }
.column-filter-input {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--card);
  color: var(--text); font-size: 13px; font-weight: 400; box-sizing: border-box; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.column-filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.column-filter-popover-foot {
  display: flex; align-items: center; gap: 4px; padding: 10px 12px;
  border-top: 1px solid var(--border); background: #FBF9F4; border-radius: 0 0 10px 10px;
}
.column-filter-action {
  min-height: 30px; padding: 0 7px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-sub); cursor: pointer; font-size: 12px;
}
.column-filter-action:hover { color: var(--primary); background: var(--primary-light); }
.column-filter-action:disabled { color: #B7AE9F; cursor: not-allowed; background: transparent; }
.column-filter-done {
  min-height: 30px; margin-left: auto; padding: 0 13px; border: 1px solid var(--primary);
  border-radius: 5px; background: var(--primary); color: #FFF; cursor: pointer; font-size: 12px;
}
.column-filter-done:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
@keyframes column-filter-in {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 720px) {
  table.tbl .column-filter-trigger { width: 44px; height: 44px; margin: -8px -9px -8px 0; }
  .column-filter-action, .column-filter-done { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .column-filter-popover { animation: none; }
  table.tbl .column-filter-trigger, .column-filter-input { transition: none; }
}

.empty { padding: 40px 0; text-align: center; color: var(--text-sub); }

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-slate { background: var(--slate-bg); color: var(--slate); }
.tag-pine  { background: var(--pine-bg);  color: var(--pine); }
.tag-brick { background: var(--brick-bg); color: var(--brick); }
.tag-gray  { background: var(--gray-bg);  color: var(--gray); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding-top: 14px; color: var(--text-sub); font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(42, 37, 32, .42);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
}
.modal-mask.show { display: flex; }
.modal {
  background: #FFF;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(42, 37, 32, .18);
  width: 520px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
}
.modal .modal-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal .modal-head .t { font-size: 15px; font-weight: 600; }
.modal .modal-head .x { cursor: pointer; color: var(--text-sub); font-size: 18px; line-height: 1; border: none; background: none; }
.modal .modal-head .x:hover { color: var(--text); }
.modal .modal-body { padding: 18px 20px; overflow-y: auto; }
.modal .modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
/* 横向长方形弹窗（填写类表单）：两列栅格，压低整体高度 */
.modal-wide { width: min(920px, calc(100vw - 40px)); }
.modal-wide .modal-body { max-height: 74vh; }
/* 新建申请弹窗行程明细为 6 列表格，适当加宽并压缩控件字号 */
#modal-app .modal { width: min(1040px, calc(100vw - 40px)); }
#ap-itinerary-tbl input, #ap-itinerary-tbl select { font-size: 12px; padding: 5px 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .form-section { grid-column: 1 / -1; }
.form-grid .form-row { margin-bottom: 12px; }
.form-grid .form-row label { padding-top: 8px; }
.form-grid .form-item { margin-bottom: 12px; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}
/* 只读计算值（差错率自动计算结果） */
.calc-box {
  background: #FBF9F4; border: 1px dashed var(--border); border-radius: 8px;
  padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 26px;
  font-size: 13px; align-items: center;
}
.calc-box .ck { color: var(--text-sub); }
.calc-box .cv { font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-box .cv.bad { color: #C0392B; }
.calc-box .cv.good { color: #1E7D46; }
/* 单选/勾选与文字保持同行，不换行错位 */
.radio-line { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.radio-line label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.radio-line input[type="radio"], .radio-line input[type="checkbox"] { width: auto; margin: 0; flex-shrink: 0; }

/* ---------- 展开履历区 ---------- */
.expand-panel {
  background: #FBF9F4;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 6px;
}
.expand-panel h4 { font-size: 13px; margin: 8px 0; color: var(--text-sub); }
.expand-panel h4:first-child { margin-top: 0; }

/* ---------- 任务详情 ---------- */
.detail-head { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-bottom: 14px; }
.detail-head .kv .k { font-size: 12px; color: var(--text-sub); }
.detail-head .kv .v { font-size: 14px; margin-top: 3px; font-weight: 600; }

/* 任务详情页：两列信息网格 */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.detail-grid .kv .k { font-size: 12px; color: var(--text-sub); }
.detail-grid .kv .v { font-size: 14px; margin-top: 3px; font-weight: 600; word-break: break-all; }
@media (max-width: 960px) { .detail-grid { grid-template-columns: 1fr; } }

/* ---------- 顶栏用户徽章 + 下拉菜单 ---------- */
.topbar .user-box { position: relative; }
.user-badge {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px 0 6px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; cursor: pointer; font-size: 14px; color: var(--text);
  transition: background .15s, border-color .15s;
}
.user-badge:hover { background: #FBF8F2; border-color: var(--border); }
.user-badge .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #FFF;
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-badge .caret { font-size: 10px; color: var(--text-sub); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(42, 37, 32, .14);
  padding: 6px;
  display: none;
  z-index: 60;
}
.user-menu.show { display: block; }
.user-menu .um-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu .um-name { font-weight: 600; font-size: 14px; }
.user-menu .um-meta { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.user-menu .um-item {
  display: block; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer;
  padding: 9px 12px; border-radius: 6px;
  font-size: 14px; color: var(--text);
}
.user-menu .um-item:hover { background: #FBF8F2; color: var(--primary); }
.user-menu .um-item.um-danger:hover { color: var(--brick); }

/* ---------- 表格单元格：主行 + 次行 ---------- */
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ---------- 检测项目：主项大标题通栏分组行 + 子项缩进 ---------- */
.grp-row td {
  background: var(--primary-light);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.cell-sub.sub-indent {
  font-size: 13px;
  color: var(--text);
  padding-left: 24px;
  position: relative;
}
.cell-sub.sub-indent::before {
  content: "";
  position: absolute;
  left: 10px; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

/* ---------- 任务详情：信息分组卡片（纵向堆叠，卡片占满宽度） ---------- */
.info-groups { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 18px; }
.info-groups .card { margin-bottom: 0; }
.info-groups .card .card-title { display: flex; align-items: center; justify-content: space-between; }

/* ---------- 表单分组标题（弹窗内分段） ---------- */
.form-section {
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  padding: 4px 0 10px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.form-section:not(:first-child) { margin-top: 18px; }

/* ---------- 开关（启用/禁用） ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
/* 修正：.form-row .field input 的 width:100% 会撑破 switch 与勾选框，这里用更高优先级压回 */
.form-row .field .switch input { width: 0 !important; height: 0 !important; opacity: 0; }
/* 修正：.form-row .field label{width:auto} 会让 switch 失去 40px 宽度而塌陷，压回固定尺寸 */
/* 注意必须同时压掉 min-width（.form-row label 带 min-width），否则轨道被撑宽、滑块停在中间 */
.form-row .field label.switch { width: 40px; min-width: 0; height: 22px; flex-shrink: 0; padding-top: 0; }
.form-row .field input[type="checkbox"],
.form-row .field input[type="radio"] { width: auto !important; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #D8D1C6; border-radius: 999px;
  transition: background .15s;
}
.switch .slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #FFF; transition: transform .15s;
}
.switch input:checked + .slider { background: var(--pine); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- Toast ---------- */
#toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 18px;
  border-radius: 8px;
  background: #2B2723;
  color: #F4EFE7;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: toast-in .2s ease-out;
  max-width: 70vw;
}
.toast.toast-error { background: var(--brick); }
.toast.toast-success { background: var(--pine); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(circle at 20% 30%, #F1E9DC 0, transparent 45%),
                    radial-gradient(circle at 80% 70%, #EFE6D8 0, transparent 40%);
}
.login-card {
  width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(42, 37, 32, .10);
  padding: 36px 36px 30px;
}
.login-card .logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 12px;
  background: var(--primary);
  color: #FFF; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 18px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text-sub); font-size: 12px; margin-bottom: 26px; }
.login-card .form-row { display: block; margin-bottom: 16px; }
.login-card .form-row label { display: block; width: auto; padding: 0 0 6px; }
.login-card .form-row input { width: 100%; height: 40px; }
.login-card .btn-login { width: 100%; height: 40px; font-size: 15px; margin-top: 6px; }
.login-card .tip { margin-top: 16px; text-align: center; font-size: 12px; color: var(--text-sub); }
.login-err { color: var(--brick); font-size: 13px; text-align: center; min-height: 18px; margin-bottom: 8px; }

/* ---------- 其他 ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-sub); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 64px; }
  .sidebar .brand, .sidebar nav a span.txt { display: none; }
  .sidebar nav a { justify-content: center; padding: 14px 0; }
}

/* 可点击链接（如台账编号查看详情） */
.lnk { color: #B4552D; text-decoration: none; cursor: pointer; }
.lnk:hover { text-decoration: underline; }

/* ---------- Dialog 自定义弹窗（js/dialog.js） ---------- */
.dlg-mask {
  position: fixed; inset: 0;
  background: rgba(42, 37, 32, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity .15s ease-out;
}
.dlg-mask.show { opacity: 1; }
.dlg-card {
  background: #FFF;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(42, 37, 32, .20);
  width: 400px;
  max-width: calc(100vw - 48px);
  padding: 0;
  transform: translateY(10px);
  transition: transform .15s ease-out;
}
.dlg-mask.show .dlg-card { transform: translateY(0); }
.dlg-head {
  display: flex; align-items: center; gap: 8px;
  padding: 15px 18px 0;
}
.dlg-ico { display: inline-flex; flex-shrink: 0; }
.dlg-ico-info { color: var(--slate); }
.dlg-ico-success { color: var(--pine); }
.dlg-ico-warning { color: var(--amber); }
.dlg-ico-danger { color: var(--brick); }
.dlg-title { flex: 1; font-size: 15px; font-weight: 600; }
.dlg-x {
  border: none; background: none; cursor: pointer;
  color: var(--text-sub); font-size: 18px; line-height: 1; padding: 2px 4px;
}
.dlg-x:hover { color: var(--text); }
.dlg-body {
  padding: 12px 18px 4px 46px;
  color: var(--text); font-size: 14px; line-height: 1.7;
  word-break: break-word; white-space: pre-wrap;
}
.dlg-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 18px 16px;
}
.dlg-btn-danger { background: var(--brick); border-color: var(--brick); color: #FFF; }
.dlg-btn-danger:hover { background: #8E3B2F; border-color: #8E3B2F; color: #FFF; }
.dlg-loading-card {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 26px; width: auto;
}
.dlg-spinner {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%;
  animation: dlg-spin .7s linear infinite;
}
@keyframes dlg-spin { to { transform: rotate(360deg); } }

/* ---------- 登录页增强 ---------- */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  border: none; background: none; cursor: pointer;
  color: var(--text-sub); display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.pwd-eye:hover { color: var(--primary); }
.login-remember { display: flex; align-items: center; gap: 18px; margin: 2px 0 14px; font-size: 13px; color: var(--text-sub); }
.login-remember label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.login-remember input[type="checkbox"] { height: auto; accent-color: var(--primary); }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img-box {
  width: 116px; height: 40px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: #FBF9F4; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.captcha-img-box img { width: 100%; height: 100%; object-fit: fill; display: block; }
.captcha-img-box .captcha-err { font-size: 11px; color: var(--text-sub); text-align: center; padding: 0 4px; }
.captcha-refresh { margin-top: 6px; font-size: 12px; color: var(--text-sub); }
.captcha-refresh a { cursor: pointer; }

/* 领用申请多物资明细行 */
.mi-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.mi-row select.mi-mat { flex: 1; min-width: 0; }
.mi-row input.mi-qty { width: 90px; flex-shrink: 0; }
.mi-row .mi-del { flex-shrink: 0; padding: 0 10px; }
.mi-row input.mi-text { flex: 1; min-width: 0; }

/* ---------- 采集接口明细表格（提交/审核弹窗） ---------- */
.iface-tbl { margin-top: 2px; }
.iface-tbl th { white-space: nowrap; font-size: 12px; padding: 7px 8px; }
.iface-tbl td { padding: 5px 6px; }
.iface-tbl input, .iface-tbl select { width: 100%; height: 32px; padding: 4px 8px; font-size: 13px; box-sizing: border-box; }
.iface-tbl .if-del { padding: 0 10px; height: 30px; }

/* ---------- 记录表格与判据文字行高 ---------- */
table.tbl td { line-height: 1.65; }
#s-criterion { line-height: 1.7; }
