/* 北辰管理後台 */
.adm-main { padding: 24px 28px 48px; min-width: 0; }
.adm-main .card { margin-bottom: 16px; }
.adm-main h2 { font-size: 16px; margin: 0 0 12px; }
.adm-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.adm-more { font-size: 13px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.adm-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-kpi { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s; }
.adm-kpi:hover { border-color: var(--accent); }
.adm-kpi b { display: block; font-size: 26px; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.adm-kpi b .tag { font-size: 15px; padding: 3px 10px; }
.adm-kpi .adm-kpi-label { display: block; font-size: 13px; color: var(--muted); }
.adm-kpi b small { font-size: 14px; color: var(--muted); font-weight: 500; }
.adm-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adm-kpi.is-alert { border-color: color-mix(in srgb, var(--down) 55%, var(--line)); background: color-mix(in srgb, var(--down) 5%, var(--surface)); }
.adm-kpi.is-alert b { color: var(--down); }
.adm-kpi.is-up b { color: var(--up); }
.adm-sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.adm-main .adm-sec-head h2 { font-size: 18px; margin: 0; }
.adm-allclear { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--up) 10%, var(--surface)); color: var(--up); font-size: 14px; font-weight: 600; }
.adm-table.adm-money-table th, .adm-table.adm-money-table td { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table.adm-money-table th:first-child, .adm-table.adm-money-table tbody th { text-align: left; font-weight: 500; color: var(--ink); }
.adm-money-table .adm-total th, .adm-money-table .adm-total td { font-weight: 700; border-top: 2px solid var(--line); }
.adm-money-table .adm-subtotal th, .adm-money-table .adm-subtotal td { font-weight: 600; color: var(--muted, #9aa4b2); border-bottom: 1px solid var(--line); }
.adm-money-table .adm-minus th { padding-left: 1.4em; font-weight: 400; }
.adm-money-table td, .adm-money-table thead th { white-space: nowrap; }
.adm-money-table .adm-col-custom { background: var(--surface-2); }
.adm-money-range { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 12px; }
.adm-money-range label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.adm-money-range input[type="date"] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; }
.adm-grid + .adm-grid { margin-top: 16px; }
.adm-wd.has-open { border-color: color-mix(in srgb, var(--down) 45%, var(--line)); }
.adm-wd tr.is-open td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.adm-wd-acts { display: flex; gap: 6px; justify-content: flex-end; }
.adm-wd-acts .adm-btn { padding: 6px 12px; }
.adm-badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--down); color: #fff; font-size: 11px; font-weight: 700; text-align: center; vertical-align: 1px; box-sizing: border-box; }
.adm-money-charts { margin-bottom: 0; }
.adm-money-charts { margin-bottom: 16px; }
.adm-kpi em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.adm-grid { display: grid; gap: 16px; }
.adm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adm-grid .card { margin-bottom: 0; }
.adm-grid-2 + .card { margin-top: 16px; }
.adm-todo { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.adm-todo ul { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.adm-todo ul { margin-bottom: 0; }
.adm-todo li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border-left: 4px solid var(--accent); }
.adm-todo li.lv-bad { border-left-color: var(--down); }
.adm-todo li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-todo li .btn { white-space: nowrap; }
.adm-list { list-style: none; padding: 0; margin: 0; }
.adm-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-list li:last-child { border-bottom: 0; }
.adm-list li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-dl { display: grid; gap: 10px 24px; margin: 0; font-size: 14px; }
.adm-dl > div { display: flex; flex-direction: column; gap: 2px; }
.adm-dl dt { color: var(--muted); font-size: 13px; }
.adm-dl dd { margin: 0; overflow-wrap: anywhere; }
.adm-dl-cols { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.adm-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.adm-bars div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; }
.adm-bars div[data-zero] { background: var(--line); }
.adm-bars-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.adm-toolbar input { flex: 1; min-width: 200px; }
.adm-main input[type="search"], .adm-main input[type="email"], .adm-main select, .adm-inline input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; box-sizing: border-box; }
.adm-main .acct-field select { width: 100%; }
.adm-btn { margin-top: 0; display: inline-flex; align-items: center; text-decoration: none; padding: 8px 14px; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.adm-chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.adm-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1a1205; font-weight: 600; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th, .adm-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.adm-table th { color: var(--muted); font-weight: 500; }
.adm-table tbody tr:hover { background: var(--surface-2); }
.adm-table td.wrap-cell { white-space: normal; overflow-wrap: anywhere; min-width: 200px; }
.adm-table select { padding: 4px 8px; }
.adm-pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.adm-gate { padding: 32px 20px; }
.adm-gate h2 { text-align: center; }
.adm-gate > p { text-align: center; }
.adm-gate .adm-form { max-width: 360px; margin: 16px auto 0; }
.adm-home { width: auto; padding: 0 12px; text-decoration: none; font-size: 13px; display: inline-flex; align-items: center; }
.adm-help { margin: -4px 0 14px; line-height: 1.7; }
.adm-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.adm-form-grid .acct-field span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adm-form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.adm-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.adm-src { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.adm-src.ok { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.adm-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.adm-inline input { min-width: 220px; }
.adm-copy { cursor: pointer; padding: 1px 6px; border-radius: 6px; background: var(--chip); word-break: break-all; }
.adm-copy.copied { background: color-mix(in srgb, var(--up) 18%, transparent); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--chip); color: var(--muted); margin-right: 4px; white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.tag.bad { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.tag.acc { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.linklike { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0 2px; }
.up { color: var(--up); } .down { color: var(--down); }
@media (max-width: 900px) {
  .adm-kpis, .adm-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-grid-2 { grid-template-columns: minmax(0, 1fr); }
  /* The site hides its top nav on phones (it has a bottom bar); the admin page keeps it. */
  body.admin .top-row { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  body.admin .nav { display: flex; order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; }
  body.admin .nav[hidden] { display: none; }
}
.adm-filled { outline: 2px solid var(--accent, #d97a1e); outline-offset: 0; }
.adm-exit-help { display: block; margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--muted, #8a8f98); }
.adm-exit-help b { color: inherit; font-weight: 600; }
.adm-risk-row { display: flex; gap: 8px; }
.adm-risk-row input { flex: 0 0 140px; min-width: 0; }
.adm-risk-row select { flex: 1; min-width: 0; width: auto; }
.adm-span-all, .adm-risk { grid-column: 1 / -1; }
.adm-risk { max-width: 640px; }
.adm-adv { margin-top: 4px; }
.adm-adv summary { cursor: pointer; color: var(--muted, #8a8f98); font-size: 13px; }
.adm-adv .adm-form-grid { margin-top: 10px; }
.adm-status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 12px; line-height: 1.6; }
.tag.warn { background: color-mix(in srgb, #d99a1e 18%, transparent); color: #c98a10; }
.adm-reminder { margin: 14px 0; }
.adm-reminder h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.adm-reminder .adm-list li { justify-content: flex-start; gap: 6px; line-height: 1.6; }
.adm-reminder details { margin-top: 8px; }

/* 分潤 tab: editable tier and level tables */
.bill-edit input { width: 100%; min-width: 90px; padding: 6px 8px; }
.bill-edit td { padding: 6px 8px; }
.adm-merchant { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 12px 16px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.adm-merchant span { color: var(--muted); font-size: 13px; grid-column: 1; }
.adm-merchant b { font-size: 22px; grid-column: 1; }
.adm-merchant b small { font-size: 13px; font-weight: 500; color: var(--muted); }
.adm-merchant em { font-style: normal; font-size: 12px; color: var(--muted); grid-column: 1; }
.adm-merchant em strong { color: var(--down); }
.adm-merchant .adm-btn { grid-column: 2; grid-row: 1 / span 3; }
.adm-merchant.is-alert { border-color: color-mix(in srgb, var(--down) 50%, var(--line)); background: color-mix(in srgb, var(--down) 6%, transparent); }
.adm-head-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.adm-card-head { align-items: center; flex-wrap: wrap; }
/* second row of the navigation: the pages inside the chosen group */
.adm-subnav { border-bottom: 1px solid var(--line); background: var(--surface); }
.adm-subnav #adm-subnav-row { display: flex; gap: 4px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; }
.adm-subnav a { white-space: nowrap; padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.adm-subnav a:hover { color: var(--ink); background: var(--chip); }
.adm-subnav a[aria-current="page"] { color: var(--accent); background: var(--chip); font-weight: 600; }
body.admin .nav a { display: inline-flex; align-items: center; gap: 6px; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }

/* 廣場管理 */
.pza-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.pza-search .adm-chips { margin: 0 8px 0 0; }
.pza-search input { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; color: var(--ink); background: var(--surface-2); }
.pza-list { display: flex; flex-direction: column; gap: 10px; }
.pza-post { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.pza-post header { display: flex; align-items: center; gap: 10px; }
.pza-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.pza-av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.pza-av img { width: 100%; height: 100%; object-fit: cover; }
.pza-text { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pza-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pza-imgs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.pza-post footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pza-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pza-acts .btn { margin-top: 0; }
.pza-gone { opacity: .6; }
.pza-danger { background: var(--down); border-color: var(--down); color: #fff; }
.pza-cmts { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pza-cmts li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pza-cmts p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pza-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }

/* Two-step sign-in: reminder banner and setup card */
.adm-alert { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--down) 45%, transparent);
  background: color-mix(in srgb, var(--down) 10%, transparent); line-height: 1.6; }
.adm-alert a { margin-left: 8px; font-weight: 600; }
.adm-qr { display: block; margin: 8px 0 16px; background: #fff; padding: 8px; border-radius: 8px; }
.adm-steps { padding-left: 20px; line-height: 1.8; }
.adm-steps code { font-size: 15px; letter-spacing: .04em; user-select: all; }

/* 交易 → 實盤監控 (monitor-admin.js) */
.mon-banner { border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; font-size: 16px; border: 1px solid var(--line); }
.mon-ok { background: color-mix(in srgb, var(--up) 12%, transparent); color: var(--up); }
.mon-warn { background: color-mix(in srgb, #d99a1e 14%, transparent); color: #b07a0c; }
.mon-bad { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.mon-kpis { margin-bottom: 6px; }
.mon-card-bad { border-color: var(--down); }
.mon-head { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mon-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.mon-nums b { color: var(--ink); }
.mon-up { color: var(--up); }
.mon-down { color: var(--down); }
.mon-issues { list-style: none; padding: 0; margin: 0 0 10px; font-size: 13px; }
.mon-issues li { padding: 3px 0; }
.mon-row-bad td { background: color-mix(in srgb, var(--down) 8%, transparent); }
.mon-table td, .mon-table th { white-space: nowrap; }
.mon-foot { margin: 8px 0 0; }
.mon-more summary { cursor: pointer; color: var(--muted); margin-top: 4px; }

/* Layout: left menu + content (narrow screens: menu on top, pages in a row under it) */
.adm-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; max-width: 1480px; margin: 0 auto; }
.adm-side { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 20px 12px 32px; border-right: 1px solid var(--line); min-height: calc(100vh - 64px); box-sizing: border-box; }
.adm-side[hidden] { display: none; }
.adm-side-g { margin-bottom: 2px; }
.adm-side a { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-decoration: none; border-radius: 8px; }
.adm-side-h { padding: 9px 12px; color: var(--ink); font-size: 15px; font-weight: 600; }
.adm-side-h:hover, .adm-side-sub a:hover { background: var(--chip); }
.adm-side-g.is-open > .adm-side-h { color: var(--accent); }
.adm-side-h[aria-current="page"] { background: var(--chip); }
.adm-side-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 12px; padding-left: 8px; border-left: 2px solid var(--line); }
.adm-side-sub a { padding: 7px 10px; color: var(--muted); font-size: 14px; }
.adm-side-sub a[aria-current="page"] { color: var(--accent); background: var(--chip); font-weight: 600; }
.adm-shell > .adm-subnav { display: none; }
.adm-shell:has(.adm-side[hidden]) { grid-template-columns: minmax(0, 1fr); max-width: 1120px; }
@media (max-width: 860px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-side { position: static; min-height: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .adm-side-g { margin: 0; }
  .adm-side-h { white-space: nowrap; padding: 7px 12px; font-size: 14px; }
  .adm-side-g.is-open > .adm-side-h { background: var(--chip); }
  .adm-side-sub { display: none; }
  .adm-shell > .adm-subnav:not([hidden]) { display: block; }
  .adm-subnav #adm-subnav-row { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; scrollbar-width: none; }
  .adm-main { padding: 16px 16px 40px; }
}

/* Header lined up with the shell below (2026-11-26): the logo starts where the menu text
   starts, the account sits at the content's right edge, on any screen width. */
body.admin .top .wrap { max-width: 1480px; padding: 0 28px 0 24px; box-sizing: border-box; }
body.admin .brand-en { font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .04em; color: var(--muted); margin-left: 4px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; }
html[lang="en"] body.admin .brand-en { display: inline-block; }
/* The first heading on a page sits at the top, not under an extra gap. */
.adm-main .adm-sec-head:first-child { margin-top: 0; }
@media (max-width: 860px) { body.admin .top .wrap { padding: 0 16px; } }
/* 私信檢視 (plaza-admin.js) */
.pza-dms { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.pza-day { text-align: center; margin: 6px 0; }
.pza-dm { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 75%; }
.pza-dm.right { align-self: flex-end; align-items: flex-end; }
.pza-bubble { padding: 7px 11px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.pza-dm.right .pza-bubble { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.pza-dm-img { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: none; cursor: zoom-in; line-height: 0; }
.pza-dm-img img { display: block; width: 200px; max-width: 60vw; max-height: 260px; object-fit: cover; }
.pza-zoom { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.pza-zoom::backdrop { background: rgba(0,0,0,.85); }
.pza-zoom img { max-width: 96vw; max-height: 92vh; display: block; border-radius: 8px; }
.pza-zoom-x { position: fixed; top: 14px; right: 18px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 22px; cursor: pointer; }
.pza-gmembers { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 10px; font-size: 13px; }
.pza-gm.pza-gone { opacity: .6; }

body.admin .brand-ver { font: 600 11px/1 var(--mono, ui-monospace, monospace); color: var(--muted); margin-left: 8px; opacity: .8; }

/* 後台切換：平台 / AI 交易 / AI 自動託管（小程序本地副本） */
.adm-console-h { display: flex; flex-direction: column; gap: 2px; margin: 0 4px 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.adm-console-h b { font-size: 15px; }
/* 窄螢幕：選單排成一列，後台名稱固定在最左邊（不換行、不被擠），說明文字收起 */
@media (max-width: 860px) {
  .adm-side-g { flex: 0 0 auto; }
  .adm-console-h { flex: 0 0 auto; justify-content: center; margin: 0 6px 0 0; padding: 0 12px 0 4px; border-bottom: 0; border-right: 1px solid var(--line); }
  .adm-console-h b { white-space: nowrap; font-size: 14px; }
  .adm-console-h span { display: none; }
}

/* ===== 後台打磨（2026-11-28）：選單、卡片、數字、表格、登入頁 ===== */
.adm-main { padding: 28px 32px 56px; }
.adm-main .card { border-radius: 16px; padding: 20px 22px; }
/* 後台名稱：左上角一塊有顏色的標誌，三個後台一眼分得出來 */
.adm-console-h { flex-direction: row; align-items: center; gap: 12px; margin: 0 2px 16px; padding: 4px 4px 16px; }
.adm-console-h > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adm-console-h span.small { line-height: 1.5; font-size: 12px; }
.adm-console-mark { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; --c: var(--accent);
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.c-trade .adm-console-mark { --c: #5b9cf5; }
.c-custody .adm-console-mark { --c: #3fbf8f; }
.adm-console-mark .adm-ico { width: 20px; height: 20px; }
.adm-ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.adm-side-l { display: inline-flex; align-items: center; gap: 10px; }
.adm-side-h { padding: 10px 12px; font-weight: 500; color: var(--muted); transition: background .15s, color .15s; }
.adm-side-h:hover { color: var(--ink); }
.adm-side-g.is-open > .adm-side-h { color: var(--ink); font-weight: 600; background: var(--chip); }
.adm-side-g.is-open > .adm-side-h .adm-ico { color: var(--accent); }
.adm-side-sub { margin: 4px 0 10px 20px; padding-left: 10px; }
.adm-side-sub a { position: relative; padding: 7px 10px; transition: color .15s, background .15s; }
.adm-side-sub a:hover { color: var(--ink); }
.adm-side-sub a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.adm-side-sub a[aria-current="page"]::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
/* 數字卡 */
.adm-kpis { gap: 14px; }
.adm-kpi { border-radius: 16px; padding: 18px 20px; position: relative; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.adm-kpi::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%); opacity: .55; }
.adm-kpi:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.adm-kpi .adm-kpi-label { font-size: 12.5px; letter-spacing: .02em; }
.adm-kpi b { font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin-top: 6px; }
.adm-kpi em { margin-top: 6px; }
.adm-kpi.is-alert::after { background: linear-gradient(90deg, var(--down), transparent 70%); opacity: .8; }
.adm-kpi.is-up::after { background: linear-gradient(90deg, var(--up), transparent 70%); opacity: .8; }
/* 區塊標題 */
.adm-sec-head { margin: 34px 0 14px; padding-bottom: 10px; }
.adm-main .adm-sec-head h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: .01em; }
.adm-main .adm-sec-head h2::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.adm-more { padding: 4px 10px; border-radius: 8px; transition: background .15s; }
.adm-more:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* 表格：表頭底色、斑馬紋、數字對齊 */
.adm-main .table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.adm-table th, .adm-table td { padding: 11px 14px; }
.adm-table thead th { background: var(--surface-2); font-size: 12px; letter-spacing: .03em; position: sticky; top: 0; z-index: 1; }
.adm-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.adm-table tbody tr:last-child td, .adm-table tbody tr:last-child th { border-bottom: 0; }
.adm-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.adm-table td.num, .adm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 標籤 */
.tag { padding: 2px 9px; font-weight: 500; }
/* 待處理 */
.adm-todo li { padding: 12px 14px; border: 1px solid var(--line); border-left-width: 3px; transition: border-color .15s; }
.adm-todo li:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.adm-todo li.lv-bad:hover { border-left-color: var(--down); }
/* 商戶錢包：兩個渠道並排；沒開的渠道縮成一行 */
.adm-merchants { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 0 0 14px; }
.adm-merchants .adm-merchant { margin: 0; }
.adm-merchant { border-radius: 14px; padding: 14px 18px; }
.adm-merchant.is-off { grid-template-columns: auto 1fr; gap: 2px 10px; padding: 11px 16px; background: var(--surface-2); }
.adm-merchant.is-off b { grid-column: 2; grid-row: 1; justify-self: end; font-size: 13px; font-weight: 600; color: var(--muted); padding: 1px 9px; border-radius: 999px; background: var(--chip); }
.adm-merchant.is-off em { grid-column: 1 / -1; }
/* 兩步驗證提醒：細一點、用提醒色 */
.adm-alert { padding: 10px 16px; font-size: 13.5px; border-color: color-mix(in srgb, #d99a1e 40%, transparent); background: color-mix(in srgb, #d99a1e 9%, transparent); }
.adm-alert b { color: #e0a43a; }
/* 表單 */
.adm-main input[type="search"], .adm-main input[type="email"], .adm-main select, .adm-inline input, .adm-form-grid input { transition: border-color .15s, box-shadow .15s; }
.adm-main input:focus, .adm-main select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.adm-chip { transition: background .15s, border-color .15s; }
.adm-chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
/* 登入頁：置中的一張卡 */
.adm-shell:has(.adm-side[hidden]) .adm-main:has(.adm-gate:not([hidden])) { display: grid; place-items: start center; min-height: calc(100vh - 64px); padding-top: 9vh; }
.adm-gate { width: min(420px, 100%); box-sizing: border-box; padding: 34px 32px 30px; border-radius: 20px; }
.adm-gate-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 8px; }
.adm-gate-head .adm-console-mark { width: 52px; height: 52px; border-radius: 15px; }
.adm-gate-head .adm-console-mark .adm-ico { width: 26px; height: 26px; }
.adm-gate-head h2 { margin: 4px 0 0; font-size: 20px; }
.adm-gate-head h2::before, .adm-gate-head h2::after { display: none !important; }
.adm-gate-head p { margin: 0; }
.adm-gate .adm-form { max-width: none; margin-top: 18px; }
@media (max-width: 860px) {
  .adm-main { padding: 18px 16px 44px; }
  .adm-console-mark { width: 30px; height: 30px; border-radius: 9px; }
  .adm-console-h > div span.small { display: none; }
  .adm-side-l .adm-ico { display: none; }
  .adm-side-g.is-open > .adm-side-h .adm-ico { display: none; }
}
/* 託管總覽的數字：一格一格的小卡 */
body.admin .cu-grid { gap: 12px; }
body.admin .cu-grid > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: border-color .15s; }
body.admin .cu-grid > div:hover { border-color: color-mix(in srgb, #3fbf8f 45%, var(--line)); }
body.admin .cu-grid > div b { font-size: 20px; letter-spacing: -.01em; }
.mini-hide-all { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); font-weight: 600; }
