:root {
  --primary: #2b6cff;
  --primary-dark: #1b4fd1;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #7a8396;
  --border: #e6e9f0;
  --success: #15a97c;
  --danger: #e2564a;
  --warning: #e8a33d;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(24, 39, 75, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1b2a4e 0%, #2b6cff 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}
.login-card h1 { font-size: 22px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 13px; }
.login-tip {
  margin-top: 18px; padding: 12px; background: #f7f9ff;
  border-radius: 8px; font-size: 12px; color: var(--muted); line-height: 1.9;
}

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #1b2436; color: #c7cfdd;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar .logo {
  height: 58px; display: flex; align-items: center; gap: 8px;
  padding: 0 18px; color: #fff; font-weight: 600; font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  margin-bottom: 2px; transition: .18s; font-size: 14px;
}
.sidebar .nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }
.sidebar .nav-group { font-size: 12px; color: #6d7792; padding: 14px 12px 6px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.content { padding: 18px; flex: 1; overflow-y: auto; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
/* 全局表单控件是 width:100%，在 flex 容器里会把每个筛选项挤成独占一行，这里改成按内容横排 */
.filters input, .filters select { width: auto; min-width: 140px; flex: 0 1 180px; }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }

.btn {
  padding: 8px 16px; border: 1px solid transparent; border-radius: 8px;
  background: var(--primary); color: #fff; cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn.block { width: 100%; padding: 11px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
/* 列较多时整体横向滚动，单元格不折行，避免标签与时间被挤成竖排 */
th, td {
  padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: middle; white-space: nowrap;
}
th { color: var(--muted); font-weight: 500; background: #fafbfe; }
tbody tr:hover { background: #fafbff; }
.table-wrap { overflow-x: auto; }
/* 流水明细列多，按内容收缩，避免被拉满整屏 */
.table-wrap.compact table { width: max-content; font-size: 12px; }
.table-wrap.compact th,
.table-wrap.compact td { padding: 6px 8px; }
.table-wrap.compact select.settle-select { width: 92px; min-width: 0; padding: 3px 4px; font-size: 12px; }
.card-title .actions { display: flex; gap: 8px; align-items: center; }
.num { font-variant-numeric: tabular-nums; }
.money { color: var(--success); font-weight: 600; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; line-height: 1.7; white-space: nowrap; }
.tag.gray { background: #eef0f5; color: #6b7384; }
.tag.blue { background: #e7efff; color: var(--primary); }
.tag.green { background: #e3f6ef; color: var(--success); }
.tag.red { background: #fdeceb; color: var(--danger); }
.tag.orange { background: #fdf2e2; color: var(--warning); }
.tag.purple { background: #f0eafd; color: #7a4fd4; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); border-left: 3px solid var(--primary);
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 22, 38, .55);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.modal.wide { max-width: 900px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }

.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.form-item .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- 图片审核 ---------- */
.audit-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; background: #fff; }
.audit-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.audit-meta { color: var(--muted); font-size: 13px; }
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.img-grid img {
  width: 110px; height: 110px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: zoom-in; background: #f2f4f8;
}
.viewer { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; z-index: 80; }
.viewer img { max-width: 92%; max-height: 92%; }
.pay-codes { display: flex; gap: 16px; }
.pay-codes figure { margin: 0; text-align: center; }
.pay-codes figcaption { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.pay-codes img { width: 180px; height: 180px; object-fit: contain; background: #f6f7fb; border-radius: 8px; cursor: zoom-in; }
.pay-codes .empty { padding: 48px 12px; }

/* 报单核对信息：键值对平铺，审核时一眼能对齐截图 */
.kv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 18px; background: #f7f9fc; border-radius: 8px; padding: 12px; margin: 10px 0;
}
/* 标签在上、取值在下，避免「服务时段」这类长值把标签挤成竖排 */
.kv-grid div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.kv-grid span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.kv-grid b { font-variant-numeric: tabular-nums; }

.warn-box {
  background: #fdf2e2; color: #8a5d12; border-radius: 8px;
  padding: 9px 12px; margin: 10px 0; font-size: 13px; line-height: 1.8;
}

.timeline { border-left: 2px solid var(--border); padding-left: 14px; margin-top: 10px; }
.timeline-item { margin-bottom: 10px; font-size: 13px; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: -20px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
}

/* ---------- 提示 ---------- */
.toast-area { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 20px; border-radius: 8px; color: #fff; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); background: #333;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
/* track / fill 是 span，必须转成块级，否则高度不生效、进度条不上色 */
.bar-track { display: block; background: #eef0f5; border-radius: 20px; height: 10px; overflow: hidden; }
.bar-fill { display: block; background: var(--primary); height: 100%; border-radius: 20px; }

@media (max-width: 860px) {
  .sidebar { width: 62px; }
  .sidebar .logo span, .sidebar .nav-item span.txt, .sidebar .nav-group { display: none; }
  .sidebar .nav-item { justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
}
