.profile-main {
  padding: 26px 0 64px;
}

.profile-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
}

.profile-sidebar,
.profile-panel,
.sidebar-help,
.history-table-wrap {
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(130% 120% at 0% -20%, rgba(212, 175, 55, 0.08), transparent 45%),
    linear-gradient(165deg, rgba(9, 14, 21, 0.86), rgba(7, 11, 18, 0.96));
}

.profile-sidebar {
  padding: 14px;
  height: fit-content;
}

.sidebar-menu {
  display: grid;
  gap: 6px;
}

.sidebar-item {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #c5ccda;
  text-decoration: none;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.sidebar-item:hover,
.sidebar-item.is-active {
  border-color: rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-soft);
}

.sidebar-logout {
  color: #ff9db0;
}

.sidebar-help {
  margin-top: 12px;
  padding: 14px;
}

.sidebar-help h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
}

.sidebar-help p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.profile-content {
  display: grid;
  gap: 20px;
}

.profile-content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.profile-content-head h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 2rem;
}

.profile-content-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.profile-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.profile-panel {
  padding: 22px;
}

.identity-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.avatar-stack {
  position: relative;
  width: 96px;
  flex-shrink: 0;
}

.profile-crown-badge {
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  border: 1px solid rgba(212, 175, 55, 0.58);
  background: radial-gradient(circle at 35% 30%, rgba(255, 224, 153, 0.6), rgba(191, 143, 46, 0.2));
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 175, 55, 0.8);
  cursor: pointer;
}

.identity-meta {
  min-width: 0;
}

.profile-name {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.7rem;
}

.profile-login {
  margin: 4px 0 0;
  color: #9da8bc;
  font-size: 0.9rem;
}

.profile-member-since {
  margin: 8px 0 0;
  color: #d1b57a;
  font-size: 0.85rem;
}

.profile-avatar-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.profile-logout-btn {
  border-color: rgba(255, 106, 132, 0.42) !important;
  color: #ff91a7 !important;
}

.profile-name-edit-wrap {
  margin-top: 10px;
}

.profile-name-edit-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-name-edit-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.profile-name-input {
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(8, 12, 18, 0.88);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.profile-name-input:focus {
  outline: none;
  border-color: rgba(212, 175, 55, 0.6);
}

.profile-name-edit-status {
  margin: 6px 0 0;
  color: #9ec7a6;
  font-size: 0.83rem;
}

.profile-name-edit-status-error {
  color: #ff9cab;
}

.wallet-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.wallet-top-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.wallet-balance {
  margin: 8px 0 4px;
  font-size: 2rem;
  color: var(--gold-soft);
  font-family: "Playfair Display", serif;
}

.wallet-ops-mini {
  min-width: 250px;
  display: grid;
  gap: 8px;
}

.wallet-ops-mini p {
  margin: 0;
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.wallet-ops-mini span {
  color: #95a0b5;
  font-size: 0.75rem;
}

.wallet-op-plus {
  color: #77d894;
}

.wallet-op-minus {
  color: #ff9cb0;
}

.wallet-methods {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wallet-method-btn {
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(8, 12, 18, 0.92);
  color: #d5dbe8;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.83rem;
  cursor: pointer;
}

.wallet-method-btn.is-active {
  color: #1b1407;
  background: linear-gradient(180deg, #f0d59d 0%, #d9b06a 100%);
}

.wallet-topup-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.wallet-topup-input {
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(8, 12, 18, 0.92);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.wallet-status {
  margin: 10px 0 0;
  min-height: 18px;
  color: #b9d8bd;
  font-size: 0.84rem;
}

.wallet-status-error {
  color: #ff9cab;
}

.profile-mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.club-status-name {
  margin: 8px 0 4px;
  font-family: "Playfair Display", serif;
  font-size: 1.45rem;
  color: var(--gold-soft);
}

.club-status-hint {
  margin: 0 0 12px;
  color: #c2cad8;
}

.club-progress {
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.club-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a87724 0%, #d4af37 55%, #f4d78e 100%);
  transition: width 0.35s ease;
}

.club-progress-text,
.club-next-target {
  margin: 10px 0 0;
  color: #c3cad8;
  font-size: 0.9rem;
}

.quick-actions-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-action-item {
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  padding: 11px 10px;
  text-decoration: none;
  color: #d5ddeb;
  background: rgba(8, 12, 18, 0.8);
  font-size: 0.88rem;
}

.quick-action-item:hover {
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--gold-soft);
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.history-head h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
}

.history-head a {
  text-decoration: none;
  color: var(--gold-soft);
  font-size: 0.9rem;
}

.history-table-wrap {
  padding: 0;
  overflow: hidden;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table thead th {
  text-align: left;
  font-size: 0.82rem;
  color: #8f99ad;
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-product-cell img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  border: 1px solid transparent;
}

.status-chip-active {
  border-color: rgba(63, 198, 122, 0.35);
  background: rgba(17, 88, 52, 0.35);
  color: #7be6a3;
}

.status-chip-done {
  border-color: rgba(153, 167, 191, 0.3);
  background: rgba(84, 92, 112, 0.25);
  color: #b5bfd3;
}

.history-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .profile-shell {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    order: 2;
  }
}

@media (max-width: 860px) {
  .profile-top-grid,
  .profile-mid-grid {
    grid-template-columns: 1fr;
  }

  .wallet-top-head {
    flex-direction: column;
  }

  .wallet-ops-mini {
    min-width: 0;
  }
}

@media (max-width: 680px) {
  .profile-main {
    padding-top: 16px;
  }

  .profile-content-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .identity-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-name-edit-row {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    flex-direction: column;
  }

  .wallet-topup-row {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .history-table thead {
    display: none;
  }

  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }

  .history-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
  }

  .history-table tbody td {
    border: 0;
    padding: 6px 14px;
  }
}
