:root {
  --bg: #0a0e17;
  --primary: #22c55e;
  --secondary: #3b82f6;
  --highlight: #facc15;
  --text: #e5e7eb;
  --surface: #0f1629;
  --border: rgba(229, 231, 235, 0.15);
  --muted: rgba(229, 231, 235, 0.72);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --glow-primary: rgba(34, 197, 94, 0.15);
  --glow-secondary: rgba(59, 130, 246, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background: 
    radial-gradient(ellipse at top right, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(34, 197, 94, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, #0d121f 100%);
  color: var(--text);
  overflow-x: hidden;
}

/* Global themed scrollbars (Chromium/Edge/Safari + Firefox) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.45) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
  -webkit-appearance: none;
}

*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  -webkit-appearance: none;
}

*::-webkit-scrollbar-track-piece {
  background: transparent;
  -webkit-appearance: none;
}

*::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.45);
  border-radius: 999px;
  border: none;
  box-shadow: none;
  -webkit-appearance: none;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 197, 94, 0.55);
}

*::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
  background: transparent;
  border: none;
}

*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:double-button,
*::-webkit-scrollbar-button:start,
*::-webkit-scrollbar-button:end,
*::-webkit-scrollbar-button:vertical:decrement,
*::-webkit-scrollbar-button:vertical:increment,
*::-webkit-scrollbar-button:horizontal:decrement,
*::-webkit-scrollbar-button:horizontal:increment {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
  border: none;
}

*::-webkit-scrollbar-corner {
  background: transparent;
  -webkit-appearance: none;
}

*::-webkit-resizer {
  background: transparent;
}

html,
body {
  scrollbar-color: rgba(59, 130, 246, 0.45) transparent !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  background: transparent !important;
}

html::-webkit-scrollbar-track,
html::-webkit-scrollbar-track-piece,
body::-webkit-scrollbar-track,
body::-webkit-scrollbar-track-piece {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.45) !important;
  border-radius: 999px !important;
  border: none !important;
  box-shadow: none !important;
}

html::-webkit-scrollbar-button,
html::-webkit-scrollbar-button:single-button,
html::-webkit-scrollbar-button:double-button,
html::-webkit-scrollbar-button:start,
html::-webkit-scrollbar-button:end,
html::-webkit-scrollbar-button:vertical:decrement,
html::-webkit-scrollbar-button:vertical:increment,
html::-webkit-scrollbar-button:horizontal:decrement,
html::-webkit-scrollbar-button:horizontal:increment,
body::-webkit-scrollbar-button,
body::-webkit-scrollbar-button:single-button,
body::-webkit-scrollbar-button:double-button,
body::-webkit-scrollbar-button:start,
body::-webkit-scrollbar-button:end,
body::-webkit-scrollbar-button:vertical:decrement,
body::-webkit-scrollbar-button:vertical:increment,
body::-webkit-scrollbar-button:horizontal:decrement,
body::-webkit-scrollbar-button:horizontal:increment {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  border: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "nav nav"
    "side main";
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

#navbar-slot {
  grid-area: nav;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#sidebar-slot {
  grid-area: side;
  border-right: 1px solid var(--border);
  background: rgba(15, 22, 41, 0.92);
  position: fixed;
  top: 72px;
  left: 0;
  width: 260px;
  height: calc(100vh - 72px);
  overflow: hidden;
  z-index: 40;
  backdrop-filter: blur(20px);
}

.page-content {
  grid-area: main;
  padding: clamp(0.9rem, 2vw, 2.25rem);
  min-height: 0;
  height: calc(100vh - 72px);
  display: grid;
  align-content: start;
  justify-items: stretch;
  overflow: auto;
  overflow-x: hidden;
}

.page-content > * {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.top-nav {
  height: 72px;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.4rem 0 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(229, 231, 235, 0.12);
  background: rgba(18, 25, 43, 0.55);
  transition: transform 0.16s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.brand:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(11, 15, 26, 0.35);
  border: 1px solid rgba(229, 231, 235, 0.1);
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.12rem;
  line-height: 1;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 950;
  letter-spacing: 0.01em;
}

.brand-name-accent {
  background: linear-gradient(90deg, #3b82f6 0%, #22c55e 55%, #facc15 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.nav-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 25, 43, 0.84);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.16s ease;
}

.nav-auth-link:hover {
  background: rgba(59, 130, 246, 0.16);
  transform: translateY(-1px);
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.withdraw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.16s ease;
}

.withdraw-btn:hover {
  background: rgba(34, 197, 94, 0.24);
  transform: translateY(-1px);
}

.withdraw-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

.xp-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2ec9ff, #1e62ff);
  color: #eaf5ff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.45rem;
}

.xp-track {
  width: 140px;
  height: 16px;
  border-radius: 999px;
  background: rgba(229, 231, 235, 0.18);
  border: 1px solid rgba(229, 231, 235, 0.14);
  overflow: hidden;
}

.xp-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
  transition: width 0.25s ease;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.5rem 0.28rem 0.28rem;
  background: rgba(18, 25, 43, 0.9);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(229, 231, 235, 0.2);
}

.user-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(18, 25, 43, 0.9);
}

.balance-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.05;
}

.balance-value {
  color: var(--highlight);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.05;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.sidebar {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.2rem 0.85rem 0;
}
.sidebar-mobile-header {
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  padding: 0 0 1.2rem;
}

.sidebar-link {
  color: var(--muted);
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sidebar-link:hover {
  background: rgba(59, 130, 246, 0.18);
  color: var(--text);
  transform: translateX(4px);
}

.sidebar-link:active {
  transform: translateX(2px);
}

.hero {
  background: linear-gradient(130deg, rgba(34, 197, 94, 0.18), rgba(59, 130, 246, 0.2));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  padding: 2.3rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.4vw, 2.8rem);
  line-height: 1.15;
}

.hero p {
  max-width: 700px;
  margin: 1rem 0 1.5rem;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  border-radius: 12px;
  border: none;
  font-weight: 700;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #09110a;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.45);
}

.btn-secondary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #eff6ff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.45);
}

.stats-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.stat-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(18, 25, 43, 0.9) 0%, rgba(15, 22, 41, 0.8) 100%);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

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

.stat-value {
  margin: 0.4rem 0 0;
  color: var(--highlight);
  font-size: 1.4rem;
  font-weight: 800;
}

.section {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(18, 25, 43, 0.85) 0%, rgba(15, 22, 41, 0.75) 100%);
  padding: 1.3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.section h2 {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.feature {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.9rem;
  background: rgba(11, 15, 26, 0.4);
}

.feature h3 {
  margin: 0;
  font-size: 1rem;
}

.feature p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.placeholder {
  border: 1px dashed rgba(229, 231, 235, 0.25);
  border-radius: 14px;
  padding: 1.7rem;
  text-align: center;
  color: var(--muted);
  background: rgba(11, 15, 26, 0.42);
}

.auth-wrap {
  min-height: calc(100vh - 72px - 4.5rem);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(18, 25, 43, 0.86);
  box-shadow: var(--card-shadow);
  padding: 1.25rem;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.65rem;
}

.auth-card p {
  margin: 0.6rem 0 1rem;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 0.8rem;
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text);
}

.auth-form input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 15, 26, 0.8);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  outline: none;
}

.auth-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: rgba(11, 15, 26, 0.92);
  color: var(--text);
  padding: 0.7rem 2.2rem 0.7rem 0.8rem;
  outline: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8fb6ff 50%),
    linear-gradient(135deg, #8fb6ff 50%, transparent 50%),
    linear-gradient(to right, rgba(229, 231, 235, 0.16), rgba(229, 231, 235, 0.16));
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    calc(100% - 2.1rem) 0.5rem;
  background-size:
    6px 6px,
    6px 6px,
    1px calc(100% - 1rem);
  background-repeat: no-repeat;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-form input:focus {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-form select:focus {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-form select:hover {
  background-color: rgba(16, 22, 38, 0.95);
}

.auth-form select option {
  background: #0f1627;
  color: var(--text);
}

/* Custom themed select (fixes unstyleable native dropdown menu) */
.nice-select {
  position: relative;
  width: 100%;
}

.nice-select__native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.nice-select__btn {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 15, 26, 0.92);
  color: var(--text);
  padding: 0.7rem 2.2rem 0.7rem 0.8rem;
  outline: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.nice-select__btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.95rem;
  width: 9px;
  height: 9px;
  border-right: 2px solid #8fb6ff;
  border-bottom: 2px solid #8fb6ff;
  transform: translateY(-60%) rotate(45deg);
  opacity: 0.9;
}

.nice-select__btn:hover {
  background: rgba(16, 22, 38, 0.95);
}

.nice-select__btn:focus {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.nice-select__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 30;
  background: rgba(18, 25, 43, 0.98);
  border: 1px solid rgba(229, 231, 235, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  padding: 0.4rem;
  display: none;
  max-height: 260px;
  overflow: auto;
  backdrop-filter: blur(10px);
}

.nice-select.is-open .nice-select__menu {
  display: block;
}

.nice-select__item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 0.6rem 0.65rem;
  text-align: left;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.nice-select__item:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.25);
}

.nice-select__item.is-selected {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.25);
}

