﻿:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1d2129;
  --muted: #86909c;
  --line: #e5e6eb;
  --accent: #165dff;
  --accent-2: #4080ff;
  --accent-dark: #1d2129;
  --gold: #f5a700;
  --accent-ink: #ffffff;
  --warn: #a15c07;
  --danger: #b42318;
  --ok: #087443;
  --brand-gradient: #165dff;
  --brand-soft-gradient: #e8f0ff;
  --shadow: 0 18px 48px rgba(29, 33, 41, .12);
  --soft-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfffd 0%, var(--bg) 48%, #f8fffb 100%);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(82, 201, 154, .24);
  outline-offset: 1px;
  border-color: var(--accent);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #fbfffd 0%, #e9f8ef 48%, #ffffff 100%);
}
.login-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 24px;
  padding: 28px 40px 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-head {
  display: grid;
  gap: 12px;
  min-height: 0;
}
.login-language-row {
  display: flex;
  justify-content: flex-end;
  min-height: 56px;
}
.login-brand {
  display: grid;
  place-items: center;
  padding: 2px 0 8px;
}
.login-logo {
  display: block;
  width: min(282px, 100%);
  height: auto;
  max-height: 282px;
  object-fit: contain;
  border-radius: 8px;
}
.login-head .language-field {
  position: static;
  width: 178px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 30px; }
h2 { margin-bottom: 0; font-size: 24px; }
h3 { margin-bottom: 0; font-size: 18px; }
.form-grid {
  display: grid;
  gap: 14px;
}

.modal-box .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.modal-box .form-note,
.modal-box .form-field.wide,
.modal-box .form-section-title,
.modal-box .password-step {
  grid-column: 1 / -1;
}
label {
  display: grid;
  gap: 7px;
  color: #364152;
  font-size: 13px;
}
label small {
  color: #7b8794;
  font-size: 12px;
  line-height: 1.4;
}
.clearable-input {
  position: relative;
  display: block;
}
.clearable-input input {
  padding-right: 36px;
}
.clearable-input button {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 22px;
  height: 22px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: #667085;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .12s ease, background .12s ease;
}
.clearable-input:hover button,
.clearable-input:focus-within button {
  opacity: 1;
}
.clearable-input button:hover {
  background: #e0e7f0;
  color: #1f2937;
}
.datetime-input {
  display: grid;
  gap: 8px;
}
.datetime-input .datetime-value {
  width: 100%;
}
.datetime-parts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 80px;
  gap: 8px;
}
.datetime-parts input,
.datetime-parts select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font-size: 14px;
}
.form-note {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #cfe8d8;
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfffd 0%, #edf9f2 100%);
  color: #344054;
  font-size: 13px;
  line-height: 20px;
}
.form-note span {
  color: #0d5f45;
  font-weight: 800;
}
.form-note p {
  margin: 0;
}
.form-section-title {
  padding: 10px 14px;
  border-radius: 6px;
  background: #1d9bf0;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.language-field {
  min-width: 118px;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.language-field select {
  min-height: 34px;
  padding: 6px 8px;
}
input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] {
  background: #f2f4f7;
  color: #667085;
  cursor: not-allowed;
}

