:root {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #101c42;
  background: #f7f9fe;
  font-size: 14px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button,
input,
select {
  border: 1px solid #e0e7f4;
  border-radius: 10px;
  padding: 11px 15px;
  background: #fff;
  color: inherit;
}
input:focus,
select:focus {
  outline: 2px solid #789aff;
  outline-offset: 1px;
}
button:hover {
  filter: brightness(0.97);
}
[hidden] {
  display: none !important;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 202px;
  background: linear-gradient(160deg, #111a39, #142e4b);
  color: #cbd8ef;
  padding: 30px 8px 18px;
  overflow: auto;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 12px 30px;
}
.logo {
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #3297ff, #3337ff);
  width: 47px;
  height: 47px;
  border-radius: 9px;
  color: white;
  font-size: 29px;
  font-weight: 800;
  box-shadow: 0 5px 15px #0f2bcc30;
}
.brand strong {
  font-size: 21px;
  color: white;
}
.brand small {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  color: #96a7c6;
}
nav h3 {
  font-size: 13px;
  font-weight: 500;
  margin: 25px 13px 10px;
}
nav button {
  width: 100%;
  border: 0;
  text-align: left;
  color: #cbd8ef;
  background: transparent;
  padding: 13px 15px;
  margin: 2px 0;
  border-radius: 8px;
  display: flex;
  gap: 15px;
  align-items: center;
}
nav button.active {
  background: linear-gradient(110deg, #277cff, #4532ff);
  color: white;
  box-shadow: 0 5px 18px #003fff30;
}
nav .icon {
  width: 21px;
  text-align: center;
  font-size: 20px;
}
aside footer {
  font-size: 12px;
  color: #778ba8;
  line-height: 2.1;
  margin: 48px 15px 10px;
}
.workspace {
  margin-left: 202px;
}
header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  color: #637397;
}
header > div {
  display: flex;
  gap: 20px;
  align-items: center;
}
.link {
  border: 0;
  background: transparent;
  color: #245cff;
  padding: 5px 8px;
}
main {
  padding: 20px 30px 42px;
  max-width: 1800px;
  margin: auto;
}
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(110deg, #f7faff, #eef3ff 70%, #e8edff);
  border-radius: 16px;
  min-height: 130px;
  padding: 22px 18px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 34px;
  letter-spacing: 1px;
  margin: 0 0 6px;
}
.hero p {
  margin: 0;
  color: #607194;
  font-size: 16px;
}
.hero-art {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-right: 22px;
}
.hero-art > span {
  color: #5f80ff;
  transform: rotate(-7deg);
  font-size: 20px;
  letter-spacing: 4px;
  line-height: 1.8;
}
.wallet-art {
  width: 240px;
  height: 130px;
  object-fit: contain;
  margin: -16px -28px -16px -30px;
}
.icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.stat-icon svg {
  width: 33px;
  height: 33px;
}
.notification-button {
  position: relative;
  color: #132349;
  width: 35px;
  height: 35px;
}
.notification-button svg {
  width: 25px;
  height: 25px;
}
.notification-dot {
  position: absolute;
  right: 7px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f15e62;
}
.admin-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: #dfe9ff;
  color: #4f69c8;
  font-size: 13px;
}
.action-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.filters input[type="date"] {
  min-width: 150px;
  max-width: 175px;
  flex: 0 1 175px;
}
.filters select {
  max-width: 155px;
}
.filters a.button {
  margin-left: auto;
}
.actions {
  min-width: 175px;
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -4px 0 8px #14286004;
}
th:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
}
.actions .link {
  padding: 4px 6px;
  font-size: 13px;
}
tbody tr:hover td {
  background: #f1f6ff;
}
.tabs:empty {
  display: none;
}
.bottom button {
  width: 42px;
  height: 42px;
  padding: 6px;
  border-radius: 50%;
  color: #3066e8;
  font-size: 20px;
}
.table-wrap + .table-wrap {
  margin-top: 20px;
}
@media (min-width: 1200px) {
  .stat {
    min-height: 118px;
  }
  .stat .stat-icon {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
  }
  .stat b {
    font-size: 36px;
  }
  .tabs button {
    font-size: 16px;
  }
  .hero h1 {
    font-size: 36px;
  }
}
@media (max-width: 1100px) {
  .hero-art {
    display: none;
  }
  .stat {
    gap: 10px;
    padding: 15px 12px;
  }
  .stat b {
    font-size: 24px;
  }
  .actions {
    position: static;
  }
  th:last-child {
    position: static;
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 18px;
  border-radius: 16px;
  background: #edf4ff;
  min-height: 110px;
}
.stat:nth-child(2) {
  background: #fff7ed;
}
.stat:nth-child(3) {
  background: #e7fcf4;
}
.stat:nth-child(4) {
  background: #f1eaff;
}
.stat .stat-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d9e7ff;
  color: #2363ff;
  font-size: 28px;
}
.stat:nth-child(2) .stat-icon {
  background: #ffebd0;
  color: #e99600;
}
.stat:nth-child(3) .stat-icon {
  background: #bff5e5;
  color: #02b777;
}
.stat:nth-child(4) .stat-icon {
  background: #e4d4ff;
  color: #8136ff;
}
.stat b {
  display: block;
  font-size: 29px;
  color: #2563ff;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}
.stat:nth-child(2) b {
  color: #e39800;
}
.stat:nth-child(3) b {
  color: #00b974;
}
.stat:nth-child(4) b {
  color: #7727ed;
}
.tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 15px;
  overflow: auto;
}
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 14px 6px;
  font-weight: 600;
  white-space: nowrap;
}
.tabs button.active {
  color: #215cff;
  border-bottom-color: #215cff;
}
.filters {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 18px 0 22px;
  flex-wrap: wrap;
}
.filters input {
  min-width: 180px;
  flex: 1;
}
.primary {
  background: linear-gradient(115deg, #407fff, #3d30ff);
  border: 0;
  color: white;
  box-shadow: 0 4px 10px #415eff20;
  min-width: 115px;
}
.table-wrap {
  background: white;
  border: 1px solid #e8edf7;
  border-radius: 15px;
  overflow: auto;
  box-shadow: 0 4px 15px #14286004;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  font-size: 13px;
}
th {
  background: #f2f5fc;
  color: #172344;
  text-align: left;
  font-weight: 600;
  padding: 17px 14px;
}
td {
  padding: 15px 14px;
  border-bottom: 1px solid #f0f3fa;
  color: #536588;
}
tbody tr:nth-child(even) {
  background: #fafcff;
}
tbody tr:last-child td {
  border: 0;
}
.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #172344;
}
.badge {
  display: inline-block;
  border-radius: 6px;
  padding: 5px 9px;
  background: #fff3df;
  color: #dc8d00;
}
.badge.completed {
  background: #ddfaef;
  color: #00aa6b;
}
.badge.awaiting_payment {
  background: #e5eeff;
  color: #367aff;
}
.badge.rejected {
  background: #ffebee;
  color: #b95063;
}
.empty {
  text-align: center;
  padding: 70px 20px;
  color: #7384a1;
}
.bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6e7fa0;
  margin-top: 26px;
  font-size: 13px;
}
.note {
  color: #7887a2;
  font-size: 13px;
  line-height: 1.8;
}
.panel {
  background: white;
  border: 1px solid #e5ebf6;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.panel h2 {
  margin-top: 0;
  font-size: 19px;
}
.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}
.rule {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #edf1f8;
  gap: 20px;
}
.rule span {
  color: #66799b;
}
dialog {
  border: 0;
  border-radius: 18px;
  padding: 28px;
  width: min(520px, 95vw);
  box-shadow: 0 20px 90px #0a204c30;
}
dialog::backdrop {
  background: #10254955;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h2 {
  font-size: 22px;
}
label {
  display: block;
  margin: 16px 0;
  color: #526282;
}
label input,
label select {
  display: block;
  width: 100%;
  margin-top: 8px;
}
.modal-actions {
  text-align: right;
  margin-top: 22px;
}
#modalError,
#loginError {
  color: #c24850;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #172d51;
  color: white;
  border-radius: 9px;
  padding: 14px 25px;
  z-index: 5;
}
#login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(at 70% 20%, #dce7ff, transparent 50%), #f0f4fc;
}
#login form {
  background: white;
  padding: 42px;
  border-radius: 20px;
  width: min(410px, 92vw);
  box-shadow: 0 20px 80px #14346812;
}
#login button {
  width: 100%;
  margin-top: 10px;
}
#login p {
  color: #7282a0;
}
code {
  font-size: 13px;
}
@media (max-width: 1050px) {
  .hero-art {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero h1 {
    font-size: 28px;
  }
  main {
    padding: 15px;
  }
  .rule {
    display: block;
  }
  .rules {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  aside {
    width: 68px;
    padding-top: 20px;
  }
  .brand {
    margin: 0 3px;
  }
  .brand > div,
  nav h3,
  nav .nav-text,
  aside footer {
    display: none;
  }
  .logo {
    width: 40px;
    height: 40px;
  }
  nav {
    margin-top: 22px;
  }
  nav button {
    justify-content: center;
    padding: 13px 5px;
  }
  .workspace {
    margin-left: 68px;
  }
  header {
    padding: 0 14px;
    height: 60px;
    font-size: 12px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 14px 10px;
    gap: 10px;
  }
  .stat .stat-icon {
    display: none;
  }
  .stat b {
    font-size: 24px;
  }
  .hero p {
    font-size: 13px;
  }
  .tabs {
    gap: 15px;
  }
  .bottom {
    align-items: flex-start;
    gap: 16px;
  }
}
textarea {
  font: inherit;
  border: 1px solid #e0e7f4;
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  margin-top: 8px;
  color: inherit;
}
.button {
  display: inline-block;
  padding: 11px 15px;
  border: 1px solid #e0e7f4;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: white;
}
.detail {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
}
.detail dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.detail dt {
  color: #7183a4;
}
.actions {
  position: sticky;
  right: 0;
  background: #fff;
  white-space: normal;
  min-width: 170px;
  max-width: 220px;
}
.qr {
  display: block;
  width: 260px;
  height: 260px;
  margin: 10px auto;
}
td:not(.actions) {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge.settled,
.badge.online,
.badge.sent,
.badge.approved {
  background: #ddfaef;
  color: #00956a;
}
.badge.failed,
.badge.uncertain,
.badge.void {
  background: #ffe9ef;
  color: #be4054;
}
.filters input[type="date"] {
  min-width: 140px;
  max-width: 170px;
}
@media (min-width: 1200px) {
  :root {
    font-size: 16px;
  }
  .hero {
    height: 130px;
    min-height: 130px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .hero-art {
    height: 86px;
  }
  .stat {
    min-height: 118px;
  }
  .stat .stat-icon {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
  }
  .stat b {
    font-size: 36px;
  }
  table {
    font-size: 15px;
  }
  td {
    padding: 10px 14px;
    line-height: 28px;
  }
  th {
    padding: 14px;
  }
  .actions .link {
    font-size: 15px;
  }
  .badge {
    line-height: 22px;
    padding: 3px 8px;
  }
  .tabs button {
    font-size: 17px;
  }
  .filters {
    gap: 10px;
  }
  .filters input {
    min-width: 160px;
  }
  .filters input[type="date"] {
    min-width: 135px;
    max-width: 150px;
  }
  .filters button,
  .filters a {
    padding: 11px 12px;
    font-size: 14px;
  }
  .filters .primary {
    min-width: 95px;
  }
}

.money {
  font-weight: 700;
}

.players-bold th,
.players-bold td,
.players-bold td * {
  font-weight: 700;
}
.rich-toolbar,
.rich-button-row,
.rich-button-edit {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.rich-button-edit input {
  min-width: 110px;
  flex: 1;
}
.rich-preview {
  max-width: 560px;
  background: #f2f6ff;
  padding: 18px;
  border-radius: 12px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.rich-preview img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.rich-text {
  white-space: pre-wrap;
}
.rich-button-row {
  flex-wrap: nowrap;
}
.rich-button-row span {
  flex: 1;
  background: #dee8fb;
  padding: 9px;
  text-align: center;
  border-radius: 7px;
}
.rich-upload {
  padding: 8px;
}
/* RC7 business tables: independent columns and readable dense amounts. */
.record-grid th,.record-grid td{border-right:1px solid #dce3f0;border-bottom:1px solid #dce3f0}
.record-grid th:last-child,.record-grid td:last-child{border-right:0}
.players-bold{min-width:1750px;table-layout:auto}
.players-bold th,.players-bold td{white-space:nowrap;padding:14px 18px}
.players-bold td.actions{min-width:170px;white-space:normal}
.players-bold .actions .link{display:inline-block;margin-right:8px}
#pageJump{width:78px;min-width:0;padding:7px;border:1px solid #dce3f0;border-radius:6px}
.bottom{gap:12px;flex-wrap:wrap}
.bottom>span:last-child{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#playerFilter{min-width:180px}
#nav button .pending-count{margin-left:auto;flex-shrink:0;background:#ed4457;color:white;font-size:11px;line-height:18px;min-width:18px;padding:0 5px;border-radius:12px;text-align:center}
#nav button .pending-count[hidden]{display:none}

#pageGo{width:auto;min-width:60px;height:auto;white-space:nowrap;padding:8px 12px}

.rebate-stack { display: inline-grid; gap: 6px; white-space: nowrap; line-height: 1.5; text-align: left; }

/* RC8.1: uniform grid for every admin data table, including final rows. */
table th, table td, table tbody tr:last-child td {
 border-right:1px solid #cbd3e0;
 border-bottom:1px solid #cbd3e0;
}
table th:first-child, table td:first-child {border-left:1px solid #cbd3e0}
table thead tr:first-child th {border-top:1px solid #cbd3e0}
.record-grid th,.record-grid td,.record-grid th:last-child,.record-grid td:last-child {border-right:1px solid #cbd3e0;border-bottom:1px solid #cbd3e0}