.nice-select__item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-note {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-note a {
  color: var(--highlight);
}

.withdraw-wrap,
.offers-wrap,
.settings-wrap {
  width: 100%;
  max-width: none;
}

.withdraw-header {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.8rem;
}

.withdraw-subtitle {
  margin: 0;
  color: var(--muted);
}

.withdraw-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
}

.withdraw-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  background: rgba(18, 25, 43, 0.84);
}

.withdraw-card h2 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  font-size: 1.15rem;
}

.withdraw-summary-value {
  margin: 0;
  color: var(--highlight);
  font-weight: 800;
  font-size: 1.35rem;
}

.withdraw-summary-fiat {
  margin-top: 0.45rem;
  margin-bottom: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.withdraw-summary-note {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.offers-header {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.8rem;
}

.offers-subtitle {
  margin: 0;
  color: var(--muted);
}

.offers-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
}

.offer-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(18, 25, 43, 0.84);
}

.offer-card h3 {
  margin: 0;
  font-size: 1rem;
}

.offer-card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.offer-status {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(59, 130, 246, 0.38);
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  color: #8eb8ff;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-header {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.8rem;
}

.settings-subtitle {
  margin: 0;
  color: var(--muted);
}

.settings-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.settings-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  background: rgba(18, 25, 43, 0.84);
}

