@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #05050a;
  --sidebar: #0c0c14;
  --card: #12121b;
  --border: rgba(255,255,255,.08);
  --accent: #8b5cf6;
  --purple: #8b5cf6;
  --purple-dark: #6d28d9;
  --purple-glow: rgba(139,92,246,.35);
  --text: #e2e8f0;
  --muted: #64748b;
  --gradient: linear-gradient(135deg, #6d28d9, #8b5cf6);
  --profile-card: #111118;
  --profile-input: #0c0c12;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  text-decoration: none;
  margin-bottom: 2rem;
  display: block;
}

.sidebar-logo {
  width: 2.5rem;
  height: auto;
  display: block;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: .25rem;
  transition: background .2s, color .2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(139,92,246,.1);
  color: var(--accent);
}

.sidebar-nav a i { font-size: 1.1rem; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-info strong {
  font-size: .85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-info span {
  color: var(--muted);
  font-size: .72rem;
}

.avatar-shell {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 50%;
  background: rgba(139,92,246,.1);
}

.avatar-shell-small {
  width: 42px;
  height: 42px;
}

.avatar-shell-large {
  width: 88px;
  height: 88px;
}

.user-avatar,
.avatar-fallback {
  width: 100%;
  height: 100%;
}

.user-avatar {
  display: block;
  object-fit: cover;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.25rem;
}

.avatar-shell-large .avatar-fallback { font-size: 2rem; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .7rem 1rem;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 10px;
  color: #fca5a5;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}

.main-content {
  padding: 2rem;
  overflow-y: auto;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: .25rem;
}

.page-sub {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.dash-card h3 {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.dash-card h3 i { color: var(--accent); }

.dash-card .value {
  font-size: 1.1rem;
  font-weight: 600;
  word-break: break-all;
}

.dash-card .value.mono {
  font-family: monospace;
  font-size: 1rem;
  color: #4ade80;
  letter-spacing: .05em;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar-actions {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: .55rem;
}

.profile-avatar-actions small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

.btn-avatar {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem .9rem;
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 9px;
  background: rgba(139,92,246,.1);
  color: var(--accent);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
}

.avatar-alert {
  margin-top: .8rem;
  font-size: .78rem;
}

.avatar-alert.success { color: #86efac; }
.avatar-alert.error { color: #fca5a5; }

.key-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
}

.key-status.active {
  background: rgba(34,197,94,.15);
  color: #4ade80;
}

.key-status.inactive {
  background: rgba(239,68,68,.1);
  color: #fca5a5;
  flex-wrap: wrap;
  max-width: 100%;
}

.loader-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
}

.loader-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.2);
  border-radius: 16px;
  font-size: 2rem;
  color: var(--accent);
}

.loader-card h3 {
  font-size: 1.2rem;
  margin-bottom: .5rem;
}

.loader-card p {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 2rem;
  background: var(--gradient);
  color: #0f172a;
  font-weight: 700;
  font-size: .95rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow .2s;
}

.btn-download:hover {
  box-shadow: 0 0 30px rgba(139,92,246,.35);
}

.btn-download:disabled,
.btn-download.disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

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

.orders-table th,
.orders-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

.orders-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
}

.hidden { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.auth-back {
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.auth-back:hover { color: var(--accent); }

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.auth-brand-logo {
  display: block;
  width: 5rem;
  height: auto;
  margin: 0 auto .5rem;
  filter: drop-shadow(0 0 20px rgba(139,92,246,.35));
}

.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.auth-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: .65rem .4rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: .78rem;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
}

.auth-tab.active {
  background: var(--gradient);
  color: #0f172a;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .4rem;
  font-weight: 500;
}

.auth-field input {
  width: 100%;
  padding: .8rem 1rem;
  background: #0a0a12;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(139,92,246,.4);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .55rem;
}

.captcha-img {
  display: block;
  width: 160px;
  height: 50px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0c0c16;
  object-fit: contain;
}

.captcha-refresh {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0a0a12;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.captcha-refresh:hover {
  color: #c4b5fd;
  border-color: rgba(139,92,246,.4);
}

.auth-btn {
  width: 100%;
  padding: .9rem;
  margin-top: .5rem;
  border: none;
  border-radius: 10px;
  background: var(--gradient);
  color: #0f172a;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-btn:disabled { opacity: .6; cursor: wait; }

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .85rem;
  color: var(--muted);
}

.auth-footer a { color: var(--accent); text-decoration: none; }

.auth-key-hint {
  font-size: .82rem;
  color: var(--muted);
  background: rgba(139,92,246,.08);
  border: 1px solid rgba(139,92,246,.15);
  border-radius: 8px;
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.auth-key-hint i {
  color: var(--accent);
  margin-right: .25rem;
}

.auth-field input.key-input {
  font-family: monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  margin-bottom: 1rem;
  text-align: center;
}

.auth-alert-error {
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
}

.auth-alert-success {
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.3);
  color: #86efac;
}

.dash-card-key .btn-copy-key {
  margin-top: .75rem;
  padding: .5rem 1rem;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 8px;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.loader-hint {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 1rem;
}

.orders-card { margin-top: 2rem; }

.table-wrap { overflow-x: auto; }

.empty-row {
  color: var(--muted) !important;
  text-align: center;
  padding: 1.5rem !important;
}

.key-cell {
  font-family: monospace;
  color: #4ade80 !important;
  font-size: .8rem;
}

.key-status a { color: var(--accent); }

.registerkey-panel {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}

.registerkey-hint {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .65rem;
}

.registerkey-hint i { color: var(--accent); margin-right: .2rem; }

.registerkey-form {
  display: flex;
  gap: .5rem;
}

.registerkey-form input {
  flex: 1;
  min-width: 0;
  padding: .6rem .75rem;
  background: #0a0a12;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: monospace;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  outline: none;
}

.registerkey-form input:focus {
  border-color: rgba(139,92,246,.4);
}

.btn-registerkey {
  padding: .6rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--gradient);
  color: #0f172a;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-registerkey:disabled { opacity: .6; cursor: wait; }

.panel-key-alert {
  margin-top: .5rem;
  font-size: .78rem;
  text-align: center;
}

.panel-key-alert.error { color: #fca5a5; }
.panel-key-alert.success { color: #86efac; }

.key-status .link-registerkey {
  color: #8b5cf6;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.registerkey-actions {
  margin-top: .65rem;
}

.registerkey-actions .link-registerkey {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 8px;
  color: #8b5cf6;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
}

.registerkey-actions .link-registerkey:hover {
  background: rgba(139,92,246,.2);
}

@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── Profile page ── */

.profile-page {
  padding: 1.5rem 2rem 2.5rem;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.profile-header-card {
  background: var(--profile-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.profile-banner {
  position: relative;
  height: 140px;
  overflow: hidden;
  background: #0a0a0a;
}

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

.btn-change-banner {
  position: absolute;
  top: .75rem;
  right: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .75rem;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s;
}

.btn-change-banner:hover {
  background: rgba(0,0,0,.75);
}

.profile-header-body {
  padding: 0 1.5rem 1.25rem;
}

.profile-top-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: -44px;
  position: relative;
  flex-wrap: wrap;
}

.profile-avatar-block {
  position: relative;
  flex: 0 0 auto;
}

.avatar-shell-profile {
  width: 96px;
  height: 96px;
  border: 3px solid var(--profile-card);
  border-radius: 50%;
  background: #1a1a24;
}

.avatar-shell-profile .avatar-fallback {
  font-size: 2.25rem;
  color: #a78bfa;
  background: #12121b;
}

.btn-edit-avatar {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  border: 2px solid var(--profile-card);
  border-radius: 50%;
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s;
}

.btn-edit-avatar:hover {
  background: var(--purple-dark);
}

.profile-identity {
  flex: 1;
  min-width: 0;
  padding-top: 52px;
}

.profile-display-name {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .5rem;
  display: flex;
  align-items: baseline;
  gap: .35rem;
  flex-wrap: wrap;
}

.profile-uid {
  color: var(--muted);
  font-weight: 700;
  font-size: 1.1rem;
}

.profile-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: #94a3b8;
}

.pill-online .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,.6);
}

.pill-achievements i {
  color: #fbbf24;
  font-size: .8rem;
}

.badge-member {
  margin-top: 52px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 8px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: #94a3b8;
}

.badge-owner {
  margin-top: 52px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 8px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(139,92,246,.18);
  border: 1px solid rgba(139,92,246,.45);
  color: #c4b5fd;
}

.badge-staff {
  margin-top: 52px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 8px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.badge-admin {
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.35);
  color: #93c5fd;
}

.badge-mod {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.3);
  color: #86efac;
}

.badge-sup {
  background: rgba(251,191,36,.12);
  border: 1px solid rgba(251,191,36,.3);
  color: #fcd34d;
}

.staff-card {
  min-height: auto;
}

.staff-role-form {
  display: grid;
  grid-template-columns: 1.2fr .8fr auto;
  gap: .85rem;
  align-items: end;
  margin-bottom: 1rem;
}

.staff-users-wrap h3 {
  font-size: .9rem;
  margin-bottom: .75rem;
}

.staff-users-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.staff-user-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .75rem;
  align-items: center;
  padding: .85rem 1rem;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.staff-user-main {
  min-width: 0;
}

.staff-user-main strong {
  display: block;
  font-size: .88rem;
  margin-bottom: .15rem;
}

.staff-user-main span,
.staff-user-uid {
  color: var(--muted);
  font-size: .75rem;
}

.staff-role-pill {
  display: inline-flex;
  align-items: center;
  padding: .28rem .6rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.staff-role-pill.role-owner,
.staff-role-pill.role-admin { background: rgba(59,130,246,.15); color: #93c5fd; }
.staff-role-pill.role-mod { background: rgba(34,197,94,.12); color: #86efac; }
.staff-role-pill.role-sup { background: rgba(251,191,36,.12); color: #fcd34d; }
.staff-role-pill.role-user { background: rgba(255,255,255,.05); color: #94a3b8; }

.staff-empty {
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
  padding: 1rem;
}

.input-icon-wrap select {
  width: 100%;
  padding: .75rem .85rem .75rem 2.5rem;
  background: var(--profile-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  outline: none;
  appearance: none;
}

.owner-loader-upload {
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.owner-loader-head h3 {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.owner-loader-head h3 i {
  color: var(--purple);
}

.owner-loader-head p {
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: 1rem;
}

.owner-loader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: .65rem;
}

.owner-loader-file {
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: .5rem;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 1rem 0 1.25rem;
}

.btn-profile-primary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.1rem;
  background: var(--purple);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}

.btn-profile-primary:hover:not(:disabled) {
  background: var(--purple-dark);
  box-shadow: 0 0 24px var(--purple-glow);
}

.btn-profile-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-profile-ghost {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #94a3b8;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.btn-profile-ghost:hover:not(:disabled) {
  border-color: rgba(255,255,255,.18);
  color: var(--text);
}

.btn-profile-ghost.btn-sm {
  padding: .45rem .85rem;
  font-size: .75rem;
}

.profile-info-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}

.profile-info-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.profile-info-card {
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem .85rem;
  min-width: 0;
}

.info-label {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}

.info-label i {
  font-size: .75rem;
}

.info-value {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-2fa-disabled {
  color: #fbbf24 !important;
}

.info-2fa-enabled {
  color: #4ade80 !important;
}

.info-2fa-pending {
  color: #fbbf24 !important;
}

.auth-small-hint {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .72rem;
}

.overview-grid-security {
  margin-top: 1.25rem;
}

.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.profile-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .85rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}

.profile-tab:hover {
  color: #94a3b8;
}

.profile-tab.active {
  color: #fff;
  border-bottom-color: #fff;
}

.profile-tab i {
  font-size: 1rem;
}

.tab-warning {
  color: #fbbf24;
  font-size: .85rem;
  line-height: 1;
}

.tab-count {
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
}

.profile-panel {
  animation: profileFade .2s ease;
}

@keyframes profileFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.overview-grid > .overview-card {
  width: 100%;
}

.security-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--profile-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
}

.stat-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.25);
  color: var(--purple);
  font-size: 1.2rem;
}

.stat-body {
  min-width: 0;
}

.stat-label {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .2rem;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.loader-panel {
  margin-top: 1.25rem;
  min-height: auto;
}

.loader-panel-inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.loader-panel-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.25);
  color: var(--purple);
  font-size: 1.6rem;
}

.loader-panel-text {
  flex: 1;
  min-width: 180px;
}

.loader-panel-text h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.loader-panel-text p {
  color: var(--muted);
  font-size: .8rem;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.quick-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1rem;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: #94a3b8;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}

.quick-link:hover {
  border-color: rgba(139,92,246,.35);
  color: var(--text);
  background: rgba(139,92,246,.08);
}

.quick-link i {
  font-size: 1.15rem;
  color: var(--purple);
}

.overview-card {
  background: var(--profile-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  min-height: 280px;
}

.overview-card-head {
  margin-bottom: 1.25rem;
}

.overview-card-head h2 {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.overview-card-head h2 i {
  color: var(--purple);
  font-size: 1.05rem;
}

.overview-card-head p {
  color: var(--muted);
  font-size: .78rem;
}

.overview-card-head-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.active-count {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
  padding-top: .15rem;
}

.subscription-form .form-field {
  margin-bottom: 1rem;
}

.subscription-form label {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: .4rem;
  font-weight: 500;
}

.subscription-form .required {
  color: #f87171;
}

.subscription-form .form-hint {
  margin: -0.35rem 0 1rem;
  font-size: .72rem;
  line-height: 1.4;
  color: var(--muted);
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap i {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}

.input-icon-wrap input {
  width: 100%;
  padding: .75rem .85rem .75rem 2.5rem;
  background: var(--profile-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  outline: none;
  transition: border-color .2s;
}

.input-icon-wrap input:focus {
  border-color: rgba(139,92,246,.45);
}

.input-icon-wrap input::placeholder {
  color: #475569;
  font-family: monospace;
  letter-spacing: .04em;
}

.btn-subscribe {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.2rem;
  margin-top: .25rem;
  background: var(--purple);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}

.btn-subscribe:hover {
  background: var(--purple-dark);
}

.subscriptions-list {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subscriptions-empty {
  text-align: center;
  padding: 1rem .5rem 2rem;
  width: 100%;
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1.5rem;
  color: var(--muted);
}

.subscriptions-empty p {
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.btn-browse-store {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.1rem;
  background: var(--purple);
  border-radius: 10px;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
}

.btn-browse-store:hover {
  background: var(--purple-dark);
  box-shadow: 0 0 20px var(--purple-glow);
}

.subscription-item {
  width: 100%;
  text-align: left;
  padding: 1rem;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 10px;
}

.subscription-item strong {
  display: block;
  font-size: .88rem;
  margin-bottom: .25rem;
  color: #4ade80;
  font-family: monospace;
  letter-spacing: .03em;
}

.subscription-item span {
  font-size: .75rem;
  color: var(--muted);
}

.security-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.security-row strong {
  display: block;
  font-size: .85rem;
  margin-bottom: .15rem;
}

.security-muted {
  font-size: .78rem;
  color: var(--muted);
}

.media-card {
  min-height: auto;
}

.media-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.media-upload-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
  padding: 1rem;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.media-upload-item small {
  color: var(--muted);
  font-size: .72rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}

.achievement-card {
  padding: 1rem;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  opacity: .45;
}

.achievement-card.unlocked {
  opacity: 1;
  border-color: rgba(139,92,246,.3);
}

.achievement-card i {
  font-size: 1.5rem;
  color: var(--purple);
  margin-bottom: .5rem;
  display: block;
}

.achievement-card.unlocked i {
  color: #fbbf24;
}

.achievement-card strong {
  display: block;
  font-size: .78rem;
  margin-bottom: .2rem;
}

.achievement-card span {
  font-size: .68rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .profile-info-row,
  .profile-info-row-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .media-upload-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .profile-page {
    padding: 1rem;
  }

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

  .profile-identity,
  .badge-member,
  .badge-owner,
  .badge-staff {
    padding-top: 0;
    margin-top: 0;
  }

  .badge-member,
  .badge-owner,
  .badge-staff {
    margin-left: 0;
  }

  .staff-role-form {
    grid-template-columns: 1fr;
  }

  .staff-user-row {
    grid-template-columns: 1fr;
  }

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

/* ── Subscription chat ── */
.shoutbox-card { padding: 0; overflow: hidden; margin-top: 1rem; }
.shoutbox-head {
  min-height: 68px;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.shoutbox-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--text);
  font-size: 1rem;
}
.shoutbox-head h2 i { color: #a78bfa; }
.shoutbox-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  font-size: .75rem;
}
.shoutbox-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, .5);
}
.shoutbox-messages {
  height: 280px;
  padding: 1.1rem 1.25rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, .45) transparent;
}
.shoutbox-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .82rem;
}
.shoutbox-message {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: start;
  padding: .55rem 0;
}
.shoutbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #ddd6fe;
  background: rgba(139, 92, 246, .16);
  border: 1px solid rgba(139, 92, 246, .28);
  font-size: .8rem;
  font-weight: 800;
}
.shoutbox-avatar img { width: 100%; height: 100%; object-fit: cover; }
.shoutbox-message-main { min-width: 0; }
.shoutbox-message-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .18rem;
}
.shoutbox-message-name { color: #f8fafc; font-size: .82rem; font-weight: 800; }
.shoutbox-role {
  padding: .1rem .4rem;
  border-radius: 5px;
  border: 1px solid rgba(139, 92, 246, .4);
  color: #c4b5fd;
  background: rgba(139, 92, 246, .12);
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
}
.shoutbox-message-text {
  margin: 0;
  color: #aeb4c1;
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.shoutbox-message-time {
  color: #555b69;
  font-size: .68rem;
  white-space: nowrap;
  padding-top: .15rem;
}
.shoutbox-form { padding: .8rem 1rem; border-top: 1px solid var(--border); }
.shoutbox-input-wrap {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 46px;
  padding: 0 .45rem 0 .85rem;
  border: 1px solid rgba(139, 92, 246, .35);
  border-radius: 10px;
  background: #090910;
}
.shoutbox-input-wrap:focus-within {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .1);
}
.shoutbox-input-wrap > i { color: #8b5cf6; }
.shoutbox-input-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f8fafc;
  font: inherit;
  font-size: .82rem;
}
.shoutbox-input-wrap input:disabled { cursor: not-allowed; }
.shoutbox-input-wrap button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  cursor: pointer;
}
.shoutbox-input-wrap button:disabled { opacity: .35; cursor: not-allowed; }
.shoutbox-locked {
  margin-top: .65rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem .85rem;
  border-left: 3px solid #fbbf24;
  border-radius: 6px;
  color: #aeb4c1;
  background: rgba(251, 191, 36, .05);
  font-size: .78rem;
}
.shoutbox-locked i { color: #fbbf24; }
.shoutbox-alert { margin-top: .55rem; color: #fca5a5; font-size: .75rem; }

@media (max-width: 640px) {
  .shoutbox-messages { height: 240px; }
  .shoutbox-message { grid-template-columns: 32px minmax(0, 1fr); }
  .shoutbox-avatar { width: 32px; height: 32px; }
  .shoutbox-message-time { grid-column: 2; padding: 0; }
}
