/* 瑞安催收：深綠＋米白＋暗金，字放大（老花友善） */
:root {
  --green: #1B5E3F; --green-l: #E3F1E8;
  --cream: #F8F5EC; --gold: #B8860B; --gold-l: #F7EED6;
  --red: #B0382C; --red-l: #F6D5D1;
  --text: #1a1a1a; --muted: #6b6b6b; --line: #e6e1d3;
  --s1: #8A4B2E; --s2: #2E7D5B; --s3: #B8860B; --s4: #1B3A5E; --s5: #B0382C;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--cream); color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-size: 18px; line-height: 1.6; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 110px; }
.wrap.wide { max-width: 1180px; }
.top { position: sticky; top: 0; z-index: 10; background: var(--green); color: #fff;
  display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.who { font-size: 15px; opacity: .9; text-align: right; }
.who button { margin-left: 8px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 8px; font-size: 14px; padding: 2px 8px; cursor: pointer; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; text-align: center; padding: 10px 0 12px; color: var(--muted); text-decoration: none; font-size: 16px; font-weight: 600; }
.tabs a .i { display: block; font-size: 22px; line-height: 1.2; }
.tabs a.on { color: var(--green); }

h1 { font-size: 24px; color: var(--green); margin: 8px 0 4px; }
h2 { font-size: 20px; color: var(--green); margin: 22px 0 10px; }
.sub { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 15px; text-align: center; padding: 12px 0; }
.card { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card.warn { background: var(--red-l); }
.card.gold { background: var(--gold-l); }

/* 案件列 */
.case { display: block; background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  color: inherit; text-decoration: none; border-left: 0; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.case.unrep { background: #FFF7F5; outline: 2px solid var(--red-l); }
.case .l1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.case .nm { font-size: 20px; font-weight: 700; }
.case .dd { font-size: 20px; font-weight: 700; color: var(--red); white-space: nowrap; }
.case .l2 { color: var(--muted); font-size: 15px; margin-top: 2px; }
.case .l3 { font-size: 15px; margin-top: 6px; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; color: #fff; border-radius: 999px; padding: 1px 10px; vertical-align: middle; white-space: nowrap; }
.b-D1-3 { background: var(--s1); } .b-D4-7 { background: var(--s2); } .b-D8-29 { background: var(--s3); }
.b-D30 { background: var(--s4); } .b-D45 { background: var(--s5); } .b-closed, .b-none { background: #999; }
.tag { display: inline-block; font-size: 13px; border-radius: 6px; padding: 0 6px; margin-right: 4px; background: var(--gold-l); color: #7a5a07; font-weight: 600; }
.tag.red { background: var(--red-l); color: var(--red); }
.tag.green { background: var(--green-l); color: var(--green); }

/* 篩選 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chip { flex: none; border: 2px solid var(--green); background: #fff; color: var(--green); border-radius: 999px; padding: 4px 14px; font-size: 16px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--green); color: #fff; }

/* 表單 */
label.f { display: block; font-size: 15px; color: var(--muted); margin: 10px 0 4px; }
.field, select.field, textarea.field { width: 100%; min-height: 52px; font-size: 19px; padding: 8px 12px; border: 2px solid #ddd; border-radius: 12px; background: #fff; font-family: inherit; }
textarea.field { min-height: 80px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.btn { display: block; width: 100%; min-height: 56px; border: none; border-radius: 14px; font-size: 20px; font-weight: 700; color: #fff; background: var(--green); cursor: pointer; margin-top: 14px; font-family: inherit; }
.btn.gold { background: var(--gold); } .btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--green); border: 2px solid var(--green); }
.btn:disabled { background: #bbb; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { flex: 1 1 calc(33% - 8px); min-height: 48px; font-size: 17px; font-weight: 600; border: 2px solid #ddd; background: #fff; border-radius: 12px; cursor: pointer; font-family: inherit; }
.seg button.on { border-color: var(--green); background: var(--green); color: #fff; }
.quick { min-height: 40px; font-size: 15px; font-weight: 700; border: 2px solid var(--green); background: #fff; color: var(--green); border-radius: 10px; padding: 0 12px; cursor: pointer; font-family: inherit; }

/* 案件頁 */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f0ece2; font-size: 17px; }
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--muted); flex: none; }
.kv span:last-child { text-align: right; word-break: break-all; }
.call { display: inline-block; background: var(--green); color: #fff; text-decoration: none; border-radius: 10px; padding: 2px 12px; font-weight: 700; }
.big { font-size: 30px; font-weight: 800; color: var(--red); }
.tl { border-left: 3px solid var(--line); margin-left: 6px; padding-left: 14px; }
.tl .it { position: relative; padding: 4px 0 12px; }
.tl .it::before { content: ""; position: absolute; left: -21px; top: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); }
.tl .it.pay::before { background: var(--gold); }
.tl .it.void { opacity: .45; text-decoration: line-through; }
.tl .h { font-size: 15px; color: var(--muted); }
.tl .b { font-size: 17px; }
.link { background: none; border: none; color: var(--red); font-size: 14px; cursor: pointer; padding: 0; text-decoration: underline; }

/* 儀表板 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: #fff; border-radius: 14px; padding: 12px 14px; }
.stat .n { font-size: 30px; font-weight: 800; color: var(--green); line-height: 1.2; }
.stat .t { font-size: 15px; color: var(--muted); }
.stat .x { font-size: 14px; color: var(--red); font-weight: 600; }
.tbl-wrap { overflow-x: auto; background: #fff; border-radius: 14px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 16px; min-width: 900px; }
.tbl th { background: var(--green); color: #fff; font-weight: 600; padding: 8px 10px; text-align: left; position: sticky; top: 0; white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f0ece2; vertical-align: top; }
.tbl tr.unrep td { background: #FFF1EE; }
.tbl a { color: var(--green); font-weight: 700; }
.num { text-align: right; white-space: nowrap; }

.linebox { white-space: pre-wrap; background: var(--green-l); border-radius: 12px; padding: 14px; font-size: 18px; line-height: 1.7; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 17px; z-index: 20; max-width: 90%; }
.login { max-width: 420px; margin: 40px auto; }
.login .logo { font-size: 34px; font-weight: 800; color: var(--green); text-align: center; margin-bottom: 4px; }
details summary { cursor: pointer; color: var(--muted); font-size: 15px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