.settings-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.settings-actions {
  margin-top: 0.95rem;
}

.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

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

.setting-value {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
}

.settings-inline-form {
  margin-top: 0.8rem;
}

/* Affiliate page */
.affiliate-header {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.8rem;
}

.affiliate-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.affiliate-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  margin-bottom: 1.15rem;
}

.affiliate-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  background: rgba(18, 25, 43, 0.84);
}

.affiliate-card h2 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  font-size: 1.15rem;
}

.affiliate-code-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.affiliate-edit-row {
  margin-top: 0.75rem;
}

.affiliate-edit-form {
  margin-top: 0.75rem;
}

.affiliate-code {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(229, 231, 235, 0.16);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  background: rgba(11, 15, 26, 0.55);
  color: var(--highlight);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.affiliate-earn-value {
  margin: 0;
  color: var(--highlight);
  font-weight: 900;
  font-size: 1.35rem;
}

.affiliate-earn-fiat {
  margin-top: 0.45rem;
  margin-bottom: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 750;
}

.affiliate-table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(229, 231, 235, 0.12);
  background: rgba(11, 15, 26, 0.35);
}

.affiliate-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.affiliate-table th,
.affiliate-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.1);
  text-align: left;
  white-space: nowrap;
}

.affiliate-table thead th {
  position: sticky;
  top: 0;
  background: rgba(18, 25, 43, 0.98);
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 800;
}

.affiliate-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.08);
}

.affiliate-table .num {
  text-align: right;
}

.affiliate-table .muted {
  color: var(--muted);
  text-align: center;
}

/* Admin page */
.admin-header {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.8rem;
}

.admin-subtitle {
  margin: 0;
  color: var(--muted);
}

.admin-wrap {
  width: 100%;
}

.admin-card {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  background: rgba(18, 25, 43, 0.84);
}

.admin-card h2 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  font-size: 1.15rem;
}

.admin-table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(229, 231, 235, 0.12);
  background: rgba(11, 15, 26, 0.35);
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.1);
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: rgba(18, 25, 43, 0.98);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.admin-table .num {
  text-align: right;
}

.admin-table .muted {
  text-align: center;
  color: var(--muted);
}

.admin-table .text-ellipsis {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-mini {
  padding: 0.42rem 0.68rem;
  font-size: 0.78rem;
}

.admin-admins-bar {
  margin-top: 1rem;
  border: 1px solid rgba(229, 231, 235, 0.12);
  border-radius: 14px;
  background: rgba(11, 15, 26, 0.45);
  padding: 0.8rem;
}

.admin-admins-bar h3 {
  margin: 0 0 0.6rem;
  font-size: 0.98rem;
}

.admin-admins-list {
  display: grid;
  gap: 0.5rem;
}

.admin-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 1px solid rgba(229, 231, 235, 0.12);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: rgba(18, 25, 43, 0.7);
}