input[type="file"] {
  padding: 7px 10px;
}
textarea { min-height: 88px; resize: vertical; }
.primary, .ghost, .soft, .danger {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}
.primary { background: var(--brand-gradient); color: var(--accent-ink); box-shadow: 0 8px 18px rgba(18, 147, 99, .18); }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.soft { background: #eef9f3; color: var(--accent); }
.danger { background: #fff1f0; color: var(--danger); }
.primary:hover { filter: brightness(.97); }
.ghost:hover, .soft:hover, .danger:hover { filter: brightness(.98); }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 16px;
  background: linear-gradient(180deg, #e7f8ef 0%, #d8f0e2 48%, #cde9dc 100%);
  color: var(--ink);
  box-shadow: 1px 0 0 rgba(255,255,255,.06) inset;
  min-width: 0;
}
.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "logo name"
    "logo user";
  column-gap: 10px;
  row-gap: 2px;
  min-height: 64px;
  align-content: center;
  align-items: center;
  padding: 0 12px 16px;
  border-bottom: 1px solid rgba(18, 147, 99, .16);
  position: relative;
}
.brand-logo {
  grid-area: logo;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}
.brand strong {
  grid-area: name;
  min-width: 0;
  color: #0b3b2b;
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
}
.brand span {
  grid-area: user;
  min-width: 0;
  overflow: hidden;
  color: #5f756b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-toggle {
  position: absolute;
  right: 0;
  top: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #4e5969;
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--soft-shadow);
}
.sidebar-toggle:hover {
  color: var(--accent);
  border-color: rgba(22, 93, 255, .28);
}
nav {
  display: grid;
  gap: 12px;
  align-content: start;
}
.nav-group {
  display: grid;
  gap: 4px;
}
.nav-group-title,
.nav-group-title-btn {
  padding: 10px 12px 4px;
  color: #668276;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
.nav-group-title-btn {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}
.nav-group-title-btn:hover {
  background: rgba(22, 93, 255, .06);
  color: var(--accent);
}
.nav-group-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-group-chevron {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
  transition: transform .16s ease;
}
.nav-group-title-btn.collapsed .nav-group-chevron {
  transform: rotate(-90deg);
}
.nav-group-items {
  display: grid;
  gap: 4px;
}
.nav-btn {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: #31564a;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.nav-btn.active, .nav-btn:hover {
  background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(82,201,154,.24));
  color: #0d5f45;
}
.sidebar .ghost {
  margin-top: auto;
  min-height: 42px;
  color: #31564a;
  border-color: rgba(18, 147, 99, .22);
}
.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  background: linear-gradient(90deg, #ffffff 0%, #f2fbf6 62%, #e8f8ef 100%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.topbar-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}
.notification-center {
  position: relative;
  align-self: end;
}
.notification-trigger {
  position: relative;
  min-height: 34px;
  min-width: 76px;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  padding: 0 12px;
  background: #ffffff;
  color: #4e5969;
  font-weight: 700;
}
.notification-trigger:hover {
  border-color: #165dff;
  color: #165dff;
}
.notification-trigger em {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 9px;
  padding: 0 5px;
  background: #f53f3f;
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 128px;
  height: 42px;
  padding: 4px 10px 4px 6px;
}
.account-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: #165dff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}
.account-label {
  display: grid;
  min-width: 0;
  text-align: left;
  line-height: 1.15;
}
.account-label strong,
.account-menu-head strong {
  max-width: 118px;
  overflow: hidden;
  color: #1d2129;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-label small,
.account-menu-head small {
  color: #86909c;
  font-size: 11px;
}
.notification-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}
.notification-menu-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid #f2f3f5;
}
.account-menu-head {
  justify-content: flex-start;
}
.account-menu-head > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.theme-toggle {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #ffffff;
  color: #4e5969;
  white-space: nowrap;
}
.notification-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: #4e5969;
  font-size: 12px;
  font-weight: 700;
}
.notification-sound-toggle input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}
.notification-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-top: 10px;
}
.notification-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  border: 1px solid #e5e6eb;
  border-left: 4px solid #165dff;
  border-radius: 4px;
  padding: 8px 10px;
  background: #ffffff;
  color: #1d2129;
  text-align: left;
}
.notification-item.warn {
  border-left-color: #ff7d00;
}
.notification-item.danger {
  border-left-color: #f53f3f;
}
.notification-item span,
.notification-empty {
  color: #86909c;
  font-size: 12px;
}
.content {
  padding: 16px 22px 28px;
  display: grid;
  gap: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.stat {
  min-height: 78px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fbf5 100%);
  border: 1px solid #cfe8d8;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
.stat strong { display: block; font-size: 22px; margin-top: 3px; color: var(--accent-dark); }
.merchant-balance-summary {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 2px 0 8px;
  color: var(--ink);
}
.merchant-balance-summary > span {
  align-self: center;
  font-size: 14px;
  font-weight: 700;
}
.merchant-balance-summary strong {
  min-width: 86px;
  padding: 6px 10px;
  border: 1px solid #7c7cff;
  border-radius: 5px;
  color: #6f6cff;
  font-size: 12px;
  line-height: 18px;
  background: #fff;
}
.mini-list {
  display: grid;
  gap: 4px;
  min-width: 150px;
  max-height: 104px;
  overflow: auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #4e5969;
  font-size: 12px;
  line-height: 18px;
}
.mini-list strong {
  color: #00a6a6;
  font-weight: 800;
}
.merchant-fee-list span {
  display: grid;
  gap: 1px;
}
.merchant-fee-list em {
  color: #8a94a6;
  font-style: normal;
  font-weight: 800;
}
.merchant-fee-list small {
  color: #4e5969;
  font-size: 12px;
}
.merchant-fee-list .fee-extra {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.currency-balance-list {
  display: grid;
  gap: 4px;
  min-width: 128px;
  font-size: 12px;
  line-height: 18px;
}
.currency-balance-list span {
  display: grid;
  gap: 1px;
}
.currency-balance-list strong {
  color: #1d2129;
  font-size: 12px;
}
.currency-balance-list em {
  color: #6f6cff;
  font-style: normal;
  font-weight: 800;
}
.legacy-balance-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.legacy-balance-summary strong {
  min-width: 92px;
  padding: 7px 10px;
  border: 1px solid #7c7cff;
  border-radius: 5px;
  color: #6f6cff;
  background: #fff;
  font-size: 12px;
  line-height: 18px;
}
.trader-fee-list {
  max-height: 112px;
  min-width: 172px;
}
.trader-payout-info {
  display: grid;
  gap: 3px;
  min-width: 190px;
  color: #4e5969;
  font-size: 12px;
  line-height: 18px;
}
.trader-payout-info strong {
  display: block;
  margin-top: 3px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #1d9bf0;
  color: #fff;
  font-size: 12px;
}
.trader-payout-info span {
  color: #2563eb;
  font-weight: 800;
}
.trader-payout-info .danger-text {
  color: #f04438;
}
.switch-button.readonly {
  display: inline-block;
  pointer-events: none;
}
.legacy-trader-table td {
  height: 88px;
}
.legacy-trader-table .trader-balance-list {
  min-width: 0;
  width: 100%;
  white-space: normal;
  justify-items: end;
}
.legacy-trader-table .trader-balance-list span {
  display: block;
  width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.legacy-trader-table .trader-balance-list strong {
  display: inline;
  margin-left: 4px;
  white-space: nowrap;
}
.legacy-team-table td {
  height: 96px;
  vertical-align: middle;
}
.team-name-pill {
  display: inline-grid;
  gap: 2px;
  max-width: 150px;
  padding: 6px 12px;
  border: 1px solid #72b8ff;
  border-radius: 999px;
  background: #f7fbff;
  color: #1976d2;
  font-weight: 800;
  text-align: left;
}
.team-name-pill small {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 700;
}
.team-amount-pair {
  display: grid;
  gap: 2px;
  min-width: 96px;
  white-space: nowrap;
}
.team-amount-pair strong {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}
.team-amount-pair span {
  color: #f04438;
  font-size: 12px;
  font-weight: 800;
}
.team-channel-list {
  display: grid;
  gap: 8px;
  max-height: 170px;
  min-width: 230px;
  overflow: auto;
  padding: 4px 2px;
  color: #4e5969;
  font-size: 12px;
  line-height: 18px;
}
.team-channel-line {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 2px 8px;
  align-items: center;
}
.team-channel-line span {
  grid-row: span 2;
  color: #9aa3b2;
  font-weight: 800;
}
.team-channel-line em {
  color: #1f7a36;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}
.team-channel-flag {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 18px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}
.team-channel-flag:disabled {
  cursor: wait;
  opacity: .72;
}
.team-channel-flag.is-yes {
  background: #41b85a;
}
.team-channel-flag.is-no {
  background: #ff4d4f;
}
.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #41b85a;
  color: #fff;
  font-weight: 900;
}
.modal-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 12px;
}
.modal-toolbar .primary,
.modal-toolbar button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
}
.switch-button {
  width: 44px;
  min-height: 24px;
  padding: 2px;
  border-radius: 999px;
  background: #d8dde6;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
  transition: background .15s ease;
}
.switch-button span {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .18);
  transition: transform .15s ease;
}
.switch-button.on {
  background: #4080ff;
}
.switch-button.on span {
  transform: translateX(20px);
}
.workbench {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}
.dashboard-panel {
  min-width: 0;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
.dashboard-panel h3 {
  margin-bottom: 8px;
  font-size: 15px;
  color: #0d5f45;
}
.dashboard-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dashboard-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  color: #344054;
  font-size: 13px;
}
.recent-panel {
  padding: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f6fdf9 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
.quick-card {
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}
.dashboard-panel .workbench {
  grid-template-columns: 1fr;
  gap: 8px;
}
.dashboard-panel .quick-card {
  min-height: 36px;
  padding: 9px 11px;
  font-size: 13px;
}
.quick-card:hover {
  border-color: rgba(18, 147, 99, .34);
  color: var(--accent);
}

.system-settings-modal {
  display: grid;
  gap: 14px;
}

.system-settings-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 18px rgba(255, 255, 255, .92);
}

