/* =========================================================
   GranmantrixWin - style.css (REPLACE WHOLE FILE)
   - Fixed bottom nav (always fixed)
   - Show only active tab (no stacking)
   - Responsive widths (no overflow)
   - Home responsive uses your real classes:
     content-grid / sidecats / games-grid
========================================================= */

/* ---------- Fonts ---------- */
/* @import url("https://fonts.googleapis.com/css2?family=Prompt:wght@200;300;400;500;600;700;800;900&display=swap"); */

/* ---------- Theme ---------- */
:root {
  --bg0: #050505;
  --bg1: #151515;
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .70);
  --muted2: rgba(255, 255, 255, .55);

  --gold: #e6c36a;
  --gold2: #f1d99f;

  --card: rgba(255, 255, 255, .04);
  --card2: rgba(0, 0, 0, .20);
  --border: rgba(255, 255, 255, .10);
  --border2: rgba(255, 255, 255, .14);

  --shadow: 0 18px 44px rgba(0, 0, 0, .55);

  --container-max: 1200px;
  --container-pad: 14px;

  --nav-h: 74px;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  isolation: isolate;
  /* overflow-x:hidden; */
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

.page-bg {
  position: fixed;
  inset: 0;
  /* pointer-events:none; */
  background:
    radial-gradient(900px 500px at 50% 35%, rgba(230, 195, 106, .18), transparent 55%),
    radial-gradient(700px 400px at 15% 10%, rgba(255, 255, 255, .06), transparent 60%),
    radial-gradient(700px 400px at 85% 15%, rgba(255, 255, 255, .05), transparent 60%);
  /* opacity:.9; */
  /* z-index:-1; */
  z-index: 0;
}


/* iOS Safari detection */
@supports (-webkit-touch-callout: none) {

  /* ปิด blur เฉพาะ iOS Safari (คงสี/ความทึบไว้แทน) */
  .topbar,
  .bottom-nav {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(0, 0, 0, .88) !important;
  }

  /* กันบางเครื่องยังเพี้ยนกับ sticky */
  .topbar {
    position: -webkit-sticky;
    position: sticky;
  }

  /* ถ้ามี element อื่น ๆ ที่ใช้ backdrop-filter ในหน้า ให้ปิดเหมือนกัน */
  [style*="backdrop-filter"],
  [style*="-webkit-backdrop-filter"] {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

@supports (-webkit-touch-callout: none) {

  .topbar,
  .bottom-nav {
    transform: translateZ(0);
  }
}

/* Bootstrap container fix (prevent overflow) */
.container-xxl {
  max-width: var(--container-max) !important;
  padding-left: var(--container-pad) !important;
  padding-right: var(--container-pad) !important;
  /* min-height: calc(100vh - var(--nav-h)); */
}

/* ---------- Buttons ---------- */
.btn-pill {
  height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.btn-soft {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .90);
}

.btn-soft:hover {
  background: rgba(255, 255, 255, .08);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* gold pill used on deposit/withdraw */
.btn-gold-pill {
  height: 48px;
  width: 100%;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .5px;
  box-shadow:
    inset 0 0 0 1px rgba(230, 195, 106, .15),
    0 10px 30px rgba(0, 0, 0, .45);
  transition: all .2s ease;
}

.btn-gold-pill:hover {
  background: rgba(230, 195, 106, .08);
  color: var(--gold2);
}

.btn-gold-pill:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 0 0 1px rgba(230, 195, 106, .25),
    0 6px 18px rgba(0, 0, 0, .45);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.brand-logo {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1;
  background: linear-gradient(90deg, rgba(230, 195, 106, 1), rgba(255, 255, 255, .90));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-logo span {
  color: rgba(255, 255, 255, .90);
}

.brand__sub {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, .55);
  text-transform: uppercase;
}

.top-actions .acct {
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acct__user {
  font-weight: 900;
  font-size: 12px;
  color: rgba(255, 255, 255, .92);
}

.acct__bal {
  font-weight: 900;
  font-size: 12px;
  color: rgba(255, 255, 255, .92);
  opacity: .95;
}

.dot-user {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
  display: inline-block;
}

/* ---------- Desktop Icon Nav ---------- */
.nav-desktop {
  padding: 10px 0 2px;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.nav-itemx {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .75);
  padding: 8px 6px;
  min-width: 92px;
}

.nav-itemx .nav-ic {
  font-size: 28px;
  line-height: 1;
  opacity: .85;
}

.nav-itemx .nav-tx {
  font-size: 13px;
  font-weight: 800;
}

.nav-itemx.active {
  color: var(--gold);
}

.nav-itemx.active .nav-ic {
  opacity: 1;
}

.nav-back {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .75);
  padding: 8px 6px;
  min-width: 92px;
}

.nav-back .nav-ic {
  font-size: 28px;
  line-height: 1;
  opacity: .85;
}

.nav-line {
  margin-top: 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 195, 106, .45), transparent);
}

/* ---------- Main / Tabs ---------- */
.main-wrap {
  padding: 14px 0 22px;
}

/* IMPORTANT: only active tab visible (fix stacking profile under other tabs) */
.tab-panel {
  display: none;
  width: 100%;
}

.tab-panel.is-active {
  display: block;
}

.page-title {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .3px;
  font-size: 34px;
  margin: 10px 0 6px;
}

@media (max-width:575.98px) {
  .brand-logo {
    font-size: 30px;
  }

  .page-title {
    font-size: 28px;
  }
}

/* ---------- HOME (your real classes) ---------- */
.content-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: start;
}