.credit-history {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.55rem;
}

.credit-history-item {
  border: 1px solid rgba(229, 231, 235, 0.12);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: rgba(11, 15, 26, 0.42);
}

.credit-history-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.credit-history-delta {
  font-weight: 850;
}

.credit-history-delta.is-plus {
  color: #22c55e;
}

.credit-history-delta.is-minus {
  color: #f87171;
}

.credit-history-reason {
  color: var(--text);
}

.credit-history-time {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  margin-top: 0.45rem;
}

@media (max-width: 980px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "main";
    height: 100vh;
  }

  /* On mobile, hide the top navbar entirely (nav is moved into the sidebar). */
  #navbar-slot {
    display: none;
  }

  #sidebar-slot {
    position: fixed;
    top: 72px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 72px);
    z-index: 60;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border);
    box-shadow: var(--card-shadow);
  }

  .app-shell.sidebar-open #sidebar-slot {
    left: 0;
  }

  /* Sidebar becomes a full-height drawer from the top */
  #sidebar-slot {
    top: 0;
    height: 100vh;
  }

  .menu-toggle {
    display: none;
  }

  .xp-track {
    width: 90px;
  }

  .withdraw-btn {
    padding: 0.4rem 0.62rem;
    font-size: 0.8rem;
  }

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

  .user-name {
    max-width: 80px;
  }

  .page-content {
    padding: clamp(0.75rem, 2.8vw, 1.2rem);
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.7rem;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 1.5rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }
}

/* Mobile drawer controls */
.sidebar-overlay {
  display: none;
}

.app-shell.sidebar-open .sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 55;
}

/* Menu FAB slides just outside the sidebar edge when drawer opens */
@media (max-width: 980px) {
  body.sidebar-open .mobile-menu-fab {
    left: 268px; /* 260px sidebar + 8px breathing room */
  }
}

.mobile-menu-fab {
  display: none;
  position: fixed;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 70;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18, 25, 43, 0.92);
  color: var(--text);
  padding: 0.62rem 1.02rem;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  transition: left 0.2s ease;
}

@media (max-width: 980px) {
  .mobile-menu-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  /* Keep content from hiding behind the floating menu button */
  .page-content {
    padding-top: calc(clamp(0.75rem, 2.8vw, 1.2rem) + 2.2rem);
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .page-content > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero,
  .auth-card,
  .withdraw-card,
  .settings-card,
  .affiliate-card,
  .offer-card,
  .stat-card,
  .balance-chip,
  .user-chip {
    min-width: 0;
    max-width: 100%;
  }

  .setting-row {
    flex-wrap: wrap;
  }

  .auth-form input,
  .auth-form select,
  .nice-select,
  .nice-select__btn {
    max-width: 100%;
    min-width: 0;
  }

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

/* We no longer use a dedicated sidebar close button on mobile (Menu FAB toggles). */
@media (max-width: 980px) {
  .sidebar-mobile-header {
    padding: 0.1rem 0.85rem 0.8rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.12);
    margin-bottom: 0.8rem;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 55vh;
  }

  .sidebar-mobile-nav__inner .nav-user,
  .sidebar-mobile-nav__inner .nav-auth {
    display: grid;
    gap: 0.75rem;
    align-items: start;
    justify-items: stretch;
  }

  .sidebar-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: linear-gradient(130deg, rgba(59, 130, 246, 0.22), rgba(34, 197, 94, 0.18));
    color: var(--text);
    padding: 0.72rem 0.9rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    margin-bottom: 0.25rem;
  }

  .sidebar-mobile-nav__inner .balance-chip {
    width: 100%;
    border-radius: 14px;
  }

  .sidebar-mobile-nav__inner .user-chip {
    width: 100%;
    border-radius: 14px;
    justify-content: flex-start;
  }

  .sidebar-mobile-nav__inner .withdraw-btn {
    width: 100%;
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    justify-content: center;
  }

  .sidebar-mobile-nav__inner .xp-widget {
    width: 100%;
    justify-content: flex-start;
    gap: 0.65rem;
  }

  .sidebar-mobile-nav__inner .xp-track {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  /* ── Notification bell inline with XP bar ───────────────────── */
  /* Hide the bell when it appears as a standalone row in the grid  */
  .sidebar-mobile-nav__inner .notification-widget {
    display: none;
  }

  /* Wrap the xp-widget + bell together in a flex row */
  .sidebar-xp-notif-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  /* XP section fills all available width, pushing bell to the right */
  .sidebar-xp-notif-row .xp-widget {
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
  }

  /* Bell sits at the far right, never shrinks */
  .sidebar-xp-notif-row .notification-widget {
    display: inline-flex !important;
    flex-shrink: 0;
    margin-left: auto;
  }
}

/* Tickets Page Styles */
.tickets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.tickets-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
}