.system-settings-tabs button {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 70px;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #667085;
  font-weight: 800;
}

.system-settings-tabs button:hover,
.system-settings-tabs button.active {
  border-bottom-color: var(--accent);
  background: #eef9f3;
  color: var(--accent);
}

.system-settings-tabs svg {
  width: 22px;
  height: 22px;
}

.system-settings-card {
  display: grid;
  gap: 10px;
}

.system-settings-card h4 {
  margin: 0;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 16px;
}

.system-settings-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legacy-money-settings {
  display: grid;
  gap: 34px;
  padding-top: 34px;
}

.legacy-money-section {
  display: grid;
  gap: 16px;
}

.legacy-money-section h4 {
  margin: 0;
  padding: 13px 18px;
  border-radius: 5px;
  background: #2196f3;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.legacy-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
}

.legacy-time-field {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 14px;
  font-weight: 700;
}

.legacy-time-field:first-child {
  color: var(--accent);
}

.legacy-time-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #9aa4b2;
}

.legacy-time-input input {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
}

.legacy-time-input input:focus {
  outline: none;
}

.legacy-time-icon {
  color: #737b86;
  font-size: 24px;
  line-height: 1;
}

.legacy-money-actions {
  position: sticky;
  bottom: -18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px -4px -4px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.legacy-money-actions span {
  color: var(--muted);
  font-size: 13px;
}

.legacy-order-settings {
  display: grid;
  gap: 22px;
  padding-top: 8px;
  font-size: 14px;
}

.legacy-order-section {
  display: grid;
  gap: 16px;
}

.legacy-order-section h4 {
  margin: 0;
  padding: 12px 16px;
  border-radius: 4px;
  background: #2196f3;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
}

.legacy-order-route {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
}

.legacy-order-route-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #f8fafc;
}

.legacy-order-route-card span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #175cd3;
  font-size: 12px;
  font-weight: 800;
}

.legacy-order-route-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.legacy-order-route-card p,
.legacy-order-help {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

.legacy-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px 34px;
}

.legacy-order-input,
.legacy-order-select {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 10px 12px 8px;
  border-radius: 5px 5px 0 0;
  background: #f1f3f5;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.legacy-order-input input,
.legacy-order-select select {
  min-height: 32px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #9aa4b2;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
}

.legacy-order-input input:focus,
.legacy-order-select select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.legacy-order-input small,
.legacy-order-switch small {
  color: #7b8794;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
}

.legacy-order-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px 34px;
}

.legacy-order-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
  min-height: 54px;
  color: #5f6673;
  font-size: 15px;
  font-weight: 800;
}

.legacy-order-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.legacy-order-switch > span {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background: #d4d8dd;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}

.legacy-order-switch > span::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .22);
  transition: transform .16s ease;
}

.legacy-order-switch input:checked + span {
  background: #78b7f4;
}

.legacy-order-switch input:checked + span::after {
  transform: translateX(22px);
  background: #1f8ee9;
}

.legacy-order-switch small {
  grid-column: 2;
}

.legacy-order-radio {
  display: grid;
  gap: 12px;
}

.legacy-order-radio h5 {
  margin: 0;
  color: #667085;
  font-size: 15px;
  font-weight: 800;
}

.legacy-order-radio > div {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.legacy-order-radio label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #5f6673;
  font-size: 15px;
  font-weight: 700;
}

.legacy-order-radio input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.legacy-order-actions {
  position: sticky;
  bottom: -18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.legacy-order-actions span {
  color: var(--muted);
  font-size: 13px;
}

.system-channel-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

.system-channel-list {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: 620px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.system-channel-option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.system-channel-option:hover,
.system-channel-option.active {
  border-color: rgba(37, 99, 235, .28);
  background: #eaf2ff;
}

.system-channel-option span {
  color: var(--muted);
  font-size: 12px;
}

.system-channel-detail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.system-channel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.system-channel-title div {
  display: grid;
  gap: 3px;
}

.system-channel-title span {
  color: var(--muted);
  font-size: 12px;
}

.system-channel-form {
  align-items: start;
}

.system-channel-form-v2 {
  display: grid;
  gap: 22px;
}

.system-channel-picker {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
  padding: 16px 26px;
  border-radius: 40px;
  background: #f1f3f5;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.system-channel-picker select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  outline: none;
}

.system-channel-main-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 28px;
  padding: 2px 4px 4px;
}

.system-channel-section {
  display: grid;
  gap: 12px;
}

.system-channel-section h5 {
  margin: 0;
  padding: 12px 16px;
  border-radius: 6px;
  background: #2294e8;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

.system-channel-section-grid {
  align-items: end;
}

.system-channel-section-grid small {
  display: block;
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
}

.system-channel-section-grid .form-field input,
.system-channel-section-grid .form-field textarea {
  background: #f1f3f5;
}

.legacy-channel-card {
  gap: 14px;
  font-size: 14px;
}

.legacy-channel-card .system-channel-form-v2 {
  gap: 18px;
}

.legacy-channel-card .system-channel-section-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px 26px;
  align-items: start;
}

.legacy-channel-card .system-field-with-note.wide {
  grid-column: 1 / -1;
}

.legacy-channel-card .system-field-with-note {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.legacy-channel-card .system-channel-section {
  gap: 10px;
}

.legacy-channel-card .system-channel-section h5 {
  padding: 10px 14px;
  border-radius: 4px;
  background: #2196f3;
  font-size: 15px;
  line-height: 1.3;
}

.legacy-channel-card .system-field-with-note .form-field {
  gap: 4px;
  min-height: 70px;
  padding: 10px 12px 8px;
  border-radius: 5px 5px 0 0;
  background: #f1f3f5;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.legacy-channel-card .system-field-with-note .form-field input,
.legacy-channel-card .system-field-with-note .form-field textarea {
  min-height: 30px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #9aa4b2;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
}

.legacy-channel-card .system-field-with-note .form-field input:focus,
.legacy-channel-card .system-field-with-note .form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.legacy-channel-card .system-field-with-note small {
  margin: 0 0 0 2px;
  color: #7b8794;
  font-size: 12px;
  line-height: 1.35;
}

.legacy-channel-card .system-channel-section:has(.system-fixed-amounts),
.legacy-channel-card .system-channel-section:last-of-type {
  padding: 0 0 4px;
}

.system-fixed-amounts {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d9dde5;
  border-radius: 6px;
  background: #ffffff;
}

.system-fixed-title {
  display: block;
  color: #1f2937;
  font-size: 15px;
  font-weight: 800;
}

.system-fixed-list {
  min-height: 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.system-fixed-empty {
  color: #1f2937;
  font-size: 14px;
}

.system-fixed-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #165dff;
  font-weight: 800;
}

.system-fixed-chip button {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(22, 93, 255, .12);
  color: #165dff;
  font-size: 14px;
  line-height: 1;
}

.system-fixed-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.system-fixed-add input {
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid #aeb6c2;
  background: #f1f3f5;
  color: var(--ink);
  font-size: 16px;
}

.fixed-amount-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 160px;
  max-width: 260px;
}

.fixed-amount-preview span,
.fixed-amount-preview em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #165dff;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.system-switch-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: #5f6673;
  font-size: 15px;
  font-weight: 800;
}

.system-switch-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.system-switch-field span {
  position: relative;
  width: 48px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d4d8dd;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}

.system-switch-field span::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .22);
  transition: transform .16s ease;
}

