/* =========================================================
   四方支付中台 · UI Design System
   Bootstrap 5.3 base + modern responsive components
   ========================================================= */
:root {
  --app-bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #94a3b8;
  --line: #e6ebf3;
  --line-strong: #d7deea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --sidebar: #0b1220;
  --sidebar-soft: #111c31;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .04);
  --shadow-md: 0 12px 40px rgba(15, 23, 42, .09);
  --topbar-height: 76px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, .06), transparent 28rem),
    var(--app-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.spacer { flex: 1 1 auto; }
.empty { padding: 44px 20px !important; text-align: center; color: var(--muted); }

/* ---------- Login ---------- */
.login-view {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, .35), transparent 26rem),
    radial-gradient(circle at 85% 90%, rgba(14, 165, 233, .20), transparent 30rem),
    linear-gradient(145deg, #07101f 0%, #0d1b35 55%, #0b1220 100%);
}
.login-orb { position: absolute; border-radius: 999px; filter: blur(1px); pointer-events: none; }
.login-orb-one { width: 420px; height: 420px; top: -190px; right: -130px; background: rgba(37, 99, 235, .18); }
.login-orb-two { width: 300px; height: 300px; bottom: -150px; left: -100px; background: rgba(56, 189, 248, .12); }
.login-card {
  position: relative;
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 26px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
  backdrop-filter: blur(18px);
}
.login-brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  border-radius: 14px;
  color: #fff;
  font-size: 21px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8 65%, #0ea5e9);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .32);
}
.brand-mark.sm { width: 36px; height: 36px; flex-basis: 36px; font-size: 17px; border-radius: 11px; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand-caption { margin-top: 2px; font-size: 11px; letter-spacing: .02em; color: var(--muted); }
.login-heading { margin: 34px 0 24px; }
.login-heading h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.login-heading p { margin: 7px 0 0; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 9px; }
.field-label { margin-top: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.input-shell { position: relative; }
.input-shell > i {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
}
.input-shell .form-control {
  min-height: 48px;
  padding-left: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfdff;
  box-shadow: none;
}
.input-shell .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); background: #fff; }
.btn-login { min-height: 48px; margin-top: 12px; border: 0; border-radius: 12px; font-weight: 700; background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 10px 24px rgba(37, 99, 235, .26); }
.btn-login:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); }
.msg { min-height: 18px; margin-top: 4px; color: var(--danger); text-align: center; font-size: 13px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100dvh; }
.app-sidebar {
  width: 264px;
  flex: 0 0 264px;
  color: #cbd5e1;
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, .18), transparent 18rem),
    var(--sidebar);
}
.sidebar-body { display: flex; flex-direction: column; min-height: 100dvh; padding: 22px 14px 16px; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; color: #fff; }
.sidebar-brand .brand-caption { color: #64748b; font-size: 9px; letter-spacing: .16em; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-section-label { padding: 18px 12px 7px; color: #52617a; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.side-nav a {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #aebbd0;
  font-size: 14px;
  transition: .18s ease;
}
.side-nav a i { width: 20px; font-size: 17px; text-align: center; color: #6f829f; }
.side-nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.side-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(37, 99, 235, .94), rgba(29, 78, 216, .78));
  box-shadow: 0 8px 22px rgba(37, 99, 235, .24);
}
.side-nav a.active i { color: #dbeafe; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 10px 8px; }
.user-avatar { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: #bfdbfe; background: rgba(37, 99, 235, .18); }
.user-meta { min-width: 0; }
.user-name { overflow: hidden; color: #f8fafc; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.user-role { margin-top: 2px; color: #64748b; font-size: 11px; }
.btn-logout { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; color: #cbd5e1; background: rgba(255, 255, 255, .04); font-size: 13px; }
.btn-logout:hover { color: #fff; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(16px, 2.4vw, 32px);
  border-bottom: 1px solid rgba(226, 232, 240, .85);
  background: rgba(243, 246, 251, .86);
  backdrop-filter: blur(16px);
}
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { margin: 0; font-size: clamp(19px, 2vw, 25px); font-weight: 800; letter-spacing: -.025em; }
.topbar-sub { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-chip, .topbar-user { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-secondary); background: rgba(255, 255, 255, .72); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .12); }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: #fff; font-size: 20px; }
.app-content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 24px clamp(14px, 2.4vw, 32px) 40px; }

/* ---------- Cards & panels ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.card .value { margin-top: 8px; color: var(--text); font-size: clamp(21px, 2vw, 27px); font-weight: 800; letter-spacing: -.035em; }
.card .value.green { color: var(--success); }
.card .value.red { color: var(--danger); }
.card .value.blue { color: var(--primary); }
.card .value.orange { color: var(--warning); }
.panel {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel:last-child { margin-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fbfdff); }
.toolbar > span { color: var(--text-secondary); font-size: 13px; font-weight: 650; }
.toolbar .form-control, .toolbar .form-select { width: auto; min-width: 130px; min-height: 36px; border-color: var(--line-strong); border-radius: 9px; font-size: 13px; box-shadow: none; }
.toolbar .form-control:focus, .toolbar .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }

/* ---------- Tables ---------- */
.table { margin: 0; color: var(--text); font-size: 13px; --bs-table-bg: transparent; --bs-table-hover-bg: #f8fbff; }
.table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: var(--line); background-color: transparent; }
.table thead th { color: #64748b; background: var(--surface-soft); font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background-color: #f8fbff; }
.table-responsive, .panel { scrollbar-width: thin; }

/* ---------- Buttons ---------- */
.btn { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text-secondary); background: #fff; font-size: 13px; font-weight: 600; box-shadow: none; transition: .16s ease; }
.btn:hover { color: var(--primary); border-color: #bfdbfe; background: var(--primary-soft); transform: translateY(-1px); }
.btn.primary, .btn-primary { color: #fff; border-color: var(--primary); background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 6px 15px rgba(37, 99, 235, .18); }
.btn.primary:hover, .btn-primary:hover { color: #fff; border-color: var(--primary-dark); background: linear-gradient(135deg, #1d4ed8, #1e40af); }
.btn.danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn.danger:hover { color: #991b1b; border-color: #fca5a5; background: var(--danger-soft); }
.btn.sm { min-height: 29px; padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; transform: none; cursor: not-allowed; }
a.link { display: inline-flex; align-items: center; color: var(--primary); font-weight: 600; cursor: pointer; }
a.link:hover { color: var(--primary-dark); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em; }
.badge.success, .badge.on { color: #047857; background: var(--success-soft); }
.badge.failed, .badge.off { color: #b91c1c; background: var(--danger-soft); }
.badge.processing { color: #1d4ed8; background: var(--primary-soft); }
.badge.pending { color: #92400e; background: var(--warning-soft); }
.badge.closed { color: #64748b; background: #f1f5f9; }
.badge.critical { color: #b91c1c; background: var(--danger-soft); }

/* ---------- Pager ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--muted); }
.pager-meta { font-size: 12px; }
.pagination { --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--primary-soft); --bs-pagination-hover-color: var(--primary); --bs-pagination-focus-box-shadow: none; }
.page-link { min-height: 30px; display: flex; align-items: center; color: var(--text-secondary); border-radius: 7px !important; font-size: 12px; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-color: var(--line-strong); border-radius: 9px; font-size: 13px; box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-item { min-width: 0; }
.form-item label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.form-item input, .form-item select, .form-item textarea { width: 100%; }
.form-item textarea { resize: vertical; line-height: 1.6; }
.form-item.full { grid-column: 1 / -1; }

/* ---------- Modal ---------- */
.modal { --bs-modal-border-color: transparent; --bs-modal-border-radius: 20px; }
.modal-backdrop.show { opacity: .48; backdrop-filter: blur(2px); }
.modal-content { overflow: hidden; border: 1px solid rgba(255, 255, 255, .7); border-radius: 20px; box-shadow: 0 28px 90px rgba(15, 23, 42, .26); }
.modal-body { padding: 24px; }
.modal-body h3 { margin: 0 0 18px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.detail-table { width: 100%; }
.detail-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.detail-table td:first-child { width: 142px; color: var(--muted); font-size: 12px; }
.detail-table tr:last-child td { border-bottom: 0; }

/* ---------- Notices / toasts ---------- */
.notice { padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-secondary); background: var(--surface-soft); font-size: 13px; line-height: 1.7; }
.notice.warn { color: #92400e; border-color: #fde68a; background: var(--warning-soft); }
.notice.ok { color: #166534; border-color: #bbf7d0; background: var(--success-soft); }
.toast-container { z-index: 1090; }
.toast { border-radius: 12px; box-shadow: var(--shadow-md); }

/* ---------- Offcanvas / mobile ---------- */
.offcanvas-lg { --bs-offcanvas-width: 282px; --bs-offcanvas-bg: var(--sidebar); }
.offcanvas-header { padding: 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.offcanvas-header strong { color: #fff; font-size: 15px; }
.offcanvas-backdrop.show { opacity: .55; }

@media (max-width: 1199.98px) {
  .cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (max-width: 991.98px) {
  .app-content { padding: 18px 14px calc(28px + env(safe-area-inset-bottom)); }
  .app-topbar { min-height: 68px; padding: 10px 14px; }
  .sidebar-brand { display: none; }
  .sidebar-body { min-height: calc(100dvh - 74px); padding-top: 12px; }
  .side-nav a { min-height: 46px; }
  .btn-logout { min-height: 44px; }
}
@media (max-width: 767.98px) {
  :root { --topbar-height: 64px; }
  .app-content { padding: 14px 11px calc(24px + env(safe-area-inset-bottom)); }
  .topbar-sub { display: none; }
  .topbar-actions { gap: 6px; }
  .status-chip { padding: 6px 9px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px; border-radius: 12px; }
  .card .value { font-size: 21px; }
  .panel { margin-bottom: 14px; overflow-x: auto; border-radius: 12px; -webkit-overflow-scrolling: touch; }
  .panel > .table { min-width: 760px; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 11px 12px; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .form-control, .toolbar .form-select { flex: 0 0 auto; min-width: 128px; }
  .toolbar .spacer { display: none; }
  .pager { padding: 11px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-item.full { grid-column: auto; }
  .modal-dialog { min-height: calc(100% - 14px); margin: 14px 8px 0; align-items: flex-end; }
  .modal-content { border-radius: 20px 20px 0 0; max-height: calc(100dvh - 14px); }
  .modal-body { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .modal-actions .btn { flex: 1 1 auto; min-height: 42px; }
  .detail-table td:first-child { width: 112px; }
  .login-card { padding: 28px 22px; border-radius: 22px; }
  .login-heading { margin: 28px 0 22px; }
  .login-heading h1 { font-size: 25px; }
}
@media (max-width: 379.98px) {
  .cards { grid-template-columns: 1fr; }
  .login-view { padding-left: 12px; padding-right: 12px; }
}

/* Bootstrap offcanvas-lg desktop reset */
.app-sidebar .offcanvas-body { padding: 0; }
.app-sidebar .sidebar-body { width: 100%; }
@media (min-width: 992px) {
  .app-sidebar.offcanvas-lg { width: 264px !important; flex: 0 0 264px !important; background: var(--sidebar) !important; }
  .app-sidebar.offcanvas-lg .offcanvas-body { display: flex; overflow-y: auto; }
}

/* ---------- Merchant app detail ---------- */
.min-w-0 { min-width: 0; }
.detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .08), transparent 18rem),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.detail-hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.detail-identity h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.025em; }
.detail-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 5px; color: var(--muted); font-size: 12px; }
.detail-avatar { width: 50px; height: 50px; flex: 0 0 50px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 10px 24px rgba(37, 99, 235, .25); font-size: 23px; }
.detail-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.detail-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fff; scrollbar-width: none; }
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tab { flex: 0 0 auto; min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 0; border-radius: 9px; color: var(--text-secondary); background: transparent; font-size: 13px; font-weight: 650; }
.detail-tab:hover { color: var(--primary); background: var(--primary-soft); }
.detail-tab.active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px #dbeafe; }
.detail-body { padding: 22px; }
.detail-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.detail-section-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.detail-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.security-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.security-box > div { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.security-box .label { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
@media (max-width: 767.98px) {
  .detail-hero { padding: 15px; }
  .detail-hero-main { width: 100%; align-items: flex-start; flex-wrap: wrap; }
  .detail-hero-actions { width: 100%; justify-content: space-between; }
  .detail-identity h2 { font-size: 18px; }
  .detail-avatar { width: 43px; height: 43px; flex-basis: 43px; font-size: 19px; }
  .detail-body { padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); }
  .detail-section-head { flex-direction: column; gap: 8px; }
  .security-box { grid-template-columns: 1fr; }
  .detail-tabs { padding: 8px; }
}

/* ---------- Pay order detail ---------- */
.order-avatar { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.order-summary-cards { margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-grid > table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; padding-left: 8px; }
.timeline-item { position: relative; display: flex; gap: 14px; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child):before { content: ""; position: absolute; top: 11px; bottom: -2px; left: 5px; width: 1px; background: var(--line-strong); }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; flex: 0 0 11px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.timeline-content { flex: 1; min-width: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.timeline-head strong { font-size: 13px; }
.timeline-head span { color: var(--muted); font-size: 11px; }
.timeline-detail { margin-top: 6px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; word-break: break-word; }
.timeline-operator { margin-top: 5px; color: var(--muted); font-size: 11px; }
@media (max-width: 767.98px) {
  .detail-grid { grid-template-columns: 1fr; }
  .order-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-hero-actions .btn { flex: 1 1 auto; }
}
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field select { flex: 1; min-width: 0; }
.quick-create { margin-top: 14px; border-color: #bfdbfe; background: #f8fbff; }
@media (max-width: 767.98px) {
  .inline-field { flex-wrap: wrap; }
  .inline-field select, .inline-field .btn { flex: 1 1 100%; }
}

/* ---------- RBAC ---------- */
.permission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:8px; }
.permission-item { display:flex; align-items:flex-start; gap:9px; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:var(--surface-soft); cursor:pointer; }
.permission-item span { display:flex; flex-direction:column; gap:2px; font-size:13px; }
.permission-item small { color:var(--muted); font-size:10px; }
@media(max-width:767.98px){ .permission-grid { grid-template-columns:1fr; } }

/* ---------- Merchant notify queue ---------- */
.notify-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.notify-stat { appearance: none; text-align: left; border: 1px solid var(--line); cursor: pointer; transition: .16s ease; }
.notify-stat:hover, .notify-stat.active { border-color: #bfdbfe; background: #f8fbff; box-shadow: 0 8px 24px rgba(37, 99, 235, .09); transform: translateY(-1px); }
.notify-stat small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.notify-table { min-width: 980px; }
.notify-order-cell { display: flex; flex-direction: column; gap: 4px; min-width: 138px; }
.notify-order-cell strong { font-size: 12px; font-weight: 700; }
.notify-order-cell small { color: var(--muted); font-size: 11px; word-break: break-all; }
.notify-sub { margin-top: 5px; color: var(--muted); font-size: 10px; }
.notify-result { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; max-width: 260px; }
.notify-result small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; word-break: break-all; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 132px; }
.notify-log-table { width: 100%; min-width: 660px; }
.notify-log-table td, .notify-log-table th { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 12px; }
.notify-log-table th { color: var(--muted); background: var(--surface-soft); font-size: 10px; white-space: nowrap; }
.notify-log-response { max-width: 360px; color: var(--text-secondary); word-break: break-all; }
@media (max-width: 991.98px) { .notify-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .notify-summary { grid-template-columns: 1fr 1fr; } .notify-stat { padding: 13px; } .notify-stat .value { font-size: 22px; } }

/* ---------- Alipay bill reconciliation ---------- */
.bill-summary .card small { display:block; margin-top:6px; color:var(--muted); font-size:11px; line-height:1.45; }
.bill-table { min-width: 1040px; }
.bill-identity, .bill-money { display:flex; flex-direction:column; gap:4px; min-width:130px; }
.bill-identity strong, .bill-money strong { font-size:12px; font-weight:700; }
.bill-identity small, .bill-money small { color:var(--muted); font-size:10px; line-height:1.45; word-break:break-all; }
.bill-counts { display:flex; flex-wrap:wrap; gap:5px; min-width:120px; }
.bill-error { max-width:160px; margin-top:5px; overflow:hidden; color:var(--danger); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.bill-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.bill-detail-head h3 { margin:0; font-size:18px; font-weight:800; word-break:break-all; }
.bill-detail-head p { margin:5px 0 0; font-size:12px; }
.bill-detail-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:16px 0; }
.bill-detail-metrics > div { display:flex; flex-direction:column; gap:6px; padding:13px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.bill-detail-metrics span { color:var(--muted); font-size:11px; }
.bill-detail-metrics strong { color:var(--text); font-size:16px; }
.bill-detail-section { margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.bill-diff-table, .bill-entry-table { width:100%; min-width:820px; }
.bill-diff-table td, .bill-diff-table th, .bill-entry-table td, .bill-entry-table th { padding:10px; border-bottom:1px solid var(--line); vertical-align:top; font-size:12px; }
.bill-diff-table th, .bill-entry-table th { color:var(--muted); background:var(--surface-soft); font-size:10px; white-space:nowrap; }
.bill-diff-message { max-width:260px; color:var(--text-secondary); line-height:1.55; }
.bill-diff-message small { display:block; margin-top:5px; color:var(--muted); }
.bill-diff-actions { display:flex; flex-wrap:wrap; gap:5px; min-width:120px; }
@media (max-width: 767.98px) {
  .bill-detail-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bill-detail-head { flex-direction:column; }
}

/* =========================================================
   Unified visual proportions · 2026 refresh
   Admin and merchant portals share these refinements.
   ========================================================= */
:root {
  --radius-sm: 11px;
  --radius: 16px;
  --radius-lg: 22px;
  --topbar-height: 78px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .03), 0 8px 26px rgba(15, 23, 42, .055);
  --shadow-md: 0 18px 52px rgba(15, 23, 42, .12);
}

.app-content { max-width: 1600px; padding: 28px clamp(18px, 2.6vw, 38px) 48px; }
.app-topbar { min-height: var(--topbar-height); padding: 13px clamp(18px, 2.6vw, 38px); }
.topbar-title h1 { font-size: clamp(20px, 1.7vw, 26px); letter-spacing: -.03em; }
.topbar-sub { margin-top: 4px; font-size: 12.5px; }
.status-chip, .topbar-user { min-height: 34px; padding: 8px 13px; }

.sidebar-body { padding: 24px 16px 18px; }
.side-nav { gap: 5px; }
.side-nav a { min-height: 46px; padding: 11px 13px; border-radius: 12px; font-size: 14px; }
.side-nav a i { width: 22px; font-size: 18px; }
.nav-section-label { padding: 20px 13px 8px; font-size: 10.5px; }

.cards { gap: 16px; margin-bottom: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); }
.card {
  min-height: 118px;
  justify-content: center;
  padding: 20px 21px;
  border-color: #e4eaf3;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); border-color: #d5e3f8; box-shadow: 0 12px 34px rgba(37, 99, 235, .09); }
.card .label { font-size: 12px; letter-spacing: .015em; }
.card .value { margin-top: 9px; font-size: clamp(23px, 2vw, 30px); line-height: 1.15; }

.panel {
  margin-bottom: 20px;
  border-color: #e4eaf3;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.toolbar {
  gap: 11px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}
.toolbar > span { font-size: 13.5px; }
.toolbar .form-control, .toolbar .form-select {
  min-width: 150px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.toolbar .btn { flex-shrink: 0; }

.table { font-size: 13px; }
.table > :not(caption) > * > * { padding: 13px 16px; }
.table thead th { padding-top: 11px; padding-bottom: 11px; font-size: 11px; letter-spacing: .055em; }
.table tbody td { color: #334155; }
.table-hover > tbody > tr { transition: background .14s ease; }

.btn {
  min-height: 40px;
  gap: 7px;
  padding: 9px 15px;
  border-color: #d5deea;
  border-radius: 10px;
  color: #334155;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.btn:hover { border-color: #b9d5fb; color: var(--primary-dark); background: #f4f8ff; box-shadow: 0 5px 14px rgba(37, 99, 235, .09); }
.btn.primary, .btn-primary {
  border-color: #2563eb;
  background: linear-gradient(135deg, #3478f6 0%, #2563eb 48%, #1d4ed8 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .21);
}
.btn.primary:hover, .btn-primary:hover { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); box-shadow: 0 10px 24px rgba(37, 99, 235, .27); }
.btn.danger { border-color: #fecaca; background: #fffafa; }
.btn.sm { min-height: 32px; padding: 5px 11px; border-radius: 8px; font-size: 12px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: 3px solid rgba(37, 99, 235, .18); outline-offset: 1px; }

.form-control, .form-select {
  min-height: 40px;
  padding: 8px 12px;
  border-color: #d6dfeb;
  border-radius: 10px;
  font-size: 13px;
}
.form-item label { margin-bottom: 7px; font-size: 12.5px; }
.form-grid { gap: 16px 18px; }

.pager { min-height: 58px; padding: 14px 18px; }
.page-link { min-height: 34px; padding: 6px 12px; border-radius: 8px !important; }
.badge { min-height: 25px; padding: 4px 10px; font-size: 11px; }
a.link { gap: 4px; font-size: 12.5px; }

.detail-tabs { gap: 6px; padding: 12px 14px; }
.detail-tab { min-height: 40px; padding: 9px 14px; border-radius: 10px; }
.detail-body { padding: 24px; }
.modal-body { padding: 26px; }
.modal-actions { gap: 10px; margin-top: 24px; }
.modal-actions .btn { min-width: 88px; }

@media (max-width: 991.98px) {
  .app-content { padding: 20px 15px calc(30px + env(safe-area-inset-bottom)); }
  .app-topbar { min-height: 70px; padding: 11px 15px; }
  .side-nav a { min-height: 47px; }
}

@media (max-width: 767.98px) {
  :root { --topbar-height: 66px; }
  .app-content { padding: 15px 12px calc(26px + env(safe-area-inset-bottom)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 15px; }
  .card { min-height: 104px; padding: 15px 16px; border-radius: 14px; }
  .card .value { margin-top: 7px; font-size: 22px; }
  .panel { margin-bottom: 15px; border-radius: 14px; }
  .toolbar {
    flex-wrap: wrap;
    overflow: visible;
    gap: 8px;
    padding: 12px;
  }
  .toolbar .form-control, .toolbar .form-select {
    flex: 1 1 145px;
    width: auto;
    min-width: 0;
    min-height: 40px;
  }
  .toolbar .btn { flex: 1 1 auto; min-width: 104px; min-height: 40px; }
  .toolbar .spacer { display: none; }
  .table > :not(caption) > * > * { padding: 11px 13px; }
  .pager { min-height: 52px; padding: 11px 12px; }
  .modal-body { padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); }
  .modal-actions { gap: 8px; }
  .modal-actions .btn { flex: 1 1 calc(50% - 8px); min-width: 0; min-height: 43px; }
  .detail-body { padding: 18px 15px calc(20px + env(safe-area-inset-bottom)); }
}

@media (max-width: 379.98px) {
  .cards { grid-template-columns: 1fr; }
  .toolbar .btn { flex-basis: 100%; }
}
.notice.info { color: #1e40af; border-color: #bfdbfe; background: #eff6ff; }
.bill-note { max-width:180px; margin-top:5px; overflow:hidden; color:var(--warning); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }

/* ---------- Unified pay channels ---------- */
.channel-badges { display:flex; flex-wrap:wrap; gap:5px; min-width:180px; }
.table-actions { display:flex; flex-wrap:wrap; gap:6px; min-width:240px; }
.channel-manager-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.channel-manager-head h3 { margin-bottom:6px; }
.channel-manager-head p { margin:0; font-size:12px; }
.channel-card-list { display:flex; flex-direction:column; gap:12px; }
.channel-card { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:17px 18px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft); }
.channel-card.configured { border-color:#dbeafe; background:linear-gradient(135deg,#fff 0%,#f7fbff 100%); box-shadow:0 8px 24px rgba(37,99,235,.06); }
.channel-card-main { display:flex; align-items:flex-start; gap:14px; min-width:0; }
.channel-icon { width:46px; height:46px; flex:0 0 46px; display:flex; align-items:center; justify-content:center; border-radius:13px; color:#fff; background:linear-gradient(135deg,#3b82f6,#1d4ed8); font-size:22px; }
.channel-icon.wechat { background:linear-gradient(135deg,#22c55e,#15803d); }
.channel-icon.alipay_direct { background:linear-gradient(135deg,#0ea5e9,#0369a1); }
.channel-info { min-width:0; }
.channel-title { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.channel-title strong { font-size:15px; }
.channel-title .mono { color:var(--muted); font-size:10px; }
.channel-info p { margin:6px 0 0; color:var(--text-secondary); font-size:12px; line-height:1.55; }
.channel-meta { display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin-top:9px; }
.channel-meta span { padding:3px 7px; border-radius:6px; color:#475569; background:#eef2f7; font-family:"SF Mono",Menlo,monospace; font-size:10px; }
.channel-meta em { color:var(--muted); font-size:10px; font-style:normal; }
.channel-card-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; flex:0 0 auto; }
@media (max-width: 767.98px) {
  .channel-card { align-items:stretch; flex-direction:column; padding:15px; }
  .channel-card-actions { justify-content:stretch; }
  .channel-card-actions .btn { flex:1 1 calc(50% - 7px); }
  .table-actions { min-width:220px; }
}
.detail-toolbar { margin-bottom:12px; padding:11px 12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-soft); }
.detail-toolbar .form-control, .detail-toolbar .form-select { min-height:38px; }

/* ---------- H5 integration guide ---------- */
.integration-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.integration-facts .mono { line-height: 1.55; word-break: break-word; }
.integration-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.integration-guide > div { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.integration-guide strong { display: block; margin-bottom: 5px; font-size: 13px; }
.integration-guide p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.step-no { width: 27px; height: 27px; flex: 0 0 27px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); font-size: 12px; font-weight: 800; }
.integration-code { max-height: 370px; overflow: auto; padding: 17px; border: 1px solid #dbe3ee; border-radius: 12px; color: #dbeafe; background: #0f172a; font-size: 12px; line-height: 1.65; tab-size: 2; white-space: pre; }
.integration-actions { justify-content: flex-start; }
@media (max-width: 991.98px) {
  .integration-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .integration-facts, .integration-guide { grid-template-columns: 1fr; }
  .integration-code { margin-inline: -2px; font-size: 11px; }
}
