/* ============================================================
   货物与生产流程管理系统 —— 样式
   沿用上一版（SoteraHealth 网页版）的配色与字体，车间员工不需要重新适应：
   - 主色  #1a6fb5
   - 空位  浅灰虚线框
   - 有货  浅蓝卡片 + 左上角工单号
   ============================================================ */

:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --border: #d9dee5;
  --border-soft: #e8ecf1;
  --text: #1f2733;
  --text-soft: #66707d;
  --text-mute: #98a2b0;
  --primary: #1a6fb5;
  --primary-dark: #155a93;
  --primary-soft: #e8f2fb;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --ok: #157f52;
  --ok-soft: #e6f6ee;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .10);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

.hidden { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--text-soft); }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* ==================== 按钮 ==================== */
.btn {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s, box-shadow .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.btn:hover:not(:disabled) { background: #f5f7fa; border-color: #b9c2cd; }
.btn:active:not(:disabled) { background: #e9edf2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:active:not(:disabled) { background: #114a78; }

.btn-danger { color: var(--danger); border-color: #e6b8b8; background: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); border-color: #d99a9a; }

.btn-ghost { border-color: transparent; background: transparent; color: var(--text-soft); }
.btn-ghost:hover:not(:disabled) { background: #eef1f5; }

.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-block { width: 100%; }

/* ==================== 表单 ==================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--text-soft); }
.field .req { color: var(--danger); }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 111, 181, .12);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
textarea { resize: vertical; min-height: 64px; }

.hint { font-size: 12px; color: var(--text-mute); }
.hint.err { color: #b42318; }
.error-text { font-size: 13px; color: var(--danger); min-height: 18px; }

/* ==================== 登录页 ==================== */
#page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef4fb 0%, #f7f9fc 45%, #e9eff7 100%);
  padding: 24px;
}
.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 34px 34px 28px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; letter-spacing: .5px;
}
.login-title { font-size: 19px; font-weight: 700; }
.login-sub { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin: 22px 0 20px; }
.tab {
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-foot { margin-top: 16px; font-size: 12px; color: var(--text-mute); text-align: center; }

/* ==================== 顶栏 ==================== */
#app-head {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.head-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.head-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.head-nav { display: flex; gap: 2px; margin-left: 10px; }
.nav-link {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}
.nav-link:hover { background: #f1f4f8; color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.head-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-soft); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #dbe8f5; color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.role-tag {
  padding: 2px 7px; border-radius: 20px; font-size: 12px;
  background: #eef1f5; color: var(--text-soft);
}
.role-tag.admin { background: var(--warn-soft); color: var(--warn); }
.ver-tag {
  padding: 2px 7px; border-radius: 20px; font-size: 11.5px;
  font-family: ui-monospace, Consolas, monospace;
  background: #eef7f2; color: #0f766e; border: 1px solid #cfe9e0;
}

/* 左下角构建徽标：登录页也能看到，用来一眼判断「页面是不是旧的」 */
.build-badge {
  position: fixed; left: 10px; bottom: 8px; z-index: 60;
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
  color: #64748b; background: rgba(255, 255, 255, .88);
  border: 1px solid #e3e8ef; border-radius: 20px; padding: 2px 9px;
  pointer-events: none; user-select: none;
}

/* ==================== 页面容器 ==================== */
.page { padding: 22px; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
/* 标题块允许收缩：不设 min-width:0 的话长描述会把右侧按钮顶到下一行 */
.page-head > div:first-child { min-width: 0; }
/* 页头右侧按钮组：多个按钮时保持一行、右对齐 */
.head-actions { display: flex; gap: 8px; flex: none; margin-left: auto; }
.page-title { font-size: 20px; font-weight: 700; margin: 0; }
.page-desc { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-pad { padding: 16px 18px; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar input[type=text] { width: 240px; }
.toolbar select { width: auto; min-width: 130px; }

/* 时间范围：两个日期框 + 中间的「至」，整体当作一个控件看待 */
.range-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 8px;
  background: #f7f9fb; border: 1px solid var(--border-soft);
}
.range-filter input[type=date] {
  width: 150px; height: 32px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
  font-size: 13px;
}

/* 筛选条件回显：一行小字，让操作员一眼确认「现在看的是哪一段」 */
.filter-note {
  margin: -6px 0 12px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.filter-note b { color: var(--text); font-weight: 600; }

/* ==================== 首页 ==================== */
.hero { margin-bottom: 22px; }
.hero h1 { font-size: 24px; margin: 0 0 6px; }
.hero p { margin: 0; color: var(--text-soft); font-size: 14px; }

.action-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 16px; }
.action-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; gap: 16px; align-items: flex-start;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,40,.10); border-color: #bcd3e8; }
.action-icon {
  width: 46px; height: 46px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.action-card h3 { margin: 0 0 6px; font-size: 16px; }
.action-card p { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.6; }

.section-title { font-size: 14px; color: var(--text-soft); margin: 26px 0 12px; font-weight: 600; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.mini-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
  font-family: inherit; text-align: left; color: inherit;
}
.mini-card:hover { border-color: #bcd3e8; box-shadow: var(--shadow); }
.mini-card .label { font-size: 13px; color: var(--text-soft); }
.mini-card .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.mini-card .foot { font-size: 12px; color: var(--text-mute); margin-top: 4px; }

/* ==================== 表格 ==================== */
.table-wrap { overflow: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
table.data th {
  background: #f7f9fb;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 12.5px;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--border);
}
table.data tbody tr:hover { background: #fafcfe; }
table.data td.actions { text-align: right; }
table.data .cell-strong { font-weight: 600; }
.empty-row { padding: 40px; text-align: center; color: var(--text-mute); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12px; line-height: 18px;
  background: #eef1f5; color: var(--text-soft);
}
.tag.blue { background: var(--primary-soft); color: #14507f; }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.orange { background: var(--warn-soft); color: var(--warn); }
.tag.red { background: var(--danger-soft); color: var(--danger); }

/* ==================== 看板 ==================== */
.board-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; min-width: 118px;
}
.stat .k { font-size: 12px; color: var(--text-soft); }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.stat .v .unit { font-size: 12px; font-weight: 400; color: var(--text-mute); margin-left: 3px; }

.zone {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 74px;   /* 顶部导航吸顶，定位时别被挡住 */
}
.zone-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: #fcfdfe;
}
.zone-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.zone-name { font-weight: 700; font-size: 15px; }
.zone-hint { font-size: 12px; color: var(--text-mute); }
.zone-count { margin-left: auto; font-size: 13px; color: var(--text-soft); }
.bar { width: 120px; height: 6px; border-radius: 4px; background: #eef1f5; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .25s; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
  padding: 14px 16px 18px;
}
.slot {
  border: 1px dashed #cfd8e3;
  border-radius: 9px;
  min-height: 86px;
  padding: 8px 10px;
  background: #fbfcfe;
  position: relative;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.slot .slot-label {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: .3px;
}

/* 分组分隔（解析间的「货架 / 地面」、发货区的「货架 / 平台」） */
.group-label {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-soft);
  padding: 6px 0 6px;
  border-bottom: 1px dashed var(--border-soft);
  margin: 4px 0 0;
}
.group-label:first-child { margin-top: 0; padding-top: 0; }
.slot.empty .slot-empty-text {
  font-size: 12px;
  color: #c3cbd6;
  margin-top: 16px;
  text-align: center;
}

/* 拖拽时的可放置提示 */
.slot.drop-ok { border-color: var(--primary); border-style: solid; background: #f2f8fe; box-shadow: inset 0 0 0 1px rgba(26,111,181,.15); }
.slot.drop-ok::after {
  content: "放到这里";
  position: absolute; inset: auto 0 10px 0;
  text-align: center; font-size: 11px; color: var(--primary);
}
.slot.drop-bad { opacity: .45; }

.card {
  margin-top: 6px;
  background: #fff;
  border: 1px solid #cfdff0;
  border-left: 3px solid var(--primary);
  border-radius: 7px;
  padding: 6px 8px;
  cursor: grab;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 3px 10px rgba(16,24,40,.12); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .4; transform: scale(.98); }
.card .wo { font-weight: 700; font-size: 13px; color: #123; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .item { font-size: 12px; color: var(--text-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.card .qty { font-variant-numeric: tabular-nums; }

/* 卡片在本工序已停留多久 */
.card .card-dwell {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px; padding-top: 3px;
  border-top: 1px dashed #e6edf5;
  font-size: 11px; color: #b45309;
}
.card .card-dwell span { color: var(--text-mute); }
.card .card-dwell b { font-weight: 600; font-variant-numeric: tabular-nums; }

.card.zone-STER { border-left-color: #c2410c; border-color: #f0d6c8; }
.card.zone-PARSE { border-left-color: #0f766e; border-color: #c9e3df; }
.card.zone-SHIP { border-left-color: #7c3aed; border-color: #ddd3f5; }

/* ---------------- 发货区：按存放天数变色 ----------------
   需求：0-5 天一种颜色、5-10 天一种颜色、超过 10 天一种颜色。
   天数由服务端按「进入发货区的时间」算好，颜色只做视觉提示。 */
.card.ship-age-1 { background: #f2fbf6; border-color: #c6e7d4; border-left-color: #157f52; }
.card.ship-age-2 { background: #fdf8ec; border-color: #f0dcb6; border-left-color: #b45309; }
.card.ship-age-3 { background: #fdf1f0; border-color: #f2c9c5; border-left-color: #c62828; }

.card .age-tag { font-size: 10.5px; margin-top: 3px; color: var(--text-mute); }
.card.ship-age-1 .age-tag { color: #157f52; }
.card.ship-age-2 .age-tag { color: #b45309; }
.card.ship-age-3 .age-tag { color: #c62828; font-weight: 600; }

.age-chip {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 12px; background: #eef1f5; color: var(--text-soft);
}
.age-chip.ship-age-1 { background: var(--ok-soft); color: var(--ok); }
.age-chip.ship-age-2 { background: var(--warn-soft); color: var(--warn); }
.age-chip.ship-age-3 { background: var(--danger-soft); color: var(--danger); }

/* 发货区图例 */
.ship-legend { font-size: 11.5px; color: var(--text-mute); display: inline-flex; align-items: center; gap: 4px; }
.ship-legend i {
  width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-left: 6px;
}
.ship-legend i.age-1 { background: #157f52; }
.ship-legend i.age-2 { background: #d97706; }
.ship-legend i.age-3 { background: #c62828; }

/* ---------------- 发货区货架：一个货架放多张卡（按件数计容） ---------------- */
.slot.bulk { min-height: 96px; padding-bottom: 10px; }
.slot.bulk .slot-label {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.slot.bulk .cap-badge {
  font-size: 10.5px; color: #5b4b8a; background: #f3effc;
  border-radius: 8px; padding: 0 6px; line-height: 15px;
  font-variant-numeric: tabular-nums;
}
.slot.bulk .cap-bar {
  display: block; height: 3px; border-radius: 2px; background: #eef1f5;  margin: 2px 0 0; overflow: hidden;
  flex: 0 0 100%; width: 100%;
}
.slot.bulk .cap-bar > i { display: block; height: 100%; background: #7c3aed; }
.bulk-cards { display: flex; flex-direction: column; gap: 5px; margin-top: 3px; }

/* 发货区货架杂物：登记按钮 + 说明标签 */
.misc-btn {
  margin-left: auto;
  font-size: 10px; line-height: 15px;
  padding: 0 6px; border-radius: 7px;
  border: 1px solid #e2e7ee; background: #f5f7fa; color: #8a93a0;
  cursor: pointer; font-family: inherit;
  opacity: .85;
}
.slot:hover .misc-btn { opacity: 1; border-color: #d9c48a; color: #8a6d1a; background: #fdf8e7; }
.misc-btn:hover { border-color: #c9a227; color: #7a5c00; background: #faefc8; }
.misc-tag {
  margin-top: 4px;
  font-size: 11px; line-height: 1.5;
  color: #7a5c00; background: #fdf3d0;
  border: 1px solid #ecd9a0; border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  word-break: break-all; white-space: normal;
}
.misc-tag:hover { background: #faecc0; }

.card.compact { margin-top: 0; padding: 4px 6px; }
.card.compact .wo { font-size: 12px; }
.card.compact .item { font-size: 11px; }
.card.compact .meta { font-size: 10.5px; gap: 6px; margin-top: 2px; }
.card.compact .card-dwell { margin-top: 2px; padding-top: 2px; font-size: 10px; }

.card .shipno-line {
  font-size: 10.5px; color: #5b4b8a; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 移动货位时，货架剩余件数的小字 */
.slot-picker .pick .pick-sub {
  display: block; font-size: 10.5px; color: var(--text-mute); font-style: normal;
}
.slot-picker .pick.on .pick-sub { color: rgba(255, 255, 255, .8); }

/* ---------------- 拆分弹窗 ---------------- */
.split-head {
  display: grid; grid-template-columns: 118px 104px 1fr; gap: 8px;
  font-size: 12px; color: var(--text-soft); padding: 0 2px;
}
.split-parts { display: flex; flex-direction: column; gap: 8px; }
.split-row { display: grid; grid-template-columns: 118px 104px 1fr; gap: 8px; align-items: center; }
.split-row .split-wo {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #f5f7fa; border-radius: 6px; padding: 7px 8px;
}
.split-row input { padding: 7px 9px; }
.split-sum {
  font-size: 12.5px; color: var(--text-soft);
  background: #f7f9fb; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 7px 10px;
  font-variant-numeric: tabular-nums;
}
.split-sum.ok { background: var(--ok-soft); border-color: #c6e7d4; color: var(--ok); }
.split-sum.bad { background: var(--danger-soft); border-color: #f2c9c5; color: var(--danger); }

/* 部分发货后的剩余数量：货位右上角角标 + 卡片上的已发提示 */
.remain-tag {
  position: absolute;
  top: 4px; right: 6px;
  background: #7c3aed;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.card .meta .shipped { color: #7c3aed; font-weight: 600; }

/* 看板顶部的工序快速定位 */
.zone-nav {
  position: sticky;
  top: 58px;
  z-index: 20;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(242, 244, 247, .94);
  backdrop-filter: blur(4px);
  padding: 8px 0 10px;
  margin-bottom: 4px;
}
.zone-nav-tip { font-size: 12px; color: var(--text-mute); }
.zone-nav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-family: inherit; font-size: 13px; color: var(--text-soft);
  cursor: pointer;
}
.zone-nav-btn:hover { border-color: #b9c2cd; background: #f7f9fb; color: var(--text); }
.zone-nav-btn .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* 移动货位时的空位选择器 */
.slot-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 2px;
}
.slot-picker .pick {
  padding: 7px 6px;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  background: #fbfcfe;
  font-family: inherit; font-size: 12.5px; color: var(--text-soft);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.slot-picker .pick:hover { border-color: var(--primary); color: var(--primary); background: #f2f8fe; }
.slot-picker .pick.on {
  border-style: solid; border-color: var(--primary);
  background: var(--primary); color: #fff; font-weight: 600;
}

/* 库存表合计行 */
table.data tfoot td {
  background: #f7f9fb;
  font-weight: 600;
  border-top: 1px solid var(--border);
}

/* ==================== 弹窗 ==================== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: pop .14s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6 } to { transform: none; opacity: 1 } }
.modal.wide { width: 640px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 10px;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  margin-left: auto; border: 0; background: none; font-size: 20px;
  color: var(--text-mute); cursor: pointer; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: flex-end; gap: 10px;
  background: #fcfdfe;
  border-radius: 0 0 12px 12px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note-box {
  background: #f7f9fb; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13px; color: var(--text-soft); line-height: 1.6;
}
.note-box.warn { background: var(--warn-soft); border-color: #f2ddba; color: #7c4a05; }

/* ==================== 提示 ==================== */
#toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #1f2733; color: #fff;
  padding: 9px 16px; border-radius: 8px;
  font-size: 13.5px; box-shadow: var(--shadow-lg);
  animation: drop .18s ease-out;
  max-width: 80vw;
}
.toast.ok { background: #157f52; }
.toast.err { background: #b3261e; }
@keyframes drop { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

.loading-mask {
  position: fixed; inset: 0; background: rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center; z-index: 150;
  color: var(--text-soft); font-size: 14px; gap: 10px;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #cfd8e3; border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ==================== 详情 ==================== */
.detail-list { display: grid; grid-template-columns: 108px 1fr; gap: 9px 14px; font-size: 13.5px; }
.detail-list dt { color: var(--text-soft); }
.detail-list dd { margin: 0; }
.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 230px; overflow: auto; padding-right: 4px; }
.tl-item { display: flex; gap: 10px; font-size: 13px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex: none; }
.tl-time { color: var(--text-mute); font-size: 12px; }

/* ==================== 窄屏 ==================== */
@media (max-width: 900px) {
  .action-grid, .mini-grid { grid-template-columns: 1fr; }
  .page { padding: 14px; }
  .head-nav { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   2026-11-15d：用户管理 / 数据维护页
   ============================================================ */

/* 顶栏部门标签：放在角色和姓名之间，灰底小字 */
.dept-tag {
  padding: 2px 7px; border-radius: 20px; font-size: 12px;
  background: #eef7f2; color: #0f6e56; border: 1px solid #d5e9e0;
}

/* 超级管理员用琥珀色，和普通管理员区分开 */
.role-tag.super { background: #fdf3e3; color: #8a5a00; border: 1px solid #f0d9a8; }

/* 面板内小标题 */
.panel-title { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 8px; }

/* 容量条：整行（进度条 + 文字 + 百分比） */
.cap-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; flex-wrap: wrap; }
.cap-line .bar { flex: 1 1 260px; max-width: 420px; height: 10px; }
.bar > i.warn { background: var(--warn); }
.bar > i.danger { background: var(--danger); }

/* 键值一行：版本 / 数据文件 / 日志文件 / 已用页 */
.kv-row { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }
.kv-row b { color: var(--text); font-weight: 500; }

/* 用户管理表格的操作列：按钮多，留白小一点 */
.act-cell { white-space: nowrap; }
.act-cell .btn { margin-right: 6px; }
.act-cell .btn:last-child { margin-right: 0; }

/* 已停用的账号整行变淡 */
tr.row-dim td { opacity: .55; }

/* 清理结果提示的出错态 */
.filter-note.err { color: #b42318; background: var(--danger-soft); border-color: #f0c8c8; }

/* 导航条目变多（加了用户管理/数据维护）后在 1366/1500 宽度下会被挤成两行，
   改成不换行 + 可横向滚动，宁可滚也不要把高度撑开 */
.head-nav { overflow-x: auto; scrollbar-width: none; min-width: 0; }
.head-nav::-webkit-scrollbar { display: none; }
.nav-link { padding: 7px 10px; font-size: 13.5px; white-space: nowrap; flex: 0 0 auto; }

/* 全局 input 是 width:100%，放到工具栏里会把日期框撑满整行 */
#purge-date { width: 170px; flex: 0 0 auto; }

/* 清理范围：三张表各一个勾选项，横排，窄屏自动换行 */
.purge-scope {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px; margin: 12px 0 10px;
}
.purge-scope .chk {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: #fbfcfe; cursor: pointer;
}
.purge-scope .chk:hover { border-color: #b9d3ef; background: #f6f9fd; }
.purge-scope .chk input[type=checkbox] {
  width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--primary, #1a6fc4);
}
.purge-scope .chk-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.purge-scope .chk-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.purge-scope .chk-desc { font-size: 12px; color: var(--text-mute); line-height: 1.5; }
.purge-scope .chk-desc b { color: var(--text); font-weight: 600; }

/* 容量条：数据量很小时几乎看不出是进度条，底色加深一点、加细边框 */
.cap-line .bar { background: #e6ebf2; border: 1px solid #d7dfe9; height: 10px; }

/* 表清单：中文表名和英文物理名之间留点空隙 */
.table-alias { margin-left: 6px; }

/* 顶栏的版本徽标和左下角 build-badge 信息重复，且把导航挤得放不下 —— 只留左下角那份 */
.head-user .ver-tag { display: none; }
.head-brand span { white-space: nowrap; }