.system-switch-field input:checked + span {
  background: #78b7f4;
}

.system-switch-field input:checked + span::after {
  transform: translateX(22px);
  background: #1f8ee9;
}

.system-channel-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.system-channel-actions span {
  color: var(--muted);
  font-size: 12px;
}

.system-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8fa;
}

.system-setting-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.system-setting-row strong {
  color: var(--ink);
  font-size: 15px;
}

.system-setting-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.system-setting-value {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.system-setting-value em {
  display: block;
  max-width: 240px;
  overflow: hidden;
  color: #344054;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-setting-value .small {
  min-height: 30px;
  padding: 5px 10px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f5fdf8 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.filter-bar label {
  flex: 0 1 180px;
  min-width: min(180px, 100%);
}
.filter-bar label:first-child {
  flex-basis: 260px;
}
.filter-bar button {
  flex: 0 0 auto;
  min-width: 92px;
}
.order-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.mode-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mode-toggle {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}
.mode-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.legacy-order-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.legacy-order-toolbar .primary,
.legacy-order-toolbar .soft,
.legacy-order-toolbar .danger {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(8, 145, 178, .2);
}
.legacy-order-toolbar .primary {
  background: #0ea5e9;
  color: #fff;
}
.legacy-order-panel {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}
.legacy-order-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.legacy-order-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
}
.legacy-order-title strong {
  font-weight: 700;
}
.legacy-order-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}
.legacy-order-panel .icon-btn {
  position: static;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
  font-size: 20px;
}
.legacy-order-panel .icon-btn:hover {
  background: #f1f5f9;
  color: var(--accent);
}
.batch-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 14px 8px;
  font-size: 12px;
}
.order-select {
  width: 18px;
  height: 18px;
}
.order-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px 8px;
}
.order-stat-card {
  min-width: 92px;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid #8fd8ee;
  border-radius: 14px;
  background: #fbfeff;
  color: #1785a8;
}
.order-stat-card:nth-child(1) {
  border-color: #111827;
  color: #111827;
}
.order-stat-card:nth-child(2) {
  border-color: #8b7cf6;
  color: #6254e8;
}
.order-stat-card:nth-child(3) {
  border-color: #fb923c;
  color: #f97316;
}
.order-stat-card span {
  display: block;
  font-size: 12px;
  font-weight: 800;
}
.order-stat-card strong {
  display: block;
  margin-top: 2px;
  color: currentColor;
  font-size: 13px;
  font-weight: 800;
}
.payout-mode-bar {
  margin: 0 0 4px;
  padding: 2px 2px 0;
}
.payout-summary-grid {
  align-items: flex-start;
  gap: 6px;
  padding: 10px 14px 6px;
}
.payout-summary-grid .order-stat-card {
  min-width: 104px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 12px;
}
.payout-summary-grid .order-stat-card span {
  font-size: 11px;
  line-height: 1.15;
}
.payout-summary-grid .order-stat-card strong {
  font-size: 12px;
  line-height: 1.2;
}
.order-filter-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--panel);
  border: 0;
  border-radius: 8px;
}
.order-filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(15, 23, 42, .24);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.order-filter-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.order-filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 46;
  display: flex;
  width: min(560px, calc(100vw - 24px));
  max-width: 100%;
  background: #fff;
  box-shadow: -10px 0 28px rgba(15, 23, 42, .18);
  transform: translateX(108%);
  transition: transform .18s ease;
}
.order-filter-drawer.open {
  transform: translateX(0);
}
.order-filter-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 0;
}
.order-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.order-filter-title {
  display: flex;
  align-items: center;
  gap: 16px;
}
.order-filter-title strong {
  font-size: 18px;
}
.order-filter-title button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  letter-spacing: 1px;
}
.order-filter-close {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  color: #64748b;
  font-size: 28px;
  line-height: 1;
}
.order-filter-body {
  min-height: 0;
  padding: 18px 22px 20px;
  overflow: auto;
}
.order-filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border-radius: 4px;
  overflow: hidden;
  background: #f5f5f5;
}
.order-filter-tabs span {
  min-width: 0;
  padding: 12px 10px;
  color: #334155;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.order-filter-tabs .active {
  background: #d4d4d4;
}
.order-amount-mode {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 700;
}
.order-amount-mode label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.order-amount-mode input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.order-amount-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.order-amount-exact.hidden,
.order-amount-range.hidden {
  display: none;
}
.order-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.order-filter-grid .wide,
.order-amount-exact .wide {
  grid-column: 1 / -1;
}
.order-filter-form .form-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}
.order-filter-form input,
.order-filter-form select {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font-size: 15px;
  font-weight: 500;
}
.order-filter-form .clearable-input button {
  right: 6px;
}
.order-filter-time {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.order-filter-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.legacy-shortcut {
  width: auto;
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 4px;
  background: #009688;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .22);
}
.legacy-shortcut:hover {
  background: #008577;
}
.order-filter-time-type {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 14px;
  color: #334155;
  font-size: 15px;
  font-weight: 700;
}
.order-filter-time-type label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.order-filter-time-type input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.order-filter-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.order-filter-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.order-filter-footer .primary,
.order-filter-footer .ghost {
  min-width: 88px;
}
.order-filter-static {
  display: block;
  margin: 0 14px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.order-filter-static .filter-static-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.order-filter-static .filter-static-toggle {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.order-filter-static.collapsed .order-filter-body {
  display: none;
}
.order-filter-static .filter-bar {
  margin: 0;
  border: 0;
  border-top: 1px dashed var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
}
.legacy-order-panel .time-shortcuts .ghost {
  min-height: 30px;
  padding: 5px 10px;
  border: 0;
  border-radius: 4px;
  background: #009688;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 2px 5px rgba(0, 150, 136, .22);
}
.legacy-order-panel .time-shortcuts .muted {
  display: none;
}
.legacy-order-panel .result-summary,
.legacy-order-panel .result-summary strong {
  font-size: 12px;
}
.legacy-order-panel .result-summary strong {
  color: #111827;
}
.time-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.time-shortcuts button {
  min-height: 30px;
  padding: 5px 12px;
}
.order-lookup-tools {
  gap: 8px;
}
.order-lookup-table {
  font-size: 12px;
}
.order-lookup-no .cell-code {
  color: #2563eb;
}
.lookup-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.lookup-actions button,
.icon-link {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #eef2ff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}
.lookup-actions .icon-success {
  color: #16a34a;
  background: #ecfdf5;
}
.lookup-actions .icon-danger {
  color: #dc2626;
  background: #fef2f2;
}
.icon-link {
  border-radius: 6px;
  color: #2563eb;
  background: transparent;
}
.query-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.query-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 12px;
}
.query-chip button {
  border: 0;
  background: #9ca3af;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  line-height: 16px;
  cursor: pointer;
}
.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.query-range {
  color: var(--ink);
  font-weight: 600;
}
.summary-separator {
  color: #c9cdd4;
  padding: 0 2px;
}
.result-summary strong {
  color: var(--ink);
  font-size: 18px;
}
.row-action-menu {
  position: relative;
  display: inline-block;
}
.row-action-menu[open] {
  z-index: 10020;
}
.row-action-menu summary {
  width: 42px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}
.row-action-menu summary::-webkit-details-marker {
  display: none;
}
.row-action-menu .row-action-panel {
  position: absolute;
  right: 0;
  top: 36px;
  z-index: 20;
  min-width: 190px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.row-action-menu[open] .row-action-panel {
  position: fixed;
  right: auto;
  z-index: 10030;
}
.row-action-menu button {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.row-action-menu button:hover {
  background: #eef5ff;
  color: var(--accent-dark);
}
.row-action-menu button.primary-action {
  color: #2563eb;
}
.row-action-menu button.success-action {
  color: #16a34a;
}
.row-action-menu button.danger-action {
  color: #dc2626;
}
.row-action-menu button.danger {
  color: #dc2626;
}
.row-action-menu button.primary-action:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.row-action-menu button.success-action:hover {
  background: #ecfdf5;
  color: #15803d;
}
.row-action-menu button.danger-action:hover {
  background: #fef2f2;
  color: #b91c1c;
}
.row-action-menu button.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}
.row-action-divider {
  display: block;
  height: 1px;
  margin: 4px 2px;
  background: var(--line);
}
.payout-orders-table {
  font-size: 12px;
}
.payout-orders-table th {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.payout-orders-table td {
  padding: 10px 12px;
  line-height: 1.45;
  vertical-align: middle;
}
.payout-orders-table .cell-code,
.payout-orders-table .linkish {
  color: #2f80ed;
  font-weight: 700;
}
.payout-orders-table .copy-mini {
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #60a5fa;
  font-size: 12px;
  line-height: 1;
  box-shadow: none;
}
.payout-order-no .muted,
.payout-trader .muted,
.payout-date .muted {
  font-size: 11px;
}
.payout-row-id {
  color: #374151;
  font-weight: 700;
}
.payout-money span {
  color: #111827;
  font-size: 12px;
}
.payout-money strong {
  display: block;
  color: #6d6df5;
  font-size: 12px;
  font-weight: 800;
}
.payout-money-strong strong {
  color: #111827;
}
.payout-payee {
  color: #374151;
  font-size: 11px;
}
.payout-payee b {
  color: #ff4f64;
}
.payout-payee em {
  color: #009688;
  font-style: normal;
}
.payout-remark {
  color: #374151;
  font-size: 11px;
}
.payout-date {
  color: #9ca3af;
  font-size: 11px;
}
.payout-date .accent-line {
  color: #009688;
  font-weight: 700;
}
.payout-action-menu summary {
  width: 34px;
  min-height: 28px;
  border: 0;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 16px;
}
.payout-action-menu .row-action-panel {
  min-width: 128px;
}
.payout-action-menu button {
  min-height: 30px;
  font-size: 12px;
}
.filter-empty {
  margin: 0;
  background: var(--panel);
}
.table-shell {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.table-tools {
  display: flex;
  justify-content: flex-end;
}
.table-reset {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.table-reset:hover {
  color: var(--accent);
  border-color: rgba(18, 147, 99, .36);
}
.table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid var(--line);
}
th, td {
  height: 64px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  line-height: 20px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th:last-child,
td:last-child {
  border-right: 0;
}
th {
  position: relative;
  color: #475467;
  background: #f2fbf6;
  font-weight: 700;
}
.th-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 3px;
  width: 1px;
  background: transparent;
}
.col-resizer:hover::after,
body.resizing-columns .col-resizer::after {
  background: #65c99a;
}
body.resizing-columns {
  cursor: col-resize;
  user-select: none;
}
tbody tr:hover td {
  background: #f7fdf9;
}
.col-amount, .col-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.col-status {
  text-align: center;
}
.fill-cell {
  color: transparent;
}
th.col-action, td.col-action {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--panel);
  box-shadow: -1px 0 0 var(--line), -8px 0 14px rgba(15, 23, 42, .05);
}
th.col-action {
  z-index: 2;
  background: #f2fbf6;
}
tbody tr:hover td.col-action {
  background: #f7fdf9;
}
td.actions {
  overflow: visible;
  white-space: normal;
}
.legacy-order-panel .table-shell {
  gap: 4px;
}
.legacy-order-panel .table-tools {
  padding: 0 14px;
}
.legacy-order-panel .table-reset {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}
.legacy-order-panel .table-wrap {
  border-right: 0;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: none;
}
.orders-table th,
.orders-table td {
  height: 56px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 18px;
}
.orders-table th {
  background: #fff;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}
.orders-table tbody tr:hover td {
  background: #fafafa;
}
.orders-table .cell-code {
  color: #2f80ed;
  font-weight: 700;
}
.orders-table .muted {
  color: #9aa4b2;
  font-size: 12px;
}
.orders-table .badge {
  font-size: 12px;
  padding: 3px 8px;
}
.orders-table .row-action-menu summary {
  width: 34px;
  min-height: 30px;
  border: 0;
  background: #e5e7eb;
  font-size: 18px;
}
.orders-table .row-action-menu .row-action-panel {
  min-width: 148px;
  border-radius: 4px;
}
.orders-table .row-action-menu button {
  min-height: 28px;
  padding: 6px 9px;
  font-size: 13px;
}
.action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: 100%;
}
.action-group button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}
.empty-cell {
  height: 64px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: #e7f8ef; color: var(--ok); }
.badge.warn { background: #fff4df; color: var(--warn); }
.badge.danger { background: #fff1f0; color: var(--danger); }
.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}
dialog {
  width: min(920px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(15, 23, 42, .42); }
.modal-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}
.modal-box header, .modal-box footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.modal-box header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 42px;
  background: var(--panel);
}
.modal-box footer {
  position: relative;
  z-index: 3;
  justify-content: flex-end;
  padding: 12px 0 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
#modalBody {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}
.icon-btn {
  position: sticky;
  top: 0;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #f2f4f7;
  color: var(--ink);
  font-size: 20px;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  background: #17202a;
  color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.kv-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.kv-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}
.kv-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.detail-section {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.detail-section h4 {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .app-shell.sidebar-collapsed .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .app-shell.sidebar-collapsed .brand {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
      "logo name"
      "logo user";
    justify-items: stretch;
    min-height: 64px;
    padding: 0 12px 16px;
  }
  .app-shell.sidebar-collapsed .brand strong,
  .app-shell.sidebar-collapsed .brand span,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .nav-group-title,
  .app-shell.sidebar-collapsed #logoutBtn {
    display: revert;
  }
  .app-shell.sidebar-collapsed .nav-btn {
    justify-content: flex-start;
    padding: 0 12px;
  }
  .app-shell.sidebar-collapsed .sidebar-toggle {
    right: 0;
    top: 6px;
  }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench, .dashboard-grid, .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .system-settings-tabs { grid-template-columns: repeat(3, minmax(88px, 1fr)); }
  .legacy-time-grid { grid-template-columns: 1fr; gap: 20px; }
  .legacy-order-route,
  .legacy-order-grid,
  .legacy-order-switch-grid {
    grid-template-columns: 1fr;
  }
  .system-channel-layout { grid-template-columns: 1fr; }
  .system-channel-list { max-height: 220px; }
}

@media (max-width: 560px) {
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .stats, .workbench, .dashboard-grid, .kv-grid { grid-template-columns: 1fr; }
  .modal-box .form-grid { grid-template-columns: 1fr; }
  .legacy-money-actions { align-items: stretch; flex-direction: column; }
  .legacy-money-actions .primary { width: 100%; }
  .topbar-actions { display: grid; width: 100%; }
  .account-trigger { width: 100%; justify-content: flex-start; }
  .account-label strong { max-width: 180px; }
  .login-panel { padding: 24px 20px 28px; }
  .login-language-row { justify-content: center; min-height: 48px; }
  .login-head .language-field { width: min(178px, 100%); }
  .login-logo { width: min(260px, 100%); }
}

/* NEW-JIFEN-MALL-GAME 后台主题：浅灰背景、白色面板、蓝色主操作。 */
body {
  background: #f5f7fa;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(22, 93, 255, .28);
  border-color: #165dff;
}

.login-shell {
  background: #f5f7fa;
}

.login-panel,
.stat,
.dashboard-panel,
.recent-panel,
.filter-bar,
.table-wrap,
.kv-item,
dialog,
.modal-box footer {
  background: #ffffff;
  border-color: #e5e6eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.form-note {
  border-color: #e5e6eb;
  background: #f7f8fa;
}

.form-note span,
.dashboard-panel h3 {
  color: #1d2129;
}

.primary {
  background: #165dff;
  box-shadow: none;
}

.primary:hover {
  background: #0e4bd8;
  filter: none;
}

.soft {
  background: transparent;
  color: #165dff;
}

.ghost {
  background: #ffffff;
  color: #4e5969;
  border-color: #e5e6eb;
}

.sidebar {
  background: #ffffff;
  color: #1d2129;
  border-right: 1px solid #e5e6eb;
  box-shadow: none;
}

.brand {
  border-bottom-color: #e5e6eb;
}

.brand strong {
  color: #1d2129;
}

.brand span,
.nav-btn {
  color: #4e5969;
}

.nav-btn.active,
.nav-btn:hover {
  color: #165dff;
  background: #e8f0ff;
}

.sidebar .ghost {
  color: #4e5969;
  border-color: #e5e6eb;
  background: #ffffff;
}

.topbar {
  background: #ffffff;
  border-bottom-color: #e5e6eb;
}

.eyebrow {
  color: #86909c;
}

.stat strong {
  color: #1d2129;
}

.quick-card {
  background: #ffffff;
  border-color: #e5e6eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.quick-card:hover {
  border-color: #165dff;
  color: #165dff;
  box-shadow: 0 4px 14px rgba(22, 93, 255, .14);
}

.jump-tip {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 93, 255, .22);
  border-radius: 8px;
  background: #eef4ff;
  color: #165dff;
  font-size: 14px;
  font-weight: 700;
}

.account-action-grid .jump-card {
  border-color: #165dff;
  background: #165dff;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(22, 93, 255, .22);
}

.account-action-grid .jump-card:hover {
  border-color: #0e42d2;
  background: #0e42d2;
  color: #ffffff;
  transform: translateY(-1px);
}

.table-reset {
  border-color: #e5e6eb;
  color: #4e5969;
}

.table-reset:hover {
  color: #165dff;
  border-color: #165dff;
}

th,
th.col-action {
  color: #4e5969;
  background: #f7f8fa;
}

tbody tr:hover td,
tbody tr:hover td.col-action {
  background: #f7f8fa;
}

.col-resizer:hover::after,
body.resizing-columns .col-resizer::after {
  background: #165dff;
}

.badge {
  border: 1px solid #e5e6eb;
  background: #f7f8fa;
  color: #4e5969;
}

.badge.ok {
  border-color: #b7ebc6;
  background: #f2fff6;
  color: #00a870;
}

.badge.warn {
  border-color: #ffd8a6;
  background: #fff7ef;
  color: #b85d00;
}

.badge.danger {
  border-color: #f5c2c0;
  background: #fff3f3;
  color: #c21f1f;
}

.qr-thumb {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #fff;
}

.qr-thumb-frame {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 4px;
}

.qr-thumb-frame.is-missing::after,
.qr-thumb-empty {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px dashed #c9ced6;
  border-radius: 4px;
  background: #f7f8fa;
  color: #86909c;
  content: "无图";
  font-size: 12px;
  line-height: 1;
}

.toast {
  background: #1d2129;
  border-radius: 4px;
}

/* Requested admin polish: icons, regular text weight, compact tables and sortable headers. */
body,
button,
input,
select,
textarea,
label,
h1,
h2,
h3,
h4,
p,
span,
strong,
th,
.badge,
.nav-btn,
.primary,
.ghost,
.soft,
.danger,
.table-reset,
.notification-trigger,
.notification-sound-toggle,
.dashboard-panel h3,
.form-note span {
  font-weight: 400 !important;
}

.content {
  align-content: start;
}

.nav-btn {
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  box-sizing: border-box;
}

.nav-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .sidebar {
  gap: 12px;
  padding-left: 10px;
  padding-right: 10px;
}

.app-shell.sidebar-collapsed .brand {
  grid-template-columns: 1fr;
  grid-template-areas: "logo";
  justify-items: center;
  min-height: 66px;
  padding: 0 0 14px;
}

.app-shell.sidebar-collapsed .brand-logo {
  width: 38px;
  height: 38px;
}

.app-shell.sidebar-collapsed .brand strong,
.app-shell.sidebar-collapsed .brand span,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-group-title,
.app-shell.sidebar-collapsed .nav-group-title-btn,
.app-shell.sidebar-collapsed #logoutBtn {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  right: -4px;
  top: 46px;
}

.app-shell.sidebar-collapsed .nav-btn {
  justify-content: center;
  padding: 0;
}

.app-shell.sidebar-collapsed .nav-group-items.hidden {
  display: grid !important;
}

.app-shell.sidebar-collapsed .nav-icon {
  flex-basis: 20px;
  width: 20px;
  height: 20px;
}

@media (max-width: 900px) {
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .app-shell.sidebar-collapsed .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .app-shell.sidebar-collapsed .brand {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
      "logo name"
      "logo user";
    justify-items: stretch;
    min-height: 64px;
    padding: 0 12px 16px;
  }
  .app-shell.sidebar-collapsed .brand-logo {
    width: 42px;
    height: 42px;
  }
  .app-shell.sidebar-collapsed .brand strong,
  .app-shell.sidebar-collapsed .brand span,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .nav-group-title,
  .app-shell.sidebar-collapsed .nav-group-title-btn,
  .app-shell.sidebar-collapsed #logoutBtn {
    display: revert;
  }
  .app-shell.sidebar-collapsed .nav-btn {
    justify-content: flex-start;
    padding: 0 12px;
  }
  .app-shell.sidebar-collapsed .nav-group-items.hidden {
    display: none !important;
  }
  .app-shell.sidebar-collapsed .sidebar-toggle {
    right: 0;
    top: 6px;
  }
}

.filter-bar {
  align-self: start;
  align-items: center;
  min-height: 0;
  padding: 10px 12px;
}

.filter-bar label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  flex-basis: 240px;
  min-width: 220px;
  line-height: 20px;
  white-space: nowrap;
}

.filter-bar label:first-child {
  flex-basis: 300px;
}

.filter-bar input,
.filter-bar select {
  min-height: 34px;
  padding: 6px 10px;
}

.filter-bar button {
  min-height: 34px;
  padding: 6px 18px;
}

th,
td {
  height: 48px;
}

.sort-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  border: 0;
  padding: 0 12px 0 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.sort-mark {
  flex: 0 0 auto;
  color: #86909c;
  font-size: 12px;
}

.sortable-th:hover .sort-mark {
  color: #165dff;
}

.settings-table th,
.settings-table td {
  height: 54px;
  line-height: 18px;
}

.settings-table .col-long {
  white-space: normal;
  text-overflow: clip;
}

.settings-table .col-action {
  width: 88px;
}

.settings-table .action-group button {
  min-height: 26px;
  padding: 4px 8px;
}

.modal-box {
  gap: 14px;
}

.modal-box footer {
  position: relative;
  min-height: 46px;
  margin-top: 4px;
  padding: 10px 0 0;
  box-shadow: none !important;
}

.password-step {
  max-width: 520px;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff;
}

.choice-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.choice-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.choice-row strong {
  color: #1d2129;
  line-height: 20px;
}

.choice-row em {
  color: #86909c;
  font-style: normal;
  line-height: 18px;
}

.permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.permission-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.permission-group h4 {
  margin: 0;
  color: #1d2129;
  font-size: 15px;
}

.empty {
  padding: 14px;
  color: #86909c;
  border: 1px dashed #dcdfe6;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .permission-groups {
    grid-template-columns: 1fr;
  }
}

/* Keep operation pages visually consistent: same normal text size everywhere. */
body,
button,
input,
select,
textarea,
label,
p,
span,
strong,
th,
td,
.badge,
.nav-btn,
.primary,
.ghost,
.soft,
.danger,
.table-reset,
.notification-trigger,
.notification-sound-toggle,
.notification-item,
.notification-empty,
.filter-bar,
.kv-item,
.form-note {
  font-size: 14px !important;
}

.settings-table th,
.settings-table td {
  height: 54px;
  line-height: 20px;
  font-size: 14px !important;
}

.settings-table .action-group button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 14px !important;
}

