:root {
  --brand: #0a6e3f;
  --brand-d: #07522f;
  --bg: #f4f6f5;
  --card: #fff;
  --line: #e3e8e5;
  --text: #1c2a22;
  --muted: #6b7a71;
  --warn: #c07a00;
  --err: #c0392b;
  --ok: #0a6e3f;
}
* { 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", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
h1 { font-size: 22px; margin: 0 0 4px; }
h3 { margin: 12px 0 10px; font-size: 16px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.fr { font-size: 11px; color: var(--muted); font-weight: normal; }
.hint { color: var(--muted); font-size: 12px; }
.notice { background: #fff8e1; border: 1px solid #ffe082; color: #6d4c00; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin: 10px 0; }
.err { color: var(--err); font-size: 13px; min-height: 18px; }

.view { max-width: 560px; margin: 0 auto; }
.login-box { padding: 40px 24px; text-align: center; }
.login-box input {
  display: block; width: 100%; margin: 0 0 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 16px; background: #fff;
}
input, select, textarea {
  width: 100%; padding: 11px 12px; margin: 4px 0 12px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 15px; background: #fff;
  font-family: inherit; color: var(--text);
}
label { font-size: 13px; color: var(--muted); font-weight: 600; }
textarea { resize: vertical; }

.btn {
  display: inline-block; border: none; border-radius: 10px; padding: 12px 18px;
  font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-d); }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); width: auto; }
.btn.sm { padding: 7px 12px; font-size: 13px; width: auto; }
.btn:disabled { opacity: .5; }

.topbar { background: var(--brand); color: #fff; }
.topbar-inner { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.brand { font-weight: 700; font-size: 16px; }
.me { font-size: 12px; opacity: .9; }

.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; max-width: 560px; margin: 0 auto; }
.tab { flex: 1; border: none; background: none; padding: 10px 2px; font-size: 13px; cursor: pointer; color: var(--muted); font-weight: 600; line-height: 1.3; }
.tab.active { color: var(--brand); border-bottom: 2px solid var(--brand); }

.content { padding: 14px 16px 40px; }
.panel { background: var(--card); border-radius: 12px; padding: 14px; }
.filter-bar { margin-bottom: 12px; }
.filter-bar select { margin: 0; }

.list { display: flex; flex-direction: column; gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: #fff; }
.card .row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card .title { font-weight: 700; font-size: 15px; }
.card .amount { font-weight: 700; color: var(--brand); white-space: nowrap; }
.card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card .status { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-top: 6px; font-weight: 600; }
.st-pending { background: #fff3e0; color: var(--warn); }
.st-approved { background: #e3f3ea; color: var(--ok); }
.st-rejected { background: #fdeaea; color: var(--err); }
.st-executed { background: #e8f0fe; color: #1a56c9; }
.st-draft { background: #eee; color: var(--muted); }
.card .actions { margin-top: 10px; display: flex; gap: 8px; }
.card .actions .btn { width: auto; padding: 8px 14px; font-size: 14px; }

.seg { display: flex; background: #eef1ef; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg-btn { flex: 1; border: none; background: none; padding: 9px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg-btn.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.plan-item { display: flex; gap: 6px; margin-bottom: 6px; }
.plan-item input { margin: 0; }
.plan-item .p-name { flex: 2; }
.plan-item .p-amount { flex: 1; }
.plan-item .p-del { width: 34px; padding: 0; border: none; background: #fdeaea; color: var(--err); border-radius: 8px; cursor: pointer; font-size: 16px; }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sum-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sum-card .k { font-size: 12px; color: var(--muted); }
.sum-card .v { font-size: 17px; font-weight: 700; color: var(--brand); }

.detail-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
.detail-sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; padding: 18px 18px 28px; max-height: 88vh; overflow-y: auto; }
.approval-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.approval-row .who { color: var(--muted); }
.approval-row .act { font-weight: 600; }
.act-approve { color: var(--ok); }
.act-reject { color: var(--err); }
.act-resubmit { color: #1a56c9; }

/* 审批流进度条 */
.flowbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 8px 0 4px; }
.fstep { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #eef1ef; color: #9aa7a0; white-space: nowrap; }
.fstep small { font-weight: normal; font-size: 10px; }
.f-done { background: #e3f3ea; color: var(--ok); font-weight: 600; }
.f-current { background: #fff3e0; color: var(--warn); font-weight: 700; }
.f-reject { background: #fdeaea; color: var(--err); font-weight: 700; }
.f-todo { background: #f0f2f1; color: #b0bab4; }
.farrow { color: #c3ccc7; font-size: 11px; padding: 0 2px; }

/* 详情里的竖向流程链 */
.flowchain { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 12px; }
.flowchain .fstep { text-align: center; padding: 5px 8px; font-size: 12px; }
.flowchain .farrow { text-align: center; padding: 0; line-height: 1; }

/* 计划明细表 */
.items-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.it-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--line); }
.it-row:last-child { border-bottom: none; }
.it-amt { font-weight: 600; color: var(--brand); white-space: nowrap; }

/* 勾选框 */
label.chk { display: flex; align-items: center; gap: 6px; font-weight: normal; color: var(--text); margin: 4px 0 12px; }
label.chk input { width: auto; margin: 0; }
