:root {
  --green: #07c160;
  --blue: #10aeff;
  --ink: #1a1a1a;
  --sub: #888;
  --line: #ececec;
  --bg: #f5f6f8;
  --card: #fff;
  --danger: #ee4d2d;
  --warn: #ff976a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; border: none; border-radius: 8px; }
input, select { font-family: inherit; font-size: 15px; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #e8f9ef 0%, #eaf4ff 100%); }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 16px; padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.08); }
.brand { text-align: center; margin-bottom: 18px; }
.brand-logo { width: 52px; height: 52px; border-radius: 14px; background: var(--green); color: #fff;
  font-size: 26px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.brand h1 { font-size: 21px; margin: 0; }
.brand-sub { color: var(--sub); font-size: 12px; margin: 6px 0 0; }
.tabs { display: flex; background: #f0f1f3; border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; background: transparent; padding: 9px; color: var(--sub); font-weight: 600; }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
form label { display: block; font-size: 13px; color: #555; margin-bottom: 12px; }
form label input, form label select { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 9px; outline: none; transition: border .15s; }
form label input:focus { border-color: var(--green); }
.primary { background: var(--green); color: #fff; width: 100%; padding: 12px; font-weight: 600; font-size: 15px; }
.primary:disabled { opacity: .55; }
.primary.sm { width: auto; padding: 7px 14px; font-size: 13px; }
.submit { margin-top: 6px; }
.form-err { color: var(--danger); font-size: 13px; margin: -4px 0 10px; min-height: 16px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.side-brand { padding: 20px 18px; font-weight: 700; font-size: 17px; color: var(--green); border-bottom: 1px solid var(--line); }
.sidebar nav { flex: 1; padding: 10px; }
.sidebar nav button { display: flex; align-items: center; width: 100%; text-align: left; background: transparent;
  padding: 12px 14px; color: #444; font-size: 15px; border-radius: 9px; margin-bottom: 4px; }
.sidebar nav button.active { background: #eafaf1; color: var(--green); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 10px; }
.side-foot { padding: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.who-name { font-weight: 600; font-size: 14px; }
.who-role { color: var(--sub); font-size: 12px; }
.logout { background: #f0f1f3; color: #555; padding: 7px 12px; font-size: 13px; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px; font-weight: 600; position: sticky; top: 0; z-index: 5; }
.view { padding: 20px; max-width: 920px; width: 100%; margin: 0 auto; }
.card { background: var(--card); border-radius: 14px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.card h2 { font-size: 17px; margin: 0 0 16px; }
.card h2.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card h2.section-title .head-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.card h2.section-title .head-sum { color: var(--green); font-weight: 700; }

/* ---------- 上传 ---------- */
.upload-row { display: flex; }
.upload-box { width: 160px; height: 200px; border: 2px dashed #cfd3d8; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: #fafbfc; }
.upload-box.filled { border-style: solid; border-color: var(--green); }
.upload-box.dragging { border-color: var(--green); background: #eafff0; box-shadow: 0 0 0 3px rgba(7,193,96,.18); }
.upload-box .preview, .upload-box .upload-tip { pointer-events: none; }
.upload-box .drag-hint { margin-top: 8px; font-size: 12px; color: #8a9099; }
.upload-box .plus { font-size: 34px; color: #b8bdc4; }
.upload-tip { text-align: center; color: var(--sub); font-size: 13px; line-height: 1.6; }
.preview { width: 100%; height: 100%; object-fit: contain; }
.ocr-btn { margin-top: 14px; width: auto; padding: 10px 18px; }
.ocr-raw { margin-top: 14px; background: #f7f8fa; border-radius: 8px; padding: 10px 12px; }
.ocr-raw .tag { font-size: 12px; color: var(--sub); }
.ocr-raw pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; margin: 6px 0 0; max-height: 140px; overflow: auto; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.fields label { display: block; font-size: 13px; color: #555; }
.fields input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.fields input:focus { border-color: var(--green); }
.fields input.locked { color: #07c160; background: #f5fbf7; border-color: #b8e6cb; cursor: not-allowed; }
.pay-date-label { position: relative; }
.lock-tip { display: block; font-size: 12px; color: #07c160; margin-top: 4px; }
.tbl select { max-width: 160px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; }
.approver-sel { min-width: 130px; }
.input-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--sub); }
.input-hint strong { color: #333; }

/* ---------- 汇总 / 列表 ---------- */
.summary { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sum-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.sum-row:last-child { border-bottom: none; }
.sum-date { width: 110px; background: #fafbfc; padding: 12px; font-weight: 600; font-size: 13px; display: flex; align-items: center; }
.sum-items { flex: 1; padding: 6px 12px; }
.sum-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #f0f0f0; }
.sum-item:last-child { border-bottom: none; }
.ci-content { flex: 1; }
.ci-amount { color: var(--green); font-weight: 600; }
.sum-total { width: 110px; padding: 12px; text-align: right; color: var(--green); font-weight: 700; display: flex; align-items: center; justify-content: flex-end; }
.sum-grand { padding: 12px; text-align: right; font-weight: 700; background: #fafbfc; }

/* 财务端已汇款：员工 -> 日期 二级分组 */
.emp-summary { border: none; background: transparent; }
.emp-group { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; background: #fff; }
.emp-head { display: flex; justify-content: space-between; width: 100%; padding: 13px 14px; background: #f8f9fa; font-size: 15px; font-weight: 600; border-radius: 0; }
.emp-sum { color: var(--green); }
.emp-body { padding: 10px 14px 14px; }
.date-group { margin-bottom: 10px; }
.date-group:last-child { margin-bottom: 0; }
.date-head { display: flex; justify-content: space-between; width: 100%; font-size: 13px; font-weight: 600; color: #555; padding: 8px 0 6px; border: none; border-bottom: 1px dashed var(--line); background: transparent; cursor: pointer; }
.date-head:hover { color: var(--green); }
.date-sum { color: var(--green); }
.date-items { padding: 4px 0; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.thumb { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; cursor: pointer; flex-shrink: 0; background: #f0f1f3; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; }
.li-sub { color: var(--sub); font-size: 12px; margin-top: 3px; }
.status { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #eee; color: #666; }
.status.submitted { background: #fff3e0; color: #e08600; }
.status.approved { background: #e6f4ff; color: #1989fa; }
.status.paid { background: #e8f9ef; color: #07c160; }
.status.rejected { background: #fde8e8; color: #e54d42; }

.collapse { margin-top: 18px; }
.collapse-head { width: 100%; text-align: left; background: #f7f8fa; padding: 12px 14px; font-weight: 600; color: #444; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.head-sum { margin-left: auto; color: var(--green); font-weight: 700; white-space: nowrap; }
.collapse-body { padding: 12px 4px 0; }
.subcollapse { margin: 10px 0 0 16px; border-left: 2px solid #eef0f3; padding-left: 10px; }
.collapse-head.sub { background: #fbfcfd; padding: 9px 12px; font-size: 14px; color: #555; }
.subcollapse-body { padding: 10px 2px 0; }

.empty { color: var(--sub); text-align: center; padding: 30px 0; font-size: 14px; }

/* ---------- 表格 / 凭证 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--sub); font-weight: 600; font-size: 13px; }
.role-pill { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #eee; color: #555; }
.role-pill.employee { background: #f0f1f3; }
.role-pill.approver { background: #fff3e0; color: #e08600; }
.role-pill.finance { background: #e6f4ff; color: #1989fa; }
.role-pill.admin { background: #f3e8fb; color: #9c27b0; }
.tbl select { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; }

.voucher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 10px; }
.voucher-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.voucher-card img { width: 100%; height: 120px; object-fit: cover; cursor: pointer; }
.vc-info { padding: 8px 10px; font-size: 13px; flex: 1; }
.vc-sub { color: var(--sub); font-size: 11px; margin-top: 3px; }
.danger { background: var(--danger); color: #fff; }
.danger.sm { width: 100%; padding: 7px; font-size: 13px; border-radius: 0; }

/* 管理员凭证管理：按员工分类 */
.admin-voucher-summary { color: var(--sub); font-size: 13px; margin: -8px 0 14px; }
.admin-emp-list { display: flex; flex-direction: column; gap: 12px; }
.admin-emp-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; position: relative; }
.admin-emp-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: #f8f9fa; font-size: 15px; text-align: left; }
.admin-emp-head:hover { background: #f0f2f5; }
.admin-emp-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.admin-emp-title small { color: var(--sub); font-weight: 400; font-size: 13px; }
.fold-icon { color: var(--sub); font-size: 13px; width: 14px; display: inline-block; }
.admin-emp-meta { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.admin-emp-count { color: var(--sub); font-size: 13px; }
.admin-emp-sum { color: var(--green); font-weight: 700; }
.admin-emp-actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fff; }
.admin-emp-actions .primary.sm, .admin-emp-actions .danger.sm { width: auto; border-radius: 8px; padding: 7px 12px; font-size: 13px; }
.admin-emp-body { padding: 12px 14px 14px; }
.link-danger { background: none; border: none; color: #e54d42; cursor: pointer; font-size: 13px; padding: 2px 6px; }
.link-danger.sm { font-size: 13px; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }

/* 审批拒绝理由 */
.reject-reason { margin-top: 6px; padding: 8px 10px; background: #fff5f5; border: 1rpx solid #f9d6d6; border-radius: 8px; color: #e54d42; font-size: 13px; line-height: 1.5; }
.list-item.rejected { background: #fffafa; }
.act-btns { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.reject-btn { width: auto; padding: 7px 14px; font-size: 13px; border-radius: 8px; }

/* ---------- 我的信息 ---------- */
.profile-tip { color: var(--sub); font-size: 13px; margin: -8px 0 16px; }
.profile-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.profile-photo { display: flex; flex-direction: column; }
.pp-label { font-size: 13px; color: #555; margin-bottom: 8px; }
.profile-photo .upload-box { width: 100%; height: 180px; }
.ocr-status { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 13px; color: var(--green); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(7,193,96,.3); border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹层 / 提示 ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* 财务汇款弹窗 */
.remit-modal { align-items: flex-start; overflow-y: auto; }
.remit-card { background: var(--card); border-radius: 14px; width: 100%; max-width: 560px; margin: auto; box-shadow: 0 16px 48px rgba(0,0,0,.18); overflow: hidden; }
.remit-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.remit-head h3 { margin: 0; font-size: 17px; }
.icon-close { width: 34px; height: 34px; border-radius: 50%; background: #f2f2f2; color: #666; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.remit-body { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
.remit-loading { text-align: center; color: var(--sub); padding: 30px 0; }
.remit-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.remit-row:last-child { border-bottom: none; }
.remit-label { color: #666; }
.remit-value { font-weight: 600; color: var(--ink); word-break: break-all; max-width: 60%; text-align: right; }
.remit-value.amount { color: var(--green); font-size: 16px; }
.remit-item { margin-top: 12px; padding: 10px 12px; background: #f8f9fa; border-radius: 8px; font-size: 13px; color: #555; }
.remit-photos { display: flex; gap: 10px; margin-top: 12px; }
.remit-photos img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); }
.remit-photos.small img { width: 90px; height: 60px; }
.remit-group { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.remit-group-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 10px; }
.remit-group-sum { color: var(--green); }
.remit-items { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: #555; }
.remit-items li { margin-bottom: 4px; }
.remit-foot { display: flex; gap: 12px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.remit-foot button { flex: 1; }
.remit-foot .secondary { background: #f2f2f2; color: #444; padding: 11px; font-weight: 600; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff;
  padding: 10px 18px; border-radius: 22px; font-size: 14px; z-index: 60; }

/* ---------- 响应式（手机端） ---------- */
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side-brand { border-bottom: none; border-right: 1px solid var(--line); padding: 14px 16px; white-space: nowrap; }
  .sidebar nav { display: flex; padding: 8px; }
  .sidebar nav button { margin-bottom: 0; margin-right: 6px; white-space: nowrap; }
  .dot { display: none; }
  .side-foot { display: none; }
  .fields { grid-template-columns: 1fr; }
  .view { padding: 14px; }
  .sum-date, .sum-total { width: 84px; font-size: 12px; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .profile-photos { grid-template-columns: 1fr; }
}
