:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e3e8ef;
  --border-strong: #d3dae4;
  --text: #111827;
  --text-2: #5b6b7f;
  --text-3: #8a99ab;
  --primary: #1f6feb;
  --primary-dark: #1557c0;
  --primary-soft: #e8f1ff;
  --green: #0f9d58;
  --green-soft: #e6f6ee;
  --amber: #d98324;
  --amber-soft: #fdf3e5;
  --red: #d93025;
  --red-soft: #fdeceb;
  --violet: #7c4dff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.hidden { display: none !important; }

/* ---------- boot ---------- */
#boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  color: var(--text-2);
  z-index: 90;
}
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- auth ---------- */
#auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 10% -10%, #e2edff 0%, transparent 60%),
    radial-gradient(800px 400px at 100% 110%, #e6f6ee 0%, transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 32px 32px 28px;
  border: 1px solid rgba(255, 255, 255, .8);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1f6feb, #12b5a5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  letter-spacing: .5px;
  flex: none;
}
.auth-title { font-size: 20px; font-weight: 650; letter-spacing: .2px; }
.auth-sub { color: var(--text-3); font-size: 13px; margin: 0 0 22px; }
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-3);
  padding: 4px;
  border-radius: 9px;
  margin-bottom: 20px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 6px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: .15s;
}
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  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(31, 111, 235, .12);
}
.textarea { resize: vertical; min-height: 64px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { color: var(--red); border-color: #f2c9c6; background: var(--red-soft); }
.btn-danger:hover { background: #fbdcd9; border-color: #e9aeaa; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 5px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: none; color: var(--primary); padding: 4px 2px; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }

.alert {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: var(--red-soft); color: #8f2119; border: 1px solid #f2c9c6; }
.alert-ok { background: var(--green-soft); color: #0a6b3d; border: 1px solid #bfe6d1; }
.alert-info { background: var(--primary-soft); color: #134a9e; border: 1px solid #c5dcff; }

/* ---------- app shell ---------- */
#app-view { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: 56px;
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
.topbar-title { font-weight: 650; font-size: 15.5px; letter-spacing: .2px; }
.topbar-tag {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 500;
}
.topbar-spacer { flex: 1; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  background: var(--surface-3);
  font-size: 13px;
  color: var(--text-2);
  max-width: 260px;
}
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f6feb, #12b5a5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex: none;
}
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layout { display: flex; flex: 1; align-items: stretch; min-height: 0; }

.sidebar {
  width: 196px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  width: 100%;
  transition: .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-ico { width: 16px; text-align: center; font-size: 14px; opacity: .85; flex: none; }
.nav-sep { height: 1px; background: var(--border); margin: 9px 6px; }

.content { flex: 1; min-width: 0; padding: 20px 22px 60px; overflow-x: hidden; }

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-title { font-size: 19px; font-weight: 650; margin: 0; }
.page-desc { color: var(--text-3); font-size: 13px; margin: 3px 0 0; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title { font-size: 14.5px; font-weight: 600; margin: 0; }
.card-sub { font-size: 12.5px; color: var(--text-3); }
.card-body { padding: 16px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: 12.5px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.stat.accent-blue .stat-value { color: var(--primary); }
.stat.accent-green .stat-value { color: var(--green); }
.stat.accent-amber .stat-value { color: var(--amber); }
.stat.accent-violet .stat-value { color: var(--violet); }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
table.data th, table.data td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data thead th {
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.data tbody tr:hover { background: #fafcff; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tfoot td {
  background: var(--surface-2);
  font-weight: 650;
  border-top: 1px solid var(--border-strong);
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 2px; }
.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}
.empty b { display: block; color: var(--text-2); font-size: 14.5px; margin-bottom: 5px; font-weight: 600; }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.badge-gray { background: var(--surface-3); color: var(--text-2); }
.badge-blue { background: var(--primary-soft); color: #134a9e; }
.badge-green { background: var(--green-soft); color: #0a6b3d; }
.badge-amber { background: var(--amber-soft); color: #92560d; }
.badge-red { background: var(--red-soft); color: #8f2119; }
.badge-violet { background: #f0eaff; color: #4b2ea8; }

/* ---------- toolbar / filters ---------- */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar .input, .toolbar .select { width: auto; padding: 7px 10px; font-size: 13px; }
.toolbar .grow { flex: 1; min-width: 150px; }
.toolbar .spacer { flex: 1; }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  z-index: 60;
  overflow-y: auto;
  backdrop-filter: blur(1px);
}
.modal {
  background: var(--surface);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  animation: pop .16s ease-out;
}
.modal.wide { max-width: 780px; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--text-3);
  padding: 2px 6px;
  border-radius: 5px;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 18px 20px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  background: var(--surface-2);
  border-radius: 0 0 13px 13px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
.fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px 4px;
  margin: 0 0 14px;
}
.fieldset > legend {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 600;
  padding: 0 6px;
}
.calc-box {
  background: var(--primary-soft);
  border: 1px solid #c5dcff;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13px;
  color: #134a9e;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.calc-box b { font-variant-numeric: tabular-nums; }

/* ---------- toast ---------- */
#toast-host {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  background: #1f2937;
  color: #fff;
  animation: pop .16s ease-out;
  max-width: 80vw;
}
.toast.ok { background: #0f9d58; }
.toast.err { background: #d93025; }
.toast.info { background: #1f6feb; }

/* ---------- charts ---------- */
.chart-host { width: 100%; }
.chart-host svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ---------- misc ---------- */
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.section-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.section-title:first-child { margin-top: 0; }
.sub-table { font-size: 12.5px; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

@media (max-width: 760px) {
  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 8px;
  }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-sep { display: none; }
  .layout { flex-direction: column; }
  .content { padding: 14px 13px 60px; }
  .topbar-title { display: none; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .page-actions, .toolbar, .modal-foot, .no-print { display: none !important; }
  .modal-mask { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-width: none; }
  .modal-body { max-height: none; overflow: visible; }
  .content { padding: 0; }
}

/* ==================== 明细勾选与报销单归集 ==================== */
table.data th.pick, table.data td.pick {
  width: 40px;
  padding: 9px 6px 9px 14px;
  text-align: center;
}
table.data .pick input[type="checkbox"] {
  width: 15px; height: 15px; margin: 0;
  vertical-align: middle; cursor: pointer;
  accent-color: var(--primary);
}
table.data tbody tr.row-picked { background: var(--primary-soft); }
table.data tbody tr.row-picked:hover { background: #dce9ff; }

.pick-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px; color: var(--text-2);
}
.pick-bar .pick-text { flex: 1; min-width: 180px; }
.pick-bar .pick-text b { color: var(--text); font-variant-numeric: tabular-nums; }
.pick-bar .pick-actions { display: flex; gap: 8px; }

/* ==================== 分页 ==================== */
.pager {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
}
.pager-info { flex: 1; min-width: 190px; font-variant-numeric: tabular-nums; }
.pager-info b { color: var(--text); }
.pager-size { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); }
.pager-btns { display: inline-flex; gap: 6px; }
.select-sm { padding: 5px 8px; font-size: 12.5px; }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ==================== 补助参数卡片 ==================== */
.param-card { margin-bottom: 14px; border-color: #d8e4f5; background: linear-gradient(180deg, #fbfdff, #fff); }
.param-card .card-body { padding-top: 2px; }
.param-card .field { max-width: 300px; }

/* 非差旅费：出差天数锁定不可改 */
.input[disabled], .select[disabled] { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.stat.accent-red .stat-value { color: var(--red); }

@media (max-width: 720px) {
  .pager .pager-btns { width: 100%; }
  .pager .pager-btns .btn { flex: 1; }
}

.pending-panel {
  background: #fffcf4;
  border: 1px solid #f0e2c2;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.pending-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pending-title { font-size: 14px; font-weight: 650; color: #92560d; }
.pending-title b { font-variant-numeric: tabular-nums; }
.pending-hint { flex: 1; font-size: 12.5px; color: var(--text-3); }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.group-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
  border: 1px solid #ebe0c8;
  border-radius: 9px;
  padding: 11px 12px;
}
.group-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.group-card-body { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.group-card .btn { align-self: flex-start; }

.cell-sub { font-size: 11.5px; color: var(--text-2); margin-top: 2px; font-weight: 400; }
.cell-sub.muted { color: var(--text-3); }

.check-line {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; font-size: 13.5px; color: var(--text); cursor: pointer;
}
.check-line input { width: 15px; height: 15px; accent-color: var(--red); }

.pick-table { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pick-table table.data { margin: 0; }

/* ---------- Excel 导入 ---------- */
.import-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.import-file { font-size: 13px; color: var(--text-2); word-break: break-all; }
.import-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.import-chip {
  font-size: 12.5px; color: var(--text-2);
  background: #f6f8fa; border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 11px;
}
.import-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.import-chip.ok { background: var(--green-soft); border-color: #bfe6d0; color: #0a6b3d; }
.import-chip.bad { background: var(--red-soft); border-color: #f2c9c6; color: #8f2119; }
.import-chip.ok b, .import-chip.bad b { color: inherit; }
.pick-table tr.row-bad td { background: #fff6f5; }
.pick-table tr.row-bad .badge { white-space: normal; text-align: left; line-height: 1.5; }

@media (max-width: 720px) {
  .pick-bar .pick-actions { width: 100%; }
  .pick-bar .pick-actions .btn { flex: 1; }
  .group-grid { grid-template-columns: 1fr; }
}

/* ---------- 发票（二维码识别 · 原件归档 · 查重） ---------- */
.inv-sec { padding: 12px 14px 12px; }
.inv-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.inv-head b { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.inv-head .inv-spacer { flex: 1; }
.inv-sum { font-size: 12.5px; color: var(--text-3); }
.inv-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.inv-sum.bad { color: var(--red); }
.inv-sum.bad b { color: var(--red); }

/* 本批套用的费用类别（票面二维码里没有类别，必须人选） */
.inv-cat {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.inv-cat label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.inv-cat select { min-width: 150px; }
.inv-cat-hint { font-size: 12px; color: var(--text-3); flex: 1; min-width: 200px; }

/* 明细行里的「票 ×N」徽标 */
.inv-badge {
  font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 1px 7px; border-radius: 20px;
  background: var(--primary-soft); color: #134a9e;
  border: 1px solid #c5dcff;
}
.inv-badge:hover { background: #dbeafe; }

.inv-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 13px 15px;
  font-size: 13px; color: var(--text-2);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.inv-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.inv-drop.over { border-color: var(--primary); background: var(--primary-soft); color: #134a9e; }
.inv-drop-busy { pointer-events: none; opacity: .65; }
.inv-drop-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.inv-rows { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.inv-rows:empty { display: none; }

.inv-row {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 9px 11px;
  display: flex; gap: 10px; align-items: flex-start;
}
.inv-row.is-ready { border-left-color: var(--primary); }
.inv-row.is-saved { border-left-color: var(--green); }
.inv-row.is-done  { border-left-color: var(--green); }
.inv-row.is-dup   { border-left-color: var(--red); background: #fffafa; }
.inv-row.is-bad   { border-left-color: var(--amber); background: #fffcf6; }
.inv-row.is-scan  { border-left-color: var(--text-3); }

.inv-row-main { flex: 1; min-width: 0; }
.inv-row-t1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-no { font-size: 13.5px; font-weight: 600; word-break: break-all; }
.inv-row-t2 { font-size: 12.5px; color: var(--text-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.inv-row-t3 { font-size: 12px; color: var(--text-3); margin-top: 3px; word-break: break-all; }
.inv-row-msg {
  font-size: 12.5px; line-height: 1.6; margin-top: 7px;
  border-radius: var(--radius-sm); padding: 7px 9px;
  white-space: pre-wrap;
}
.inv-row-msg.red { background: var(--red-soft); color: #8f2119; border: 1px solid #f2c9c6; }
.inv-row-msg.amber { background: var(--amber-soft); color: #92560d; border: 1px solid #f0dcbb; }
.inv-row-msg.blue { background: var(--primary-soft); color: #134a9e; border: 1px solid #c5dcff; }

/* 扫到的二维码原文：单行截断，鼠标悬停看全文（title 里也带了完整值）。
   不换行是为了不让一串 60 多字符的原始串把整行撑高；要复制可以直接双击全选。 */
.inv-row-qr {
  margin-top: 7px; font-size: 12px; display: flex; align-items: baseline; gap: 8px;
  background: var(--surface-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 6px 9px;
}
.inv-row-qr-k { color: var(--text-3); flex: none; }
.inv-row-qr-v {
  font-family: Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: 11.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  user-select: all;
}

/* 手工录入表单里的「可选原件」选择器 */
.inv-manual-file {
  display: block; margin-top: 12px; font-size: 13px; color: var(--text-2);
}
.inv-manual-file > span { display: block; margin-bottom: 5px; }
.inv-manual-file input[type="file"] { font-size: 12.5px; max-width: 100%; }
.inv-row-ops { display: flex; flex-direction: column; gap: 5px; flex: none; }

.inv-bar {
  font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 10px;
  white-space: pre-wrap; line-height: 1.65;
}
.inv-bar.warn { background: var(--amber-soft); border-color: #f0dcbb; color: #92560d; }
.inv-bar b { font-variant-numeric: tabular-nums; }

/* ---------- 加油记录录入：手动 / 按发票 双模式（v2.7.0） ---------- */
/* 模式切换：两个并排的按钮，选中态用主色底 + 白字，与 .btn-primary 一致 */
.fuel-mode {
  display: inline-flex; gap: 0; margin-bottom: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2);
}
.fuel-mode-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--text-2);
  padding: 7px 16px; transition: background .12s, color .12s;
}
.fuel-mode-btn + .fuel-mode-btn { border-left: 1px solid var(--border-strong); }
.fuel-mode-btn:hover { background: var(--surface-3); color: var(--text); }
.fuel-mode-btn.is-on,
.fuel-mode-btn.is-on:hover { background: var(--primary); color: #fff; }

/* 发票模式顶部的口径说明：把「为什么只填升数」「尾差从哪来」讲清楚 */
.fuel-inv-hint {
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 12px;
}
.fuel-inv-hint b { color: var(--text); }

/* 票面金额是识别出来的只读值 —— 视觉上要能看出「不可改」，但别淡到看不清 */
input[readonly][data-inv-amount] {
  background: var(--surface-2); color: var(--text); cursor: default;
}

@media (max-width: 560px) {
  .inv-row { flex-direction: column; }
  .inv-row-ops { flex-direction: row; flex-wrap: wrap; width: 100%; }
}