.sidecats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-btn {
  height: 60px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .03);
  color: rgba(255, 255, 255, .85);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  /* flex-direction: column; */
}

.cat-btn span {
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  letter-spacing: .3px;
}

.cat-btn.active {
  background: linear-gradient(180deg, rgba(214, 179, 106, .85), rgba(150, 110, 45, .55));
  border-color: rgba(214, 179, 106, .65);
  color: #151515;
}

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

.game-card {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  min-height: 140px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  text-decoration: none;
  color: inherit;
}

.game-card .game-img {
  width: 100%;
  height: 160px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, .35);
}

.game-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  object-position: 50% 25%;
  display: block;
}

.game-cover.is-contain {
  object-fit: contain;
  background: rgba(0, 0, 0, .35);
}

.game-card--wide {
  grid-column: span 2;
  min-height: 160px;
}

.game-img {
  position: absolute;
  inset: 0;
  opacity: .95;
}

.gradient-sport {
  background:
    radial-gradient(600px 220px at 30% 30%, rgba(230, 195, 106, .35), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .25));
}

.gradient-joker {
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .30));
}

.gradient-pg {
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .30));
}

.gradient-gae {
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .30));
}

.gradient-seven {
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .30));
}

.gradient-poker {
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .30));
}

.gradient-hall {
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .30));
}

.gradient-aug {
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .30));
}

.game-label {
  position: absolute;
  left: 16px;
  top: 18px;
  z-index: 1;
}

.gl-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 8px 18px rgba(0, 0, 0, .55);
}

.gl-sub {
  margin-top: 6px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
  font-weight: 900;
  color: rgba(255, 255, 255, .92);
}

.game-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
  font-weight: 900;
  color: rgba(255, 255, 255, .92);
}

@media (max-width: 991.98px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .content-grid {
    grid-template-columns: 72px 1fr;
    gap: 10px;
  }

  .cat-btn {
    height: 44px;
  }

  .game-card {
    min-height: 120px;
    border-radius: 12px;
  }

  .game-card--wide {
    grid-column: span 2;
    min-height: 140px;
  }

  .gl-title {
    font-size: 18px;
  }
}

/* ---------- Deposit ---------- */
.deposit-form-wrap {
  max-width: 890px;
  margin: 0 auto;
  padding: 6px 0 30px;
}

.deposit-title {
  text-align: center;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .3px;
  font-size: 34px;
  margin: 6px 0 4px;
}

.deposit-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, .70);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 14px;
}

.deposit-form-card {
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}

.deposit-label {
  color: rgba(255, 255, 255, .78);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
}

.deposit-control {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .25) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  color: rgba(255, 255, 255, .92) !important;
}

.deposit-control:focus {
  background: rgba(0, 0, 0, .28) !important;
  border-color: rgba(214, 179, 106, .55) !important;
  box-shadow: 0 0 0 .2rem rgba(214, 179, 106, .12) !important;
  color: #fff !important;
}

.deposit-copy-btn {
  height: 44px;
  min-width: 110px;
  padding: 0 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .15);
  border: 2px solid rgba(255, 255, 255, .75);
  color: rgba(255, 255, 255, .92);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.deposit-copy-btn:hover {
  background: rgba(255, 255, 255, .06);
}

.deposit-hint {
  margin-top: 10px;
  color: rgba(255, 80, 80, .95);
  font-size: 12px;
  font-weight: 600;
}

.deposit-info-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.deposit-info-box {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .20);
  padding: 10px 10px;
  text-align: center;
}

.deposit-info-label {
  color: rgba(255, 255, 255, .70);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 8px;
}

.deposit-info-value {
  border-radius: 6px;
  border: 2px solid var(--gold);
  background: rgba(0, 0, 0, .18);
  color: rgba(255, 255, 255, .75);
  padding: 10px 10px;
  font-weight: 900;
  font-size: 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* deposit responsive */
@media (max-width: 991.98px) {
  .deposit-form-wrap {
    max-width: 560px;
  }

  .deposit-info-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .deposit-title {
    font-size: 28px;
  }
}

/* ---------- Withdraw (match deposit theme) ---------- */
.withdraw-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 6px 0 30px;
}