.fill-cell {
  display: none;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101623;
  --panel: #161d2b;
  --ink: #e6edf7;
  --muted: #9aa8ba;
  --line: #263244;
  --accent: #4f8cff;
  --accent-2: #78a6ff;
  --accent-ink: #ffffff;
  --warn: #f6b95f;
  --danger: #ff7b72;
  --ok: #4fd18b;
  --brand-gradient: linear-gradient(135deg, #2f73ff 0%, #19b989 100%);
  --brand-soft-gradient: #18243a;
  --shadow: 0 18px 48px rgba(0, 0, 0, .34);
  --soft-shadow: 0 2px 10px rgba(0, 0, 0, .24);
  background: #101623;
  color: var(--ink);
}

body[data-theme="dark"] .login-shell,
body[data-theme="dark"] .app-shell {
  background: linear-gradient(180deg, #0e1420 0%, #101623 100%);
}

body[data-theme="dark"] .login-panel,
body[data-theme="dark"] .stat,
body[data-theme="dark"] .dashboard-panel,
body[data-theme="dark"] .recent-panel,
body[data-theme="dark"] .filter-bar,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .kv-item,
body[data-theme="dark"] dialog,
body[data-theme="dark"] .modal-box,
body[data-theme="dark"] .modal-box footer,
body[data-theme="dark"] .notification-menu,
body[data-theme="dark"] .quick-card {
  background: #161d2b;
  border-color: #263244;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}

body[data-theme="dark"] .jump-tip {
  border-color: rgba(73, 129, 255, .42);
  background: rgba(22, 93, 255, .14);
  color: #8fb2ff;
}

body[data-theme="dark"] .system-settings-tabs {
  background: var(--panel);
  box-shadow: 0 10px 18px rgba(22, 29, 43, .94);
}

body[data-theme="dark"] .account-action-grid .jump-card {
  border-color: #2f6bff;
  background: #2f6bff;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(47, 107, 255, .24);
}

body[data-theme="dark"] .account-action-grid .jump-card:hover {
  border-color: #5f8dff;
  background: #245be0;
  color: #ffffff;
}

body[data-theme="dark"] .system-channel-picker,
body[data-theme="dark"] .system-channel-section-grid .form-field input,
body[data-theme="dark"] .system-channel-section-grid .form-field textarea,
body[data-theme="dark"] .system-fixed-add input {
  background: #202a3a;
}

body[data-theme="dark"] .system-fixed-amounts {
  border-color: #263244;
  background: #161d2b;
}

body[data-theme="dark"] .system-fixed-empty {
  color: var(--ink);
}

body[data-theme="dark"] .system-fixed-chip {
  background: rgba(79, 140, 255, .16);
  color: #8fb2ff;
}

body[data-theme="dark"] .account-label strong,
body[data-theme="dark"] .account-menu-head strong {
  color: var(--ink);
}

body[data-theme="dark"] .account-label small,
body[data-theme="dark"] .account-menu-head small {
  color: #9aa4b2;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar {
  background: #121a27;
  border-color: #263244;
  color: var(--ink);
  box-shadow: none;
}

body[data-theme="dark"] .brand {
  border-bottom-color: #263244;
}

body[data-theme="dark"] .brand strong,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] .stat strong,
body[data-theme="dark"] .dashboard-panel h3,
body[data-theme="dark"] .choice-row strong,
body[data-theme="dark"] .permission-group h4 {
  color: #e6edf7;
}

body[data-theme="dark"] .brand span,
body[data-theme="dark"] .nav-btn,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] label,
body[data-theme="dark"] .language-field,
body[data-theme="dark"] .choice-row em {
  color: #9aa8ba;
}

body[data-theme="dark"] .login-logo {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}

body[data-theme="dark"] .nav-btn.active,
body[data-theme="dark"] .nav-btn:hover {
  color: #d7e6ff;
  background: #1d2b43;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #101827;
  color: #e6edf7;
  border-color: #2d3a4f;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #6f7e91;
}

body[data-theme="dark"] .primary {
  background: linear-gradient(135deg, #2f73ff 0%, #19b989 100%);
  color: #ffffff;
}

body[data-theme="dark"] .ghost,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .sidebar .ghost,
body[data-theme="dark"] .table-reset {
  background: #101827;
  color: #c4cfdd;
  border-color: #2d3a4f;
}

body[data-theme="dark"] .soft {
  background: #18243a;
  color: #8db5ff;
}

body[data-theme="dark"] .danger {
  background: #321b22;
  color: #ff9c96;
}

body[data-theme="dark"] th,
body[data-theme="dark"] th.col-action {
  color: #c4cfdd;
  background: #1a2332;
}

body[data-theme="dark"] td {
  color: #dce5f2;
}

body[data-theme="dark"] tbody tr:hover td,
body[data-theme="dark"] tbody tr:hover td.col-action {
  background: #1a2332;
}

body[data-theme="dark"] table,
body[data-theme="dark"] th,
body[data-theme="dark"] td {
  border-color: #263244;
}

body[data-theme="dark"] .form-note,
body[data-theme="dark"] .choice-row,
body[data-theme="dark"] .empty {
  background: #101827;
  border-color: #2d3a4f;
  color: #c4cfdd;
}

body[data-theme="dark"] .form-note span {
  color: #8db5ff;
}

body[data-theme="dark"] .badge {
  background: #1a2332;
  border-color: #2d3a4f;
  color: #c4cfdd;
}

body[data-theme="dark"] .badge.ok {
  border-color: #1f6f4a;
  background: #10291f;
  color: #66e29b;
}

body[data-theme="dark"] .badge.warn {
  border-color: #7a5521;
  background: #2a2115;
  color: #f6c06d;
}

body[data-theme="dark"] .badge.danger {
  border-color: #74333a;
  background: #2b171d;
  color: #ff9c96;
}

body[data-theme="dark"] .qr-thumb,
body[data-theme="dark"] .brand-logo {
  background: #ffffff;
  border-color: #2d3a4f;
}

body[data-theme="dark"] .sidebar-toggle {
  background: #172235;
  color: #d7e6ff;
  border-color: #263244;
}

body[data-theme="dark"] .qr-thumb-frame.is-missing::after,
body[data-theme="dark"] .qr-thumb-empty {
  border-color: #33445f;
  background: #111827;
  color: #91a4bf;
}

body[data-theme="dark"] .toast {
  background: #eef4ff;
  color: #101827;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
  align-content: start;
}

.guide-card {
  min-height: 0;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.guide-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--ink);
}

.guide-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  line-height: 1.6;
}

