/* HOYA 企網銀 — 設計系統（HOYA BIT 公版色） */
:root {
  --brand: #FE6C30; --brand-hover: #E85A1F; --brand-soft: #FFF1EA; --brand-line: #FFD3BF;
  --brand-strong: #C2410C; --brand-strong-hover: #9A3412; --brand-on-dark: #FE6C30; --brand-rgb: 254,108,48;
  --ink: #1F1F1F; --ink-2: #2D2926; --text: #555555; --muted: #6B6B6B; --steel: #5C6B7A;
  --bg: #F7F7F7; --surface: #FFFFFF; --gray: #F2F2F2; --line: #E2E2E2;
  --ok: #3C8E5C; --ok-soft: #EAF5EE; --danger: #C0392B; --danger-soft: #FCECEA; --warn: #D89400; --warn-soft: #FFF6DD;
  --radius: 10px; --shadow: 0 1px 2px rgba(31,31,31,.06), 0 4px 16px rgba(31,31,31,.05);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.6; }
.num, td.num, .amount { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
a { color: var(--brand-strong); }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; border-radius: 4px; }

/* ---------- 版面 ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side); background: var(--ink); color: #D9D9D9; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 20px 20px 16px; font-size: 18px; font-weight: 800; letter-spacing: .5px; color: #fff; border-bottom: 1px solid #333; }
.side .logo b { color: var(--brand); } .side .logo small { display: block; font-size: 11px; color: #9A9A9A; font-weight: 400; letter-spacing: 0; margin-top: 2px; }
.nav { padding: 10px 0; flex: 1; }
.nav .grp { padding: 14px 20px 6px; font-size: 11px; color: #8A8A8A; letter-spacing: 1px; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 20px; color: #D9D9D9; text-decoration: none; border-left: 3px solid transparent; font-size: 14px; }
.nav a:hover { background: #2A2A2A; color: #fff; }
.nav a.on { background: #2D2926; color: #fff; border-left-color: var(--brand); font-weight: 600; }
.nav .badge { background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; min-width: 20px; text-align: center; line-height: 18px; }
.side .foot { padding: 14px 20px; font-size: 11px; color: #7A7A7A; border-top: 1px solid #333; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar .ent { font-weight: 700; } .topbar .ent span { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 13px; }
.topbar .tools { display: flex; align-items: center; gap: 14px; }
.bell { position: relative; background: none; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 36px; cursor: pointer; color: var(--ink); font-size: 16px; }
.bell .dot { position: absolute; top: -6px; right: -6px; background: var(--brand); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; line-height: 16px; min-width: 16px; }
.who { text-align: right; line-height: 1.3; } .who b { display: block; font-size: 13px; } .who span { font-size: 12px; color: var(--muted); }
.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.btn.menu-btn { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }

/* ---------- 卡片與格線 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card .card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.card .card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-left: 4px solid var(--brand); }
.kpi .label { color: var(--muted); font-size: 12.5px; } .kpi .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; } .kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.ok { border-left-color: var(--ok); } .kpi.warn { border-left-color: var(--warn); } .kpi.danger { border-left-color: var(--danger); } .kpi.steel { border-left-color: var(--steel); }
.kpi.clickable { cursor: pointer; } .kpi.clickable:hover { border-color: var(--brand-line); }

/* 帳戶卡 */
.acct { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.acct-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.acct-head b { font-size: 15px; } .acct-head span { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.bal-row { display: grid; grid-template-columns: 70px 1fr 1fr; padding: 10px 18px; border-bottom: 1px solid var(--gray); align-items: baseline; }
.bal-row:last-child { border-bottom: 0; }
.bal-row .asset { font-weight: 700; } .bal-row .v { text-align: right; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; } .bal-row .h { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: #FAFAFA; white-space: nowrap; }
tbody tr:hover { background: #FCFCFC; }
tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; }
td .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.guide { font-size: 12.5px; color: var(--danger); margin: -4px 0 6px 16px; }

/* ---------- 表單 ---------- */
label { display: block; font-size: 12.5px; color: var(--text); margin: 12px 0 5px; font-weight: 500; }
label .req { color: var(--danger); margin-left: 2px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #8C8C8C; border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; }
textarea { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-strong); box-shadow: 0 0 0 3px var(--brand-line); }
input.invalid, select.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.checks { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.checks label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 13.5px; }
.checks input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 14px; cursor: pointer; font-size: 13.5px; color: var(--text); font-family: inherit; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- 按鈕 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand-strong); color: #fff; border: 1px solid var(--brand-strong); padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-strong-hover); border-color: var(--brand-strong-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #CFCFCF; } .btn.secondary:hover { background: var(--gray); }
.btn.ghost { background: transparent; color: var(--brand-strong); border-color: transparent; padding: 6px 8px; } .btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); border-color: var(--danger); } .btn.danger:hover { background: #A93226; }
.btn.ok { background: var(--ok); border-color: var(--ok); } .btn.ok:hover { background: #327A4E; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }

/* ---------- 狀態 ---------- */
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray); color: var(--steel); }
.pill.pending_check, .pill.pending_release, .pill.pending, .pill.cooling, .pill.pending_kyb, .pill.scheduled { background: var(--warn-soft); color: #8A5F00; }
.pill.pending_payout, .pill.broadcasting, .pill.approved { background: #EEF2F6; color: var(--steel); }
.pill.completed, .pill.active, .pill.credited, .pill.filled { background: var(--ok-soft); color: var(--ok); }
.pill.rejected, .pill.failed, .pill.cancelled, .pill.frozen, .pill.locked, .pill.disabled, .pill.held_risk, .pill.revoked { background: var(--danger-soft); color: var(--danger); }
.banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; border: 1px solid; }
.banner b { white-space: nowrap; }
.banner.warn { background: var(--warn-soft); border-color: #F2D488; color: #6B4A00; }
.banner.danger { background: var(--danger-soft); border-color: #F0B8B1; color: #7E2318; }
.banner.info { background: #EEF2F6; border-color: #D3DCE5; color: #34404C; }
.banner.ok { background: var(--ok-soft); border-color: #BFDCC9; color: #24563A; }

/* 步驟條：建單 → 覆核 → 放行 → 撥付 */
.steps { display: flex; gap: 0; margin: 8px 0 4px; flex-wrap: nowrap; }
.step { flex: 1 1 0; min-width: 64px; position: relative; padding-top: 22px; text-align: center; font-size: 12px; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 3px; background: var(--line); }
.step:first-child::before { left: 50%; } .step:last-child::before { right: 50%; }
.step .dot { position: absolute; top: 2px; left: 50%; margin-left: -8px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; }
.step.done { color: var(--ok); } .step.done::before { background: var(--ok); } .step.done .dot { border-color: var(--ok); background: var(--ok); }
.step.cur { color: var(--brand-strong); font-weight: 700; } .step.cur .dot { border-color: var(--brand-strong); }
.step.bad { color: var(--danger); } .step.bad .dot { border-color: var(--danger); background: var(--danger); }
.steps.mini .step { min-width: 0; font-size: 0; padding-top: 14px; }
.steps.mini .step::before { top: 5px; height: 2px; } .steps.mini .step .dot { width: 10px; height: 10px; margin-left: -5px; border-width: 2px; top: 1px; }

/* 時間線 */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--steel); }
.timeline li.create::before { background: var(--ink); } .timeline li.check::before, .timeline li.release::before { background: var(--ok); } .timeline li.reject::before, .timeline li.cancel::before { background: var(--danger); }
.timeline .t { font-size: 12px; color: var(--muted); }

/* 描述列表 */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; word-break: break-all; }

/* ---------- 登入頁 ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; width: 640px; height: 640px; border-radius: 50%; right: -260px; bottom: -300px; border: 70px solid rgba(var(--brand-rgb),.16); }
.auth-art .logo { font-size: 24px; font-weight: 800; } .auth-art .logo b { color: var(--brand-on-dark); }
.auth-art h1 { font-size: 34px; line-height: 1.35; margin: 0 0 14px; } .auth-art h1 em { font-style: normal; color: var(--brand-on-dark); }
.auth-art ul { padding: 0; list-style: none; color: #CFCFCF; margin: 0; } .auth-art li { padding: 6px 0 6px 22px; position: relative; } .auth-art li::before { content: ""; position: absolute; left: 0; top: 14px; width: 10px; height: 3px; background: var(--brand-on-dark); }
.auth-art .fine { font-size: 12px; color: #8A8A8A; position: relative; z-index: 1; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { margin-bottom: 6px; } .auth-box .sub { color: var(--muted); margin-bottom: 18px; }
.auth-box .alt { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }
.otp { font-size: 22px; letter-spacing: 8px; text-align: center; font-family: var(--mono); }
.qr { display: flex; gap: 16px; align-items: center; margin: 10px 0; }
.qr img { width: 168px; height: 168px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; background: var(--gray); padding: 16px; border-radius: 8px; font-family: var(--mono); font-size: 15px; text-align: center; }
.secret-box { background: var(--ink); color: #fff; font-family: var(--mono); padding: 12px 14px; border-radius: 8px; word-break: break-all; }
.addr-box { background: var(--gray); border: 1px dashed #C9C9C9; border-radius: 8px; padding: 14px; font-family: var(--mono); font-size: 14px; word-break: break-all; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- 兌換 ---------- */
.fx-quote { border: 2px solid var(--brand); border-radius: var(--radius); padding: 18px; background: var(--brand-soft); }
.fx-quote .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown { font-size: 13px; color: var(--brand-strong); font-weight: 700; }
.countdown.expired { color: var(--danger); }
.bar { height: 6px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--brand); transition: width 1s linear; }
.w0 { width: 0; } .w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w100 { width: 100%; }

/* ---------- modal、toast、抽屜 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,20,20,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 14px 22px 4px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.x { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; font-size: 13.5px; border-left: 4px solid var(--ok); }
.toast.err { border-left-color: var(--danger); }
.drawer { position: fixed; top: 60px; right: 16px; width: 360px; max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.15); z-index: 50; }
.drawer .item { padding: 12px 16px; border-bottom: 1px solid var(--gray); cursor: pointer; }
.drawer .item.unread { background: var(--brand-soft); }
.drawer .item b { display: block; font-size: 13.5px; } .drawer .item span { font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-size: 14px; color: var(--text); border-bottom: 3px solid transparent; font-family: inherit; }
.tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.toolbar > div { min-width: 140px; }
.toolbar label { margin-top: 0; }
.spinner { text-align: center; padding: 40px; color: var(--muted); }

/* ---------- 響應式 ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .side { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  th, td { white-space: nowrap; } td.mono { white-space: normal; min-width: 220px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px 14px; } .kpi .value { font-size: 19px; }
  .steps { flex-wrap: nowrap; } .step { min-width: 0; font-size: 11px; }
  .topbar .ent span { display: none; }
  .page-head > div:last-child { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
  .content { padding: 16px; } .topbar { padding: 0 16px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .who { display: none; } .drawer { left: 8px; right: 8px; width: auto; }
  .dl { grid-template-columns: 110px 1fr; }
}
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ---------- 後台共用元件 ---------- */
.side .logo .bank-mark { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--bank, var(--brand)); margin-right: 8px; vertical-align: 2px; }
.side .logo .bank-name { color: #fff; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager .btns { display: flex; gap: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart .in { fill: var(--brand); } .chart .out { fill: var(--steel); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 3; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .in { background: var(--brand); } .legend .out { background: var(--steel); }
.meter { width: 100%; height: 10px; display: block; }
.meter .bg { fill: var(--gray); } .meter .fg { fill: var(--ok); } .meter .fg.low { fill: var(--danger); } .meter .mk { fill: var(--ink); }
.stat-list { display: grid; gap: 8px; } .stat-list div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 6px; font-size: 13.5px; }
.stat-list div:last-child { border-bottom: 0; } .stat-list b { font-variant-numeric: tabular-nums; }
.param-group { margin-bottom: 18px; } .param-group h3 { color: var(--steel); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.param { display: grid; grid-template-columns: 1fr 150px 120px; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--gray); align-items: center; }
.param .n b { display: block; } .param .n span { font-size: 12.5px; color: var(--muted); }
.param .v { text-align: right; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; } .param .v small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.param .a { text-align: right; }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--gray); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.copybox span { flex: 1; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.status-dot.ok { background: var(--ok); } .status-dot.bad { background: var(--danger); } .status-dot.warn { background: var(--warn); } .status-dot.neutral { background: var(--muted, #8A8F98); }
.people-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr 36px; gap: 8px; align-items: end; }
.people-row label { margin-top: 6px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--line); background: var(--sw, #ccc); }
@media (max-width: 860px) { .param { grid-template-columns: 1fr; } .param .v, .param .a { text-align: left; } .people-row { grid-template-columns: 1fr; } }
.text-danger { color: var(--danger); font-weight: 700; }
.print-head { display: none; }
@media print {
  .side, .topbar, .toolbar, .page-head div:last-child, .toasts, .pager .btns { display: none !important; }
  .content { padding: 0; max-width: none; } .card { box-shadow: none; border: 0; padding: 0; } .print-head { display: block; margin-bottom: 12px; }
  body { background: #fff; }
}

/* UX-08 間距、UX-09 鈴鐺圖示 */
.auth-box form .btn.block { margin-top: 16px; }
.bell svg { width: 16px; height: 16px; vertical-align: middle; }
.side .logo b { color: var(--brand-on-dark); }
.addr b { font-weight: 800; color: var(--ink); }
.dl.confirm dd { font-variant-numeric: tabular-nums; }
.badge.danger { background: var(--danger) !important; } .badge.warn { background: var(--warn) !important; color: #1F1F1F !important; }
.text-ok { color: var(--ok); font-weight: 700; }
tr.row-bad td { background: var(--danger-soft); }
.thread { list-style: none; padding: 0; margin: 0; }
.thread li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.thread li.bank { border-left: 3px solid var(--brand-strong); }
.thread li.client { border-left: 3px solid var(--steel); }
.thread li.internal { background: var(--warn-soft); border-style: dashed; }
.thread .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.thread .body { white-space: pre-wrap; word-break: break-word; }
.thread .files { margin-top: 6px; font-size: 12.5px; }
.print-page .content { max-width: 1000px; margin: 0 auto; }
@media print { .no-print { display: none !important; } }

/* 全域搜尋 */
.gsearch { position: relative; width: 340px; max-width: 40vw; }
.gsearch input { padding: 7px 10px; }
.gs-results { position: absolute; top: 40px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 420px; overflow-y: auto; z-index: 50; }
.gs-results a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.gs-results a:hover, .gs-results a:focus { background: var(--brand-soft); outline: none; }
.gs-results .k { display: inline-block; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 6px; }
.gs-results .s { display: block; font-size: 12px; color: var(--muted); word-break: break-all; }
.gs-results .none { padding: 12px; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .gsearch { display: none; } }
/* 主行動卡、側欄收合、受款人選擇、品牌色預覽 */
.kpi.primary { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.kpi.primary .label, .kpi.primary .sub { color: rgba(255,255,255,.88); }
.kpi.primary.clickable:hover { border-color: var(--brand-strong-hover); background: var(--brand-strong-hover); }
.nav .grp { cursor: pointer; user-select: none; display: flex; justify-content: space-between; }
.nav .grp::after { content: '▾'; font-size: 10px; } .nav .grp.closed::after { content: '▸'; }
.nav a.collapsed { display: none; }
.picker { border: 1px solid var(--line); border-radius: 8px; max-height: 260px; overflow-y: auto; margin-top: 6px; }
.picker button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; cursor: pointer; font-family: inherit; font-size: 13.5px; color: var(--ink); }
.picker button:hover, .picker button:focus, .picker button.on { background: var(--brand-soft); outline: none; }
.picker .grp-t { padding: 6px 12px; font-size: 11px; color: var(--muted); background: var(--gray); }
.picker small { display: block; color: var(--muted); font-size: 12px; }
.payee-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 8px; background: var(--gray); }
.brand-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.brand-preview .dark { background: #1F1F1F; color: #fff; border-radius: 8px; padding: 14px; font-weight: 800; font-size: 18px; }
.brand-preview .light { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.risk-hi { color: var(--danger); font-weight: 800; } .risk-mid { color: #8A5A00; font-weight: 700; }
.policy-amt { max-width: 200px; }
input[type=color] { width: 56px; min-width: 56px; height: 40px; padding: 2px; cursor: pointer; }
.row:has(> input[type=color]) { grid-template-columns: 56px 1fr; }

.steps { overflow-x: auto; }
@media (max-width: 860px) { td.mono, .mono { word-break: break-all; } td .pill { white-space: nowrap; } }
.text-warn { color: #8A5A00; }
/* R2-09：手機 390 不破版——格線子項可縮小，長字串換行，表單單欄 */
.grid > *, .row > * { min-width: 0; }
@media (max-width: 600px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .stat-list > div { flex-wrap: wrap; gap: 4px 12px; }
  .stat-list b, .stat-list .mono { word-break: break-all; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .card { overflow-wrap: anywhere; }
}