.tickets-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat {
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--muted);
  border: 1px solid var(--border);
}

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

.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.ticket-card:hover {
  border-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.ticket-card.unread {
  border-left: 4px solid var(--secondary);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ticket-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.ticket-badges {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.status {
  color: white;
}

.badge.priority {
  color: white;
}

.badge.unread-count {
  background: var(--secondary);
  color: white;
}

.ticket-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.ticket-meta .category {
  text-transform: capitalize;
}

.ticket-preview {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.875rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state h3 {
  margin: 0 0 1rem 0;
  color: var(--text);
  font-size: 1.5rem;
}

.empty-state p {
  margin: 0 0 2rem 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.error {
  text-align: center;
  padding: 2rem;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  margin: 1rem 0;
}

/* Ticket Detail View */
.ticket-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.ticket-info h2 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
}

.ticket-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.ticket-meta span {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Admin Controls */
.admin-actions {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-actions label {
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
}

.admin-actions select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  color: var(--text);
  font-size: 0.875rem;
  min-width: 150px;
}

.admin-actions select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.admin-actions button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.admin-actions .btn-primary {
  background: var(--secondary);
  color: white;
}

.admin-actions .btn-primary:hover {
  background: #2563eb;
}

.admin-actions .btn-secondary {
  background: var(--muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.admin-actions .btn-secondary:hover {
  background: var(--surface);
}

.admin-actions .btn-danger {
  background: #dc2626;
  color: white;
}

.admin-actions .btn-danger:hover {
  background: #b91c1c;
}

/* Chat Container */
.chat-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  display: flex;
  max-width: 80%;
}

.chat-message.own {
  align-self: flex-end;
}

.chat-message.other {
  align-self: flex-start;
}

.chat-message.system {
  align-self: center;
  max-width: 100%;
}

.message-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.chat-message.own .message-bubble {
  background: var(--secondary);
  border-color: var(--secondary);
}

.chat-message.system .message-bubble {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  font-style: italic;
  text-align: center;
}

.message-content {
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.message-time {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.8;
}

.chat-input-container {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.chat-input-wrapper input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.chat-input-wrapper input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-input-wrapper button {
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-input-wrapper button:hover {
  background: #2563eb;
}

.chat-input-wrapper button:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--card-shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tickets-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .stat-card {
    padding: 0.85rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .hero {
    padding: 1.2rem;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.75rem 1.4rem;
    font-size: 0.9rem;
  }

  .section {
    padding: 1rem;
  }

  .section h2 {
    font-size: 1rem;
  }

  .auth-card {
    padding: 1rem;
  }

  .auth-card h1 {
    font-size: 1.4rem;
  }
  
  .tickets-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .ticket-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .ticket-badges {
    flex-direction: row;
    align-items: center;
  }
  
  .ticket-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chat-container {
    height: 500px;
  }
  
  .chat-message {
    max-width: 90%;
  }
  
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
}

/* Balance Update Animations */
.balance-updated {
  animation: balancePulse 1s ease-in-out;
  color: var(--primary) !important;
}

@keyframes balancePulse {
  0% {
    transform: scale(1);
    color: var(--text);
  }
  50% {
    transform: scale(1.1);
    color: var(--primary);
  }
  100% {
    transform: scale(1);
    color: var(--text);
  }
}

.balance-chip {
  transition: all 0.3s ease;
}

.balance-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* KYC Management Styles */
.admin-nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-tab-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  background: var(--muted);
}

.admin-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.kyc-tab-content {
  margin-top: 1rem;
}

.admin-kyc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-kyc-stat-card {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(15, 22, 41, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-kyc-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.admin-kyc-stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.admin-kyc-stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.admin-kyc-table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.admin-kyc-table-header {
  background: var(--muted);
  padding: 1rem;
  font-weight: 600;
}

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

.admin-kyc-table th,
.admin-kyc-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-kyc-table th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}

.admin-kyc-table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-verified { background: #22c55e; color: white; }
.status-pending { background: #f59e0b; color: white; }
.status-rejected { background: #ef4444; color: white; }
.status-expired { background: #f97316; color: white; }

.admin-kyc-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-kyc-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-kyc-filter {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-kyc-filter:hover {
  background: var(--primary);
  color: white;
}

.admin-kyc-filter.active {
  background: var(--primary);
  color: white;
}

.admin-kyc-search {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
}

.admin-kyc-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.admin-kyc-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.admin-kyc-detail-row:last-child {
  border-bottom: none;
}

.admin-kyc-actions-cell {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .admin-kyc-stats {
    grid-template-columns: 1fr;
  }
  
  .admin-kyc-filters {
    flex-direction: column;
  }
  
  .admin-kyc-table-container {
    overflow-x: auto;
  }
}

/* Notification System Styles */
.notification-widget {
  position: relative;
  margin: 0 0.5rem;
}

.notification-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-btn:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.1);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--highlight);
  color: var(--bg);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.25rem;
  border-radius: 50%;
  min-width: 1rem;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.notification-popup {
  position: fixed !important;
  top: 4rem !important;
  right: 1rem !important;
  width: 360px;
  max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  height: 480px !important;
  max-height: 480px !important;
}

.notification-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.05);
  flex-shrink: 0;
}

.notification-popup-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.notification-popup-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.notification-popup-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-popup-close:hover {
  color: var(--text);
  background: rgba(239, 68, 68, 0.1);
}

.notification-popup-content {
  flex: 1 1 0;
  overflow-y: scroll !important;
  min-height: 0 !important;
  max-height: 100% !important;
}

.notification-loading,
.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  text-align: center;
}

.notification-loading .loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border);
  border-top: 2px solid var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.notification-empty svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.notification-list {
  padding: 0.5rem 0;
}

.notification-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: rgba(59, 130, 246, 0.05);
}

.notification-item.unread {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid var(--secondary);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--secondary);
  border-radius: 50%;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.notification-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.3;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 0.5rem;
}

.notification-message {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  margin: 0;
}

.notification-type {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.notification-type.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary);
}

.notification-type.warning {
  background: rgba(250, 204, 21, 0.1);
  color: var(--highlight);
}

.notification-type.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.notification-type.kyc {
  background: rgba(59, 130, 246, 0.1);
  color: var(--secondary);
}

.notification-type.balance {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary);
}

.notification-type.withdrawal {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.notification-type.info {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.notification-popup-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.05);
}

.mark-all-read-btn {
  background: transparent;
  color: var(--secondary);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mark-all-read-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--secondary);
}

.mark-all-read-btn:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .notification-popup {
    top: 3.5rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-height: calc(100vh - 4.5rem);
  }
  
  .notification-item {
    padding: 0.875rem 1rem;
  }
  
  .notification-title {
    font-size: 0.8125rem;
  }
  
  .notification-message {
    font-size: 0.75rem;
  }
}

/* Device Choice Styles */
.device-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.device-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.device-option:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: var(--secondary);
}

.device-option-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.device-option h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
  font-size: 1.25rem;
}