body[data-theme="dark"] .guide-card {
  background: #141d2b;
  border-color: #2d3a4f;
}

body[data-theme="dark"] .guide-card h3 {
  color: #e6edf7;
}

body[data-theme="dark"] .guide-card ul {
  color: #c4cfdd;
}

@media (max-width: 900px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.sort-header {
  gap: 4px;
  padding-right: 6px;
}

.sort-mark {
  font-size: 10px;
  line-height: 1;
}

.orders-table {
  min-width: 1320px !important;
}

.orders-table th,
.orders-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.orders-table .cell-code {
  display: -webkit-box;
  max-height: 38px;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 19px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.payment-notifications-table {
  min-width: 1220px !important;
}

.payment-notifications-table .cell-code {
  display: -webkit-box;
  max-height: 38px;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 19px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.runtime-log-text {
  margin: 0;
  padding: 12px;
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.orders-table td:nth-child(1) {
  color: var(--ink);
  font-weight: 800;
}

.orders-table td:nth-child(3),
.orders-table td:nth-child(4) {
  white-space: normal;
  text-overflow: clip;
}

.orders-table .badge {
  max-width: 100%;
  justify-content: center;
}

.orders-table .action-group {
  gap: 4px;
  flex-wrap: nowrap;
}

.orders-table .action-group button {
  background: transparent;
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 4px;
  box-shadow: none;
  font-size: 12px;
}

body[data-theme="dark"] .orders-table td:nth-child(1) {
  color: #eef4ff;
}

.two-factor-setup {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.two-factor-qr {
  width: 220px;
  min-height: 220px;
  padding: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.two-factor-qr svg {
  display: block;
  width: 196px;
  height: 196px;
}

.two-factor-qr-empty {
  background: var(--panel-muted);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.two-factor-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

@media (max-width: 560px) {
  .table-wrap {
    max-height: none;
  }

  th,
  td {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12px;
  }

  .sort-header {
    min-height: 28px;
    padding-right: 4px;
  }

  .orders-table {
    min-width: 1220px !important;
  }

  .orders-table .cell-code {
    max-height: 36px;
    line-height: 18px;
  }

  .two-factor-setup {
    grid-template-columns: 1fr;
  }

  .two-factor-qr {
    width: min(100%, 240px);
    min-height: 220px;
    margin: 0 auto;
  }
}