.withdraw-title {
  text-align: center;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .3px;
  font-size: 34px;
  margin: 6px 0 4px;
}

.withdraw-sub {
  text-align: center;
  color: rgba(255, 255, 255, .70);
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 14px;
}

.withdraw-form {
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.withdraw-label {
  color: rgba(255, 255, 255, .75);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
}

.withdraw-control {
  display: flex;
  height: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, .25) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  color: rgba(255, 255, 255, .92) !important;
}

.withdraw-control:focus {
  background: rgba(0, 0, 0, .28) !important;
  border-color: rgba(214, 179, 106, .55) !important;
  box-shadow: 0 0 0 .2rem rgba(214, 179, 106, .12) !important;
  color: #fff !important;
}

@media (max-width:575.98px) {
  .withdraw-title {
    font-size: 28px;
  }
}

/* ---------- History ---------- */
.history-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 6px 0 34px;
}

.history-layout {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  align-items: start;
  justify-content: center;
}

.history-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-tab {
  height: 54px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .03);
  color: rgba(255, 255, 255, .85);
  font-weight: 950;
}

.history-tab.is-active {
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .35);
}

.history-panels {
  width: 100%;
}

.history-panel {
  display: none;
}

.history-panel.is-active {
  display: block;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hi-title {
  font-weight: 950;
  color: rgba(255, 255, 255, .95);
  letter-spacing: .2px;
  font-size: medium;
}

.hi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, .70);
  font-weight: 650;
}

.hi-amount {
  font-weight: 950;
  color: rgba(255, 255, 255, .95);
  text-align: right;
}

.hi-date {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, .70);
  font-weight: 650;
  text-align: right;
}

/* themes */
.theme-green {
  border-color: rgba(65, 190, 95, .55);
  box-shadow: inset 0 0 0 1px rgba(65, 190, 95, .15);
}

.theme-red {
  border-color: rgba(220, 70, 70, .55);
  box-shadow: inset 0 0 0 1px rgba(220, 70, 70, .15);
}

.theme-gold {
  border-color: rgba(214, 179, 106, .55);
  box-shadow: inset 0 0 0 1px rgba(214, 179, 106, .15);
}

#historyTabs .history-tab.is-active[data-his="his-deposit"] {
  background: linear-gradient(180deg, rgba(65, 190, 95, .85), rgba(45, 140, 65, .65));
  color: #fff;
  border-color: rgba(65, 190, 95, .80);
}

#historyTabs .history-tab.is-active[data-his="his-withdraw"] {
  background: linear-gradient(180deg, rgba(220, 70, 70, .85), rgba(150, 45, 45, .65));
  color: #fff;
  border-color: rgba(220, 70, 70, .80);
}

#historyTabs .history-tab.is-active[data-his="his-game"] {
  background: linear-gradient(180deg, rgba(214, 179, 106, .90), rgba(170, 125, 55, .65));
  color: #1a1a1a;
  border-color: rgba(214, 179, 106, .90);
}

