:root {
  --bg: #050608;
  --bg-alt: #0c0f17;
  --panel: #111520;
  --border: #1e2230;
  --gold: #f5c547;
  --gold-soft: #f3b13d;
  --gold-faint: rgba(245, 197, 71, 0.18);
  --fg: #f5f5f5;
  --muted: #9fa4b8;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Vazirmatn", "IRANYekan", "Segoe UI", sans-serif;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(245, 197, 71, 0.35), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--fg);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 0 10px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  font-size: 32px;
  padding: 14px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 20%, rgba(245, 197, 71, 0.75), rgba(17, 18, 25, 0.6));
  border: 1px solid rgba(245, 197, 71, 0.44);
  box-shadow: 0 18px 35px rgba(245, 197, 71, 0.25);
}

.brand h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--gold);
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 71, 0.35);
  background: rgba(17, 21, 32, 0.85);
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.identity-pill.is-premium {
  border-color: rgba(245, 197, 71, 0.7);
  box-shadow: 0 0 26px rgba(245, 197, 71, 0.35);
}

.identity-pill.is-admin {
  border-color: rgba(94, 234, 212, 0.7);
  box-shadow: 0 0 26px rgba(94, 234, 212, 0.35);
}

.identity-pill .dot {
  color: rgba(255, 255, 255, 0.35);
}

.kebab {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 71, 0.25);
  background: rgba(15, 18, 28, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.kebab span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.kebab:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 197, 71, 0.5);
}

.dropdown {
  position: fixed;
  top: 70px;
  right: 20px;
  background: rgba(12, 15, 23, 0.95);
  border: 1px solid rgba(245, 197, 71, 0.28);
  border-radius: 16px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 210px;
  z-index: 900;
}

.dropdown.hidden {
  display: none;
}

.dropdown button {
  background: none;
  border: none;
  color: var(--fg);
  text-align: right;
  padding: 14px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown button:hover {
  background: rgba(245, 197, 71, 0.12);
  color: var(--gold);
}

.dropdown button.is-locked {
  color: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
}

.dropdown button.is-locked:hover {
  background: none;
  color: rgba(255, 255, 255, 0.45);
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 620px;
  line-height: 1.6;
}

.profile-card {
  margin-top: 14px;
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid rgba(245, 197, 71, 0.28);
  background:
    linear-gradient(140deg, rgba(245, 197, 71, 0.12), rgba(17, 17, 26, 0.92));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  box-shadow: 0 26px 40px rgba(5, 6, 8, 0.55);
}

.profile-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-glow {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(245, 197, 71, 0.65), rgba(17, 20, 28, 0.92));
  border: 1px solid rgba(245, 197, 71, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--fg);
  box-shadow: 0 18px 40px rgba(245, 197, 71, 0.28);
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-copy .label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.profile-copy h2 {
  margin: 0;
  font-size: 26px;
  color: var(--gold);
}

.role-tag {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.role-tag span {
  color: var(--gold);
  font-weight: 600;
}

.cta {
  padding: 14px 24px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold), #f3962e);
  color: #050608;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 20px 35px rgba(245, 197, 71, 0.32);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 45px rgba(245, 197, 71, 0.4);
}

.cta:active {
  transform: translateY(0);
}

.cta:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.grid {
  margin-top: 28px;
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  padding: 20px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  font-size: 16px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card.admin-card {
  border-color: rgba(245, 197, 71, 0.55);
  background: linear-gradient(140deg, rgba(245, 197, 71, 0.16), rgba(17, 17, 26, 0.92));
}

.card.admin-card:hover {
  box-shadow: 0 24px 42px rgba(245, 197, 71, 0.35);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 197, 71, 0.25), rgba(245, 197, 71, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 197, 71, 0.38);
  box-shadow: 0 22px 40px rgba(6, 6, 8, 0.55);
}

.card:active {
  transform: translateY(0);
}

.card.locked {
  opacity: 0.55;
  filter: grayscale(0.2);
  border-style: dashed;
}

.card.locked::after {
  content: "قفل";
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 1px;
}

.panel {
  position: relative;
  margin-top: 30px;
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px 22px;
  min-height: 200px;
  box-shadow: 0 24px 36px rgba(4, 4, 6, 0.6);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 0% 0%, rgba(245, 197, 71, 0.2), transparent 65%);
  pointer-events: none;
}

.panel h2 {
  margin-top: 0;
  color: var(--gold);
  font-size: 22px;
}

.panel p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

.panel h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 18px;
}

.admin-events {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-events li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(12, 15, 23, 0.8);
  border: 1px solid rgba(245, 197, 71, 0.12);
}

.admin-users-toolbar {
  margin: 18px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-users-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 71, 0.18);
  background: rgba(15, 18, 28, 0.8);
  color: var(--fg);
}

.admin-users-toolbar button {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #050608;
}

.admin-users-toolbar button.ghost {
  background: transparent;
  border: 1px solid rgba(245, 197, 71, 0.4);
  color: var(--gold);
}

.access-code-form {
  margin: 16px 0;
}

.access-code-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, auto));
  gap: 10px;
  align-items: center;
}

.access-code-row input[type="text"],
.access-code-row input[type="number"],
.access-code-row input[type="datetime-local"],
.access-code-row select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 71, 0.25);
  background: rgba(15, 18, 28, 0.85);
  color: var(--fg);
}

.access-code-row button.ghost {
  background: rgba(15, 18, 28, 0.85);
  color: var(--gold);
  border: 1px solid rgba(245, 197, 71, 0.35);
}

.access-codes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.access-code-card {
  border-radius: 16px;
  border: 1px solid rgba(245, 197, 71, 0.18);
  background: rgba(13, 16, 24, 0.9);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.code-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1.4px;
}

