/* Trang nộp tiền chạy MKT — theo bộ nhận diện của leaderboard.bamland.vn:
   nền đỏ thẫm, viền hồng nhạt, nhấn bằng dải vàng gradient, chữ Times New Roman.
   Một tông duy nhất, cố ý: đây là màu thương hiệu, không đổi theo máy người xem
   nên không có khối dark-mode — mọi màu đều tô thẳng. */

:root {
  --crimson: #a01d22;
  --crimson-deep: #760406;
  --card: #601616a6;
  --card-solid: #6d1a1e;
  --edge: #e7bbbc;
  --edge-soft: #e7bbbc4d;
  --gold-a: #cd7827;
  --gold-b: #f7ec87;
  --gold-c: #cd8d2a;
  --gold-flat: #e6ac0a;
  --gold-ink: #241f23;
  --cream: #fdf3f3;
  --cream-dim: #e7bbbc;
  --cyan: #01afe3;
  --serif: "Times New Roman", Times, "Liberation Serif", "Tinos", serif;
  --digits: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --gold-bar: linear-gradient(to right, var(--gold-a) 0%, var(--gold-b) 50%, var(--gold-c) 100%);
  --gold-flat-bar: linear-gradient(to right, #cd7825 0%, var(--gold-flat) 100%);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
  color: var(--cream);
  background-color: var(--crimson);
  /* Tia sáng toả từ trên xuống, dựng bằng gradient thay vì ảnh nền — trang nhẹ
     hơn và không phải mượn asset của sự kiện nào. */
  background-image:
    radial-gradient(120% 70% at 50% -10%, #d8412ecc 0%, #a01d2200 60%),
    radial-gradient(90% 55% at 50% 0%, #f7c96a4d 0%, #a01d2200 55%),
    linear-gradient(180deg, #a01d22 0%, #7d0d12 55%, var(--crimson-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 20px 70px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---- đầu trang ---- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--edge-soft);
}

h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 14px #4a000399;
  text-wrap: balance;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border: 2px solid var(--gold-a);
  background: #4a03069e;
  color: var(--gold-b);
  border-radius: 14px;
  font-size: 15px;
}

.notice b {
  color: #fff;
}

/* ---- bộ lọc ---- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search {
  flex: 1 1 240px;
  max-width: 320px;
}

input[type="search"] {
  font: inherit;
  width: 100%;
  color: #fff;
  background: var(--card);
  border: 2px solid var(--edge-soft);
  border-radius: 999px;
  padding: 9px 18px;
}

input[type="search"]::placeholder {
  color: #e7bbbc99;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid var(--edge-soft);
  background: var(--card);
  color: var(--cream);
  border-radius: 999px;
  padding: 7px 18px;
  white-space: nowrap;
}

.chip[aria-pressed="true"] {
  background: var(--gold-flat-bar);
  border-color: transparent;
  color: var(--gold-ink);
  font-weight: 700;
}

input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-b);
  outline-offset: 2px;
}

/* ---- danh sách: mỗi người một thẻ, cột vẫn thẳng hàng nhờ grid ---- */
.tablewrap {
  overflow: visible;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding: 0 14px 8px;
  white-space: nowrap;
}

thead th.num {
  text-align: right;
}

thead tr,
tbody tr {
  display: grid;
  grid-template-columns: 110px minmax(220px, 1fr) 156px 152px 164px;
  align-items: center;
}

tbody tr {
  background: var(--card);
  border: 2px solid var(--edge-soft);
  border-radius: 14px;
  margin-bottom: 10px;
  padding: 12px 0;
}

tbody tr.paid {
  border-color: var(--gold-a);
  background: #5a120fb3;
}

tbody td {
  padding: 2px 14px;
  min-width: 0;
}

td.c-amt,
td.c-act {
  text-align: right;
}

.code {
  font-family: var(--digits);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-b);
}

.name {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.role,
.cty {
  font-size: 15px;
  color: var(--cream-dim);
}

/* Chức danh · sàn, đặt dưới tên — vẫn tra được mà không tốn thêm cột. */
.sub {
  display: block;
  font-size: 14px;
  color: var(--cream-dim);
  margin-top: 2px;
}

/* Số tiền lấy dáng "viên vàng" của bảng xếp hạng — chỗ mắt phải dừng lại. */
.money {
  display: inline-block;
  background: var(--gold-bar);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 17px;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill {
  display: inline-block;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.pill.pending,
.pill.partial {
  color: var(--cream-dim);
}

.pill.paid {
  color: var(--gold-b);
  border-color: var(--gold-a);
  background: #4a030699;
  font-weight: 700;
}

.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  background: var(--gold-flat-bar);
  color: var(--gold-ink);
  border-radius: 999px;
  padding: 10px 20px;
  white-space: nowrap;
  box-shadow: 0 0 16px 2px #00000033;
}

.btn:hover {
  background: var(--gold-bar);
}

.btn[disabled] {
  cursor: not-allowed;
  background: none;
  border: 1px solid var(--edge-soft);
  color: var(--cream-dim);
  font-weight: 400;
  font-size: 14px;
  box-shadow: none;
}

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--cream-dim);
  border: 2px dashed var(--edge-soft);
  border-radius: 16px;
}

/* ---- hộp mã QR ---- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #2d000399;
}

.sheet[open] {
  display: flex;
}

.sheet-inner {
  background-color: var(--card-solid);
  background-image: radial-gradient(120% 60% at 50% 0%, #a8302199 0%, #6d1a1e00 70%);
  border: 2px solid var(--gold-a);
  border-radius: 18px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 26px 70px -18px #1e0002;
}

.sheet .who {
  text-align: center;
}

.sheet .who .name {
  font-size: 21px;
}

.qr {
  width: 250px;
  height: 250px;
  background: #fff;
  border: 3px solid var(--gold-a);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr img,
.qr svg,
.qr canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.qr .ph {
  font-size: 14px;
  color: #6b7684;
  text-align: center;
  padding: 8px;
}

.kv {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--edge-soft);
}

.kv > div:last-child {
  border-bottom: 0;
}

.kv dt {
  color: var(--cream-dim);
}

/* Số tài khoản và nội dung dùng font đều nét: đọc nhầm một chữ số là tiền đi
   nhầm chỗ, mà chữ số của Times rất dễ lẫn. */
.kv dd {
  margin: 0;
  font-family: var(--digits);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-align: right;
  word-break: break-all;
}

.acts {
  display: flex;
  gap: 10px;
  width: 100%;
}

.acts button {
  flex: 1;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px;
  border: 0;
  background: var(--gold-flat-bar);
  color: var(--gold-ink);
}

.acts button:hover {
  background: var(--gold-bar);
}

.acts button:last-child {
  background: none;
  border: 1px solid var(--edge-soft);
  color: var(--cream);
  font-weight: 400;
}

.close {
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--cream-dim);
  padding: 2px 10px;
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(8px);
  background: var(--gold-bar);
  color: var(--gold-ink);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 70;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}

/* ---- điện thoại ----
   Mã + tên nằm một hàng; số tiền và trạng thái dồn về góc phải; nút chiếm cả bề
   ngang vì đó là thứ duy nhất sale vào đây để bấm. */
@media (max-width: 860px) {
  .wrap {
    padding: 22px 14px 52px;
    gap: 18px;
  }

  h1 {
    font-size: 29px;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    /* Nút trải qua cột 2-3 chứ không đứng riêng cột 3: đứng riêng thì bề rộng
       của nó ép cột phải nở ra, và cột tên bị bóp đến mức gãy dòng. */
    grid-template-areas:
      "code   name status"
      "amount act  act";
    align-items: start;
    column-gap: 8px;
    padding: 12px;
    margin-bottom: 10px;
  }

  tbody td {
    display: block;
    padding: 0;
  }

  /* Bỏ chức danh · sàn: màn hẹp thì tên và số tiền là đủ để nhận ra dòng của
     mình, còn đầy đủ thì đã có trong hộp QR. */
  .sub {
    display: none;
  }

  tbody td:nth-child(1) {
    grid-area: code;
    align-self: center;
  }

  tbody td:nth-child(2) {
    grid-area: name;
    align-self: center;
  }

  tbody td:nth-child(4) {
    grid-area: status;
    text-align: right;
  }

  td.c-amt {
    grid-area: amount;
    text-align: left;
    align-self: center;
    padding-top: 12px;
  }

  td.c-act {
    grid-area: act;
    text-align: right;
    padding-top: 12px;
  }

  td.c-act .btn {
    padding: 11px 18px;
  }

  /* Mã và tên phải nằm cùng một hàng chữ, nên cả hai bám mép trên và cùng
     line-height — không thì mã bị đẩy lệch xuống. */
  .code,
  .name {
    line-height: 1.25;
  }

  .code {
    font-size: 12px;
  }

  .name {
    font-size: 16px;
  }

  /* Nhãn trạng thái và viên tiền bóp lại: mỗi pixel nhường được đều là bề ngang
     cho tên, thứ mà sale phải đọc lướt để tìm dòng của mình. */
  .pill {
    font-size: 12px;
    padding: 3px 9px;
  }

  .money {
    font-size: 16px;
    padding: 4px 10px;
  }

    .qr {
    width: min(250px, 66vw);
    height: min(250px, 66vw);
  }
}