/* history mobile */
@media (max-width: 575.98px) {
  .history-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .history-tabs {
    flex-direction: row;
  }

  .history-tab {
    flex: 1;
    height: 46px;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .hi-amount,
  .hi-date {
    text-align: left;
  }
}

/* ---------- Profile (center) ---------- */
.profile-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 6px 0 34px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-bankcard {
  margin: 10px auto 18px;
  width: 360px;
  max-width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-align: left;
}

.pb-ic {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(13, 110, 253, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.pb-row {
  color: rgba(255, 255, 255, .90);
  font-weight: 800;
  line-height: 1.25;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  margin: 0 auto;
  width: 520px;
  max-width: 100%;
  text-align: left;
}

.pitem {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
}

.pi-ic {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  background: rgba(214, 179, 106, .12);
  border: 1px solid rgba(214, 179, 106, .20);
  font-size: 14px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.pi-title {
  color: rgba(255, 255, 255, .92);
  font-weight: 950;
  line-height: 1.15;
}

.pi-sub {
  color: rgba(255, 255, 255, .65);
  font-weight: 650;
  font-size: 12px;
  margin-top: 2px;
}

.pitem-action {
  cursor: pointer;
}

.pitem-action:hover .pi-title {
  color: var(--gold);
}

@media (max-width: 575.98px) {
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ---------- Mobile Bottom Nav (FIXED ALWAYS) ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  height: var(--nav-h);
  background: rgba(0, 0, 0, .86);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, .10);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.bnav {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgba(255, 255, 255, .70);
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}

.bnav .bnav-ic {
  font-size: 20px;
}

.bnav.active {
  border-color: rgba(214, 179, 106, .45);
  background: rgba(214, 179, 106, .10);
  color: var(--gold);
}

/* Reserve space for fixed bottom nav on mobile so it never disappears */
@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(var(--nav-h) + 10px);
  }

  .main-wrap {
    padding-bottom: calc(var(--nav-h) + 10px);
  }
}

/* ===== History Table Header ===== */
.history-head {
  display: grid;
  grid-template-columns: 1.4fr .8fr 1fr 1.2fr;
  padding: 8px 14px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(255, 255, 255, .65);
  border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.hh-amount,
.hh-date {
  text-align: right;
}

/* ===== History Item Layout ===== */
.history-item {
  display: grid;
  grid-template-columns: 1.4fr .8fr 1fr 1.2fr;
  align-items: center;
}

.hi-status {
  font-weight: 900;
  text-align: center;
}

.hi-status.success {
  color: #6fe28a;
}

.hi-status.pending {
  color: #f3c969;
}

.hi-status.fail {
  color: #ff6b6b;
}

.hi-amount,
.hi-date {
  text-align: right;
}

/* ===== Mobile ===== */
@media (max-width: 575.98px) {
  .history-head {
    display: none;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hi-status,
  .hi-amount,
  .hi-date {
    text-align: left;
  }
}

/* ===== History Table Header (3 cols) ===== */
.history-head {
  display: grid;
  grid-template-columns: 1.6fr .8fr 1.2fr;
  /* รายการ | สถานะ | ยอดและเวลา */
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 6px 0 8px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(255, 255, 255, .65);
  border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.history-head .hh-item {
  text-align: left;
}

.history-head .hh-status {
  text-align: center;
}

.history-head .hh-amounttime {
  text-align: right;
  justify-self: end;
  /* ดันไปชิดขวาสุด */
}

/* ===== History Item Layout (3 cols) ===== */
.history-item {
  display: grid;
  grid-template-columns: 1.6fr .8fr 1.2fr;
  /* รายการ | สถานะ | ยอดและเวลา */
  align-items: center;
  gap: 12px;
}

/* รายการ (ซ้าย) */
.hi-left {
  min-width: 0;
  /* กัน overflow */
}

.hi-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hi-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* สถานะ (กลาง) */
.hi-status {
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.hi-status.success {
  color: #6fe28a;
}

.hi-status.pending {
  color: #f3c969;
}

.hi-status.fail {
  color: #ff6b6b;
}

/* ยอดและเวลา (ขวา) */
.hi-right {
  text-align: right;
  justify-self: end;
  /* ชิดขวาสุด */
  margin-left: auto;
  /* กันกรณีบางธีมเป็น flex */
  white-space: nowrap;
}

.hi-amount {
  text-align: right;
}

.hi-date {
  text-align: right;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 575.98px) {
  .history-head {
    display: none;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hi-status {
    text-align: left;
  }

  .hi-right {
    text-align: left;
    justify-self: start;
    margin-left: 0;
    white-space: normal;
  }

  .hi-amount,
  .hi-date {
    text-align: left;
  }
}

/* ===== FORCE: History head = 3 columns (put at VERY END of style.css) ===== */
.history-panel .history-head {
  display: grid !important;
  grid-template-columns: 1.6fr .8fr 1.2fr !important;
  /* รายการ | สถานะ | ยอดและเวลา */
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  margin: 6px 0 8px !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  color: rgba(255, 255, 255, .65) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .15) !important;
}

.history-panel .history-head .hh-item {
  text-align: left !important;
}

.history-panel .history-head .hh-status {
  text-align: center !important;
}

.history-panel .history-head .hh-amounttime {
  text-align: right !important;
  justify-self: end !important;
}

/* ให้แถวรายการใช้ 3 คอลัมน์เหมือนหัวตาราง (กันโดนของเก่าทับ) */
.history-panel .history-item {
  display: grid !important;
  grid-template-columns: 1.6fr .8fr 1.2fr !important;
  align-items: center !important;
  gap: 12px !important;
}

/* สถานะกลาง */
.history-panel .hi-status {
  text-align: center !important;
  font-weight: 900 !important;
}

/* ยอด+เวลา ชิดขวาสุด */
.history-panel .hi-right {
  text-align: right !important;
  justify-self: end !important;
  margin-left: auto !important;
}

.history-panel .hi-amount,
.history-panel .hi-date {
  text-align: right !important;
}

/* Mobile: ซ่อนหัวตาราง + แสดงแบบบล็อก */
@media (max-width: 575.98px) {
  .history-panel .history-head {
    display: none !important;
  }

  .history-panel .history-item {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .history-panel .hi-status,
  .history-panel .hi-right,
  .history-panel .hi-amount,
  .history-panel .hi-date {
    text-align: left !important;
    justify-self: start !important;
    margin-left: 0 !important;
  }
}