.code-copy {
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  background: rgba(245, 197, 71, 0.2);
  color: var(--gold);
  transition: background 0.15s ease;
}

.code-copy:hover {
  background: rgba(245, 197, 71, 0.35);
}

.code-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.code-status {
  font-weight: 600;
}

.code-status-active {
  color: #4ade80;
}

.code-status-inactive {
  color: #f87171;
}

.admin-users {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-access-grid {
  display: grid;
  gap: 16px;
  margin: 18px 0 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-access-card {
  border-radius: 16px;
  border: 1px solid rgba(245, 197, 71, 0.18);
  background: rgba(15, 18, 28, 0.85);
  padding: 18px;
  box-shadow: 0 16px 30px rgba(4, 4, 6, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feature-title {
  color: var(--gold);
  font-weight: 600;
  font-size: 16px;
}

.feature-access-roles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.feature-role input {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

.feature-actions {
  display: flex;
  justify-content: flex-end;
}

.feature-save {
  border: none;
  border-radius: 12px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #050608;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.feature-save:hover {
  transform: translateY(-1px);
}

.feature-save.loading {
  opacity: 0.6;
  pointer-events: none;
}

.admin-user-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  border-radius: 18px;
  border: 1px solid rgba(245, 197, 71, 0.15);
  background: rgba(12, 15, 23, 0.88);
  padding: 18px 20px;
}

.admin-user-meta {
  flex: 1 1 260px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.admin-user-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

.admin-user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.admin-user-actions label {
  color: var(--muted);
  font-size: 13px;
}

.admin-user-actions select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 71, 0.35);
  background: rgba(17, 21, 32, 0.9);
  color: var(--fg);
}

.admin-user-actions select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-user-actions input[type="datetime-local"] {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 71, 0.25);
  background: rgba(15, 18, 28, 0.8);
  color: var(--fg);
}

.admin-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-save {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #050608;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.admin-save:hover {
  transform: translateY(-1px);
}

.admin-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.admin-save.loading {
  position: relative;
}

.admin-save.loading::after {
  content: '...';
  margin-right: 6px;
}

.profile-code {
  margin: 18px 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 197, 71, 0.2);
  background: rgba(15, 18, 28, 0.85);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-code h3 {
  margin: 0;
  color: var(--gold);
  font-size: 16px;
}

.profile-code-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-code-form input[type="text"] {
  flex: 1 1 200px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 197, 71, 0.25);
  background: rgba(15, 18, 28, 0.85);
  color: var(--fg);
}

.profile-code-form button {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #050608;
  transition: transform 0.12s ease;
}

.profile-code-form button:hover {
  transform: translateY(-1px);
}

.admin-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 16px;
  background: rgba(245, 197, 71, 0.92);
  color: #050608;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

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

.admin-toast.error {
  background: rgba(250, 82, 82, 0.92);
  color: #fff;
}

.footnote {
  margin-top: 22px;
  text-align: center;
  color: rgba(159, 164, 184, 0.75);
  font-size: 12px;
}

.locked {
  opacity: 0.55;
  filter: grayscale(0.3);
}

.kpi {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.kpi .box {
  background: rgba(15, 17, 23, 0.85);
  border: 1px solid rgba(245, 197, 71, 0.2);
  border-radius: 14px;
  padding: 14px;
  min-width: 140px;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px rgba(245, 197, 71, 0.08);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.alert {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(245, 197, 71, 0.16);
  border: 1px solid rgba(245, 197, 71, 0.4);
  color: var(--gold);
  font-size: 14px;
}

.vip-access {
  margin: 18px 0 6px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(245, 197, 71, 0.16) 0%, rgba(9, 12, 20, 0.92) 60%);
  border: 1px solid rgba(245, 197, 71, 0.3);
  box-shadow: 0 16px 32px rgba(245, 197, 71, 0.12);
}

.vip-access strong {
  display: block;
  color: var(--gold);
  font-size: 15px;
  margin-bottom: 4px;
}

.vip-access .muted {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.vip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.vip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
  min-width: 140px;
}

.vip-btn:active {
  transform: scale(0.97);
}

.vip-btn-primary {
  background: linear-gradient(135deg, #f5c547, #f3b13d);
  color: #1b1f2c;
  box-shadow: 0 12px 26px rgba(245, 197, 71, 0.28);
}

.vip-btn-primary:hover {
  box-shadow: 0 18px 34px rgba(245, 197, 71, 0.35);
}

.vip-btn-secondary {
  background: rgba(15, 18, 28, 0.92);
  border: 1px solid rgba(245, 197, 71, 0.35);
  color: var(--gold);
}

.vip-btn-secondary:hover {
  border-color: rgba(245, 197, 71, 0.6);
}

.badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 197, 71, 0.16);
  color: var(--gold);
  font-size: 13px;
  border: 1px solid rgba(245, 197, 71, 0.32);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.metrics .metric {
  background: rgba(15, 18, 28, 0.85);
  border: 1px solid rgba(245, 197, 71, 0.18);
  border-radius: 16px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(245, 197, 71, 0.08);
}

.metrics .metric strong {
  display: block;
  color: var(--gold);
  font-size: 15px;
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .identity-pill {
    align-self: flex-start;
  }

  .profile-card {
    align-items: flex-start;
  }

  .cta {
    width: 100%;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
.admin-subheading {
  letter-spacing: 0.4px;
}
.identity-pill.is-admin {
  border-color: rgba(94, 234, 212, 0.7);
  box-shadow: 0 0 26px rgba(94, 234, 212, 0.35);
  color: #5eead4;
}