.device-option p {
  margin: 0 0 1.5rem 0;
  color: var(--muted);
  line-height: 1.5;
}

/* QR Code Styles */
.qr-code-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}

.qr-code-placeholder,
.qr-code-result {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-instructions {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.qr-instructions h4 {
  margin: 0 0 1rem 0;
  color: var(--text);
}

.qr-instructions ol {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--muted);
}

.qr-instructions li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.qr-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* ── Notification + XP grouped together ─────────────────────── */
.xp-notif-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.xp-notif-group .xp-widget {
  max-width: 100px;
}

/* ── XP bar + notification bell always inline on desktop ─────── */
.sidebar-xp-notif-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-xp-notif-row .notification-widget {
  display: inline-flex;
  flex-shrink: 0;
  margin: 0;
}

/* ── Mobile sidebar scrollable ───────────────────────────────── */
@media (max-width: 980px) {
  #sidebar-slot {
    overflow: hidden !important;
    height: 100vh !important;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar {
    height: 100%;
    overflow: hidden;
    padding-bottom: 0;
  }

  .sidebar-nav {
    overflow-y: auto;
    padding-bottom: 2rem;
    flex: 1;
    min-height: 0;
    max-height: 45vh; /* adjust this value as needed */
  }
}

.error-message {
  color: #ef4444;
  text-align: center;
  padding: 1rem;
}

/* Mobile responsive for device choice */
@media (max-width: 768px) {
  .device-options {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .device-option {
    padding: 1.5rem;
  }
  
  .qr-code-container {
    padding: 1rem;
  }
  
  .qr-actions {
    flex-direction: column;
  }
}