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

.profile-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Верхняя вкладочная навигация вместо бокового меню ── */
.profile-tabbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(55, 212, 196, 0.16);
  border-radius: 999px;
  background: rgba(9, 14, 21, 0.72);
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-tabbar::-webkit-scrollbar { display: none; }

.profile-tab {
  flex: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #aab4c4;
  text-decoration: none;
  white-space: nowrap;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-tab:hover {
  color: var(--gold-soft);
}

.profile-tab.is-active {
  color: #071b19;
  background: linear-gradient(180deg, #9df0e8 0%, #6ad9ce 100%);
}

.profile-tab-logout {
  margin-left: auto;
  color: #ff9db0;
}

/* ── Pass-hero: карта доступа вместо стандартного identity-блока ── */
.pass-hero {
  position: relative;
  padding: 26px 28px 22px;
  border: 1px solid rgba(55, 212, 196, 0.2);
  border-radius: 8px;
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%);
  background:
    radial-gradient(120% 160% at 100% -20%, rgba(55, 212, 196, 0.14), transparent 55%),
    linear-gradient(160deg, rgba(13, 17, 20, 0.94), rgba(9, 12, 15, 0.98));
  overflow: hidden;
}

.pass-hero-top {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.pass-avatar-wrap {
  position: relative;
  flex: none;
}

.pass-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(55, 212, 196, 0.75);
  cursor: pointer;
}

.pass-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #0d1114;
  background: linear-gradient(155deg, #7cefdd, #2bb3a3);
  border: 2px solid rgba(13, 17, 20, 0.9);
  pointer-events: none;
}
.pass-avatar-edit svg { width: 14px; height: 14px; }

.pass-identity {
  min-width: 0;
  flex: 1 1 220px;
}

.pass-name {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.7rem;
  color: var(--text);
}

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

.pass-tier {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding-left: 18px;
  border-left: 1px dashed rgba(255, 255, 255, 0.14);
}

.pass-tier-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pass-tier-name {
  margin: 2px 0 0;
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  color: var(--gold-soft);
}

.pass-edit-btn {
  margin-left: 8px;
}

.club-crest {
  width: 30px; height: 30px; flex: none;
  opacity: 0.9;
}

.pass-hero-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

.club-tier-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.club-tier-dots span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.club-tier-dots span.is-passed { background: var(--gold); }
.club-tier-dots span.is-current { background: var(--gold); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 60%, transparent); }

.club-status-hint {
  margin: 0 0 10px;
  color: #c2cad8;
  font-size: 0.9rem;
}

.club-progress {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 212, 196, 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, #24a89b 0%, #37d4c4 55%, #8ef4ea 100%);
  transition: width 0.35s ease;
}

.club-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

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

/* ── Профиль: имя (редактирование) ── */
.profile-name-edit-wrap {
  margin-top: 12px;
  max-width: 460px;
}

.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(55, 212, 196, 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(55, 212, 196, 0.6);
}

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

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

/* ── Панели: баланс + быстрые действия ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}

.profile-panel {
  padding: 22px;
  border: 1px solid rgba(55, 212, 196, 0.16);
  border-radius: 8px;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
  background:
    radial-gradient(130% 120% at 0% -20%, rgba(55, 212, 196, 0.08), transparent 45%),
    linear-gradient(165deg, rgba(9, 14, 21, 0.86), rgba(7, 11, 18, 0.96));
}

.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: "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.01em;
}

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

.wallet-method-btn {
  border: 1px solid rgba(55, 212, 196, 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: #071b19;
  background: linear-gradient(180deg, #9df0e8 0%, #6ad9ce 100%);
}

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

.wallet-topup-input {
  border: 1px solid rgba(55, 212, 196, 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;
}

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

.quick-action-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(55, 212, 196, 0.2);
  border-radius: 10px;
  padding: 11px 12px;
  text-decoration: none;
  color: #d5ddeb;
  background: rgba(8, 12, 18, 0.8);
  font-size: 0.86rem;
}

.quick-action-item svg {
  width: 17px; height: 17px; flex: none;
  color: var(--gold);
  opacity: 0.9;
}

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

.quick-actions-help {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.quick-actions-help-icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
}
.quick-actions-help-icon svg { width: 19px; height: 19px; }

.quick-actions-help-title {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  font-size: 0.92rem;
}

.quick-actions-help-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.quick-actions-help-btn {
  margin-top: 14px;
  width: 100%;
  text-align: center;
}

/* ── История покупок ── */
.history-section {
  margin-top: 4px;
}

.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;
  border: 1px solid rgba(55, 212, 196, 0.16);
  border-radius: 8px;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
  background:
    radial-gradient(130% 120% at 0% -20%, rgba(55, 212, 196, 0.08), transparent 45%),
    linear-gradient(165deg, rgba(9, 14, 21, 0.86), rgba(7, 11, 18, 0.96));
}

.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);
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}

.history-row {
  cursor: pointer;
}

.history-row:hover td:first-child {
  border-left-color: var(--gold);
}

.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: 860px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

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

  .pass-hero-top {
    gap: 16px;
  }

  .pass-tier {
    border-left: none;
    padding-left: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.14);
    padding-top: 14px;
    width: 100%;
  }
}

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

  .pass-hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .pass-tier {
    justify-content: space-between;
  }

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

  .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;
  }
}
