:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #ec4899;
  --bg-color: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.5);
}

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

body.dark-theme {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
    radial-gradient(at 50% 0%, hsla(225,39%,30%,0.2) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(339,49%,30%,0.2) 0, transparent 50%);
  background-attachment: fixed;
}

body.light-theme {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #db2777;
  --bg-color: #eef2ff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 16px rgba(79, 70, 229, 0.24);
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(236, 72, 153, 0.12) 0, transparent 42%),
    radial-gradient(at 70% 0%, rgba(79, 70, 229, 0.14) 0, transparent 48%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

#appRoot {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.oauth-callback-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-main);
  text-align: center;
}

.oauth-callback-loading strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
}

.oauth-callback-loading span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.oauth-callback-spinner {
  width: 42px;
  height: 42px;
  margin-bottom: 0.35rem;
  border: 3px solid rgba(148, 163, 184, 0.3);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: oauthSpin 0.75s linear infinite;
}

@keyframes oauthSpin {
  to { transform: rotate(360deg); }
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.5s ease-out;
}

.glass-panel h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glass-panel p.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  background-color: rgba(0,0,0,0.4);
}

textarea.form-control {
  resize: none;
}

.password-reset-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.65rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-light);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.password-reset-link:hover,
.password-reset-link:focus-visible {
  color: var(--secondary);
  text-shadow: 0 0 12px rgba(217, 70, 239, 0.35);
}

.cursor-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.96);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.cursor-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.btn.is-loading {
  gap: 0.55rem;
}

.btn-loading-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: oauthSpin 0.7s linear infinite;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.switch-auth {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.switch-auth a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.switch-auth a:hover {
  text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.sidebar-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 0 1.5rem 2rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-left-color: var(--primary);
}


.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem 3rem;
  animation: fadeIn 0.3s ease-in;
}

/* Topbar inside main content */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  position: relative;
}

.topbar-shell {
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.topbar-brand {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: 'Outfit', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 52%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.topbar-brand-group {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  flex: 0 0 auto;
}

.topbar-brand:hover,
.topbar-brand:focus-visible {
  filter: brightness(1.16) drop-shadow(0 0 12px rgba(236, 72, 153, 0.25));
  transform: translateY(-1px);
}

.topbar-center-block {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.topbar-current-server {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.server-strip-trigger {
  min-width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.server-strip-trigger:hover,
.server-strip-trigger.open {
  opacity: 0.72;
}

.server-strip-trigger-text {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.96);
  letter-spacing: -0.01em;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
  }

  .topbar-center-block {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    margin-top: 0.5rem;
  }

  .topbar-brand-group {
    gap: 0.65rem;
  }
}

.server-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
  padding: 0 0 0 260px;
  background: rgba(4, 10, 24, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.server-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.server-overlay-panel {
  width: 100%;
  min-height: 100vh;
  padding: 2rem 3rem 2.5rem;
  background: linear-gradient(180deg, rgba(18, 24, 45, 0.98), rgba(10, 16, 30, 0.96));
  transform: translateY(-100%);
  transition: transform 0.32s ease;
  overflow-y: auto;
}

.server-overlay.open .server-overlay-panel {
  transform: translateY(0);
}

.server-overlay-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.server-overlay-head-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.server-overlay-kicker {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.server-overlay-head {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.server-overlay-subhead {
  color: var(--text-muted);
  font-size: 1rem;
}

.server-overlay-close {
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(15,23,42,0.82);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.server-overlay-close:hover {
  color: var(--text-main);
  border-color: rgba(148,163,184,0.35);
}

.server-overlay-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.server-overlay-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 20px;
  padding: 1.2rem 1.15rem;
  color: var(--text-main);
  cursor: pointer;
  transition: 0.18s ease;
  min-height: 110px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.server-overlay-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.server-overlay-item.active {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.server-switcher-item-name {
  display: block;
  font-weight: 700;
}

.server-switcher-item-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}


.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: 'Outfit', sans-serif;
}

/* User Tab Profile specific */
.profile-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.staff-profile-shell {
  margin-bottom: 1rem;
}

.staff-inline-back {
  min-width: auto;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: rgba(226, 232, 240, 0.88);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.staff-inline-back:hover {
  color: #eef2ff;
  opacity: 0.82;
  transform: translateX(-2px);
}

.staff-inline-back:focus-visible {
  outline: none;
  color: #eef2ff;
}

.staff-inline-back-icon {
  font-size: 1rem;
  line-height: 1;
}

.staff-inline-back-text {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-left-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.profile-card-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.profile-card .avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  font-family: 'Outfit', sans-serif;
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
  text-align: center;
}

.profile-username {
  font-size: 2rem;
  margin: 0;
}

.profile-role-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.profile-stat-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.25rem;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-stat-row span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.profile-stat-row strong {
  font-size: 1.05rem;
  text-align: right;
}

.profile-stat-value-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.profile-stat-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-stat-balance strong {
  color: var(--warning);
  font-size: 1.2rem;
}

.profile-password-btn {
  margin-top: 0.5rem;
}

.profile-side-panel,
.profile-transactions-panel {
  padding: 1.25rem;
}

.profile-side-panel {
  align-self: start;
  padding: 1.1rem;
}

.profile-side-panel-linked {
  background:
    radial-gradient(circle at top right, rgba(110, 231, 183, 0.20), transparent 42%),
    linear-gradient(180deg, rgba(22, 163, 74, 0.28), rgba(5, 46, 22, 0.34));
  border-color: rgba(74, 222, 128, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 0 0 1px rgba(16, 185, 129, 0.10),
    0 16px 34px rgba(16, 185, 129, 0.20),
    0 0 34px rgba(34, 197, 94, 0.16);
}

.profile-side-panel-linked h4 {
  color: #bbf7d0;
}

.profile-discord-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.profile-discord-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.profile-discord-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(88, 101, 242, 0.15);
  color: #c7d2fe;
  font-weight: 700;
}

.profile-discord-name {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
}

.profile-discord-id {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.profile-discord-unlink {
  width: 100%;
}

body.light-theme .profile-side-panel-linked {
  background: linear-gradient(180deg, #f0fdf7 0%, #e5f8ef 100%);
  border-color: rgba(5, 150, 105, 0.38);
  color: #0f172a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 28px rgba(5, 150, 105, 0.14);
}

body.light-theme .profile-side-panel-linked h4 {
  color: #047857;
}

body.light-theme .profile-side-panel-linked .profile-discord-name {
  color: #0f172a;
}

body.light-theme .profile-side-panel-linked .profile-discord-id {
  color: #475569;
}

body.light-theme .profile-side-panel-linked .profile-discord-avatar {
  border-color: rgba(15, 23, 42, 0.2);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

body.light-theme .profile-side-panel-linked .profile-discord-unlink {
  border-color: rgba(5, 150, 105, 0.42);
  background: rgba(255, 255, 255, 0.74);
  color: #065f46;
}

body.light-theme .profile-side-panel-linked .profile-discord-unlink:hover,
body.light-theme .profile-side-panel-linked .profile-discord-unlink:focus-visible {
  border-color: #059669;
  background: #ffffff;
  color: #064e3b;
}

.profile-transactions-panel {
  min-width: 0;
  align-self: stretch;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.profile-transactions-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.profile-transactions-panel th:nth-child(1),
.profile-transactions-panel td:nth-child(1) {
  width: 120px;
}

.profile-transactions-panel th:nth-child(2),
.profile-transactions-panel td:nth-child(2) {
  width: 170px;
}

.profile-transactions-panel th:nth-child(3),
.profile-transactions-panel td:nth-child(3) {
  width: 140px;
}

.profile-transactions-panel .table-container {
  width: 100%;
  overflow-x: visible;
}

.profile-transactions-panel table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.profile-transactions-panel td:last-child,
.profile-transactions-panel th:last-child {
  white-space: normal;
  word-break: break-word;
}

.icon-edit-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.icon-edit-btn:hover {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.32);
}

.icon-edit-trigger {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(148, 163, 184, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.icon-edit-trigger:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #eef2ff;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.14);
}

.icon-edit-trigger:focus-visible {
  outline: none;
  background: rgba(99, 102, 241, 0.14);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.icon-edit-glyph {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modifier-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.modifier-toggle-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border-radius: 12px;
  height: 46px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.modifier-toggle-btn:hover {
  border-color: rgba(99,102,241,0.32);
  background: rgba(99,102,241,0.12);
}

.modifier-toggle-btn.active {
  background: linear-gradient(135deg, #6b63ff, #5850ec);
  border-color: rgba(107,99,255,0.75);
  color: #fff;
  box-shadow: 0 10px 20px rgba(88,80,236,0.25);
}

.staff-profile-modal {
  max-width: 1180px;
}

.staff-profile-layout {
  margin-bottom: 0;
}

.staff-profile-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.staff-profile-actions .btn {
  flex: 1 1 160px;
}

.staff-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.coin-balance {
  font-size: 3rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-admin { background: rgba(236, 72, 153, 0.2); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-server-admin { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-tech-admin { background: rgba(6, 182, 212, 0.2); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-kurator { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.badge-gm { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.badge-gd { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-st-moderator { background: rgba(99, 102, 241, 0.2); color: var(--primary); }
.badge-moderator { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge-helper { background: rgba(16, 185, 129, 0.2); color: var(--success); }

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

/* Store Grid */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.store-editor-toolbar {
  max-width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

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

.staff-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.staff-summary-card {
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-md);
}

.staff-summary-card strong {
  display: block;
  font-size: 1.3rem;
  margin-top: 0.35rem;
}

.staff-summary-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invite-code-copy {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.1rem 0.25rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--warning);
  font: inherit;
  font-family: monospace;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.invite-code-copy:hover,
.invite-code-copy:focus-visible {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  outline: none;
}

.bonus-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.bonus-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.3rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.58);
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.bonus-filter-chip span {
  color: var(--text-main);
  font-size: 0.85rem;
  opacity: 0.8;
}

.bonus-filter-chip:hover {
  border-color: rgba(99, 102, 241, 0.55);
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.12);
}

.bonus-filter-chip.active {
  border-color: rgba(99, 102, 241, 0.75);
  background: rgba(99, 102, 241, 0.22);
  color: var(--primary);
}

body.light-theme .bonus-filter-chip {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(100, 116, 139, 0.34);
  color: #334155;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

body.light-theme .bonus-filter-chip span {
  color: #0f172a;
  opacity: 0.95;
}

body.light-theme .bonus-filter-chip:hover {
  border-color: rgba(79, 70, 229, 0.48);
  background: rgba(238, 242, 255, 0.96);
  color: #1e293b;
}

body.light-theme .bonus-filter-chip.active {
  border-color: rgba(79, 70, 229, 0.75);
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

.bonus-comment-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  flex: 0 0 2.05rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.32);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.bonus-comment-icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
}

.bonus-comment-icon-btn:hover {
  border-color: rgba(99, 102, 241, 0.7);
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary);
}

.bonus-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.bonus-actions-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bonus-amount-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  color: var(--warning);
  font-weight: 800;
}

.bonus-amount-cell > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.bonus-amount-old {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(248, 113, 113, 0.9);
}

.bonus-amount-new {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.bonus-amount-new strong {
  color: var(--warning);
}

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

.staff-tile {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(30,41,59,0.9), rgba(15,23,42,0.95));
  border-radius: 16px;
  padding: 1rem 0.9rem;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: var(--shadow-md);
}

.staff-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.35);
}

.staff-tile.is-readonly {
  opacity: 0.86;
}

.staff-tile-avatar {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 0.9rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.staff-tile-name {
  text-align: center;
  font-weight: 700;
  margin-bottom: 0.8rem;
  word-break: break-word;
}

.staff-tile-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.staff-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: center;
}

body.light-theme .staff-summary-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.light-theme .staff-tile {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(148, 163, 184, 0.34);
  color: #0f172a;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
}

body.light-theme .staff-tile:hover {
  border-color: rgba(79, 70, 229, 0.42);
  box-shadow: 0 16px 28px rgba(79, 70, 229, 0.13);
}

body.light-theme .staff-tile-avatar {
  background: rgba(15, 23, 42, 0.04);
}

body.light-theme .staff-tile-name {
  color: #0f172a;
}

body.light-theme .staff-tile-meta {
  color: #64748b;
}

.store-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.store-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

.store-item-editing {
  border-color: rgba(139, 92, 246, 0.42);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.12);
}

.store-card-delete {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: rgba(248, 113, 113, 0.95);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.76;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.store-card-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.22);
  transform: scale(1.06);
}

.store-add-card {
  min-height: 330px;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--text-muted);
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.06);
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.store-add-card:hover {
  color: var(--text-primary);
  border-color: rgba(139, 92, 246, 0.75);
  background: rgba(139, 92, 246, 0.12);
}

.store-add-plus {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
}

.store-img {
  height: 160px;
  background: var(--bg-surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-image-preview-wrap {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.store-image-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  min-height: 38px;
}

.store-image-upload-button {
  width: auto;
  margin: 0;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.store-image-upload-hint {
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.store-image-preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--bg-surface-hover);
}

.store-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.store-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--warning);
  font-size: 1.25rem;
  margin-top: auto;
  margin-bottom: 1rem;
}

/* Tables */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

th {
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

body.light-theme .form-control {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-theme .form-control::placeholder {
  color: #94a3b8;
}

body.light-theme .form-control:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

body.light-theme .table-container {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

body.light-theme th {
  background: #f1f5f9;
  color: #475569;
  border-bottom-color: #cbd5e1;
}

body.light-theme td {
  color: #0f172a;
  border-bottom-color: #dbe3ef;
}

body.light-theme tr:hover td {
  background: #f8fafc;
}

.action-row {
  display: flex;
  gap: 0.5rem;
}

/* Tabs inside Admin/High-mod */
.tab-headers {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.tab-header {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s;
}

.tab-header:hover {
  color: var(--text-main);
}

.tab-header.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s;
}

.tab-pane.active {
  display: block;
}

/* Toasts */
#toastContainer {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-surface);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 300px;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.toast-message {
  line-height: 1.35;
  word-break: break-word;
}

.toast-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.6rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toast[data-count]:not([data-count="1"]) .toast-count {
  display: inline-flex !important;
}

.toast-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255,255,255,0.16);
  transform-origin: right center;
  animation: toastProgress 4s linear forwards;
}

.toast-clear-all {
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(15,23,42,0.92);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: 0.2s ease;
}

.toast-clear-all:hover {
  color: var(--text-main);
  border-color: rgba(148,163,184,0.4);
}

.log-details-row td {
  padding-top: 0;
  border-top: none;
}

.log-details-panel {
  margin: 0.2rem 0 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.14);
}

.log-details-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.log-details-list {
  display: grid;
  gap: 0.45rem;
}

.log-details-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

/* Utility */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  padding: 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 450px;
  animation: fadeUp 0.3s ease-out;
}

body.light-theme .modal-overlay {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.light-theme .modal-content {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.36);
  color: #0f172a;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
}

body.light-theme .modal-content h3,
body.light-theme .modal-content h4,
body.light-theme .modal-content strong {
  color: #0f172a;
}

body.light-theme .modal-content .text-muted,
body.light-theme .modal-content label {
  color: #64748b;
}

body.light-theme .modifier-toggle-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

body.light-theme .modifier-toggle-btn:hover {
  background: #eef2ff;
  border-color: rgba(79, 70, 229, 0.28);
}

body.light-theme .modifier-toggle-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: rgba(79, 70, 229, 0.7);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(79, 70, 229, 0.24);
}

.store-item-modal {
  max-width: 560px;
}

.staff-modal {
  max-width: 760px;
}

.staff-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.staff-modal-avatar {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.staff-modal-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.staff-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.staff-overview-panel {
  min-height: 0;
}

.staff-overview-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.staff-overview-actions .btn {
  min-height: 52px;
  font-size: 1rem;
}

.staff-modal-panel-full {
  min-height: 0;
}

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

.staff-modal-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 0.9rem;
}

.staff-modal-panel .action-row {
  flex-wrap: wrap;
}

.staff-modal-panel .action-row .btn {
  min-width: 160px;
}

.archive-modal-grid .staff-modal-panel {
  min-height: 100%;
}

.staff-modal-panel h4 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.staff-management-section + .staff-management-section {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.staff-management-section h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.staff-user-facts {
  display: grid;
  gap: 0.65rem;
}

.staff-user-facts div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.staff-user-facts span {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.staff-user-facts strong {
  font-size: 0.95rem;
}

.staff-archive-btn {
  margin-top: 0.85rem;
}

@media (max-width: 980px) {
  .archive-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile application layout */
@media (max-width: 760px) {
  .dashboard-layout {
    display: block;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0;
    border-top: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1100;
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar nav {
    display: flex;
    width: 100%;
    height: 66px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar,
  .tab-headers::-webkit-scrollbar,
  .tab-bar::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    min-width: 90px;
    height: 66px;
    padding: 0.5rem 0.75rem;
    justify-content: center;
    text-align: center;
    font-size: 0.76rem;
    line-height: 1.2;
    border-left: 0;
    border-top: 3px solid transparent;
  }

  .nav-link.active {
    border-left-color: transparent;
    border-top-color: var(--primary);
  }

  .main-content {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    padding: 1rem 1rem calc(86px + env(safe-area-inset-bottom));
  }

  .topbar-shell {
    margin-bottom: 1.25rem;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
  }

  .topbar-brand {
    font-size: 1.65rem;
    letter-spacing: 0;
  }

  .topbar-center-block {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0;
    gap: 0.2rem;
  }

  .topbar-current-server {
    max-width: 100%;
    font-size: 1.08rem;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .server-strip-trigger-text {
    font-size: 0.88rem;
    letter-spacing: 0;
  }

  .user-snippet {
    gap: 0.5rem;
  }

  .user-snippet > span {
    display: none;
  }

  .user-snippet .user-avatar {
    width: 36px;
    height: 36px;
  }

  .user-snippet .btn {
    width: auto;
    padding: 0.5rem 0.7rem !important;
  }

  .server-overlay {
    padding-left: 0;
  }

  .server-overlay-panel {
    min-height: 100dvh;
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  }

  .server-overlay-head-row {
    align-items: center;
  }

  .server-overlay-head {
    font-size: 1.5rem;
    letter-spacing: 0;
  }

  .server-overlay-subhead {
    font-size: 0.88rem;
  }

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

  .server-overlay-item {
    min-height: 88px;
    border-radius: 12px;
  }

  .auth-container,
  .oauth-callback-loading {
    padding: 1rem;
  }

  .glass-panel,
  .profile-card {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .glass-panel h2 {
    font-size: 1.65rem;
  }

  .form-control {
    font-size: 16px;
  }

  .profile-layout {
    gap: 1rem;
  }

  .profile-card .avatar-large {
    width: 82px;
    height: 82px;
  }

  .profile-username {
    max-width: 100%;
    font-size: 1.65rem;
    overflow-wrap: anywhere;
  }

  .profile-stat-row {
    gap: 0.75rem;
  }

  .profile-stat-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .profile-transactions-panel .table-container,
  .table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table,
  .profile-transactions-panel table {
    min-width: 660px;
    table-layout: auto;
  }

  th,
  td {
    padding: 0.8rem;
    white-space: nowrap;
  }

  .profile-transactions-panel td:last-child,
  .profile-transactions-panel th:last-child {
    min-width: 180px;
  }

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

  .store-add-card {
    min-height: 220px;
  }

  .store-content {
    padding: 1.1rem;
  }

  .store-image-upload-row {
    align-items: stretch;
    flex-direction: column;
  }

  .store-image-upload-button {
    width: 100%;
  }

  .staff-header-row,
  .flex-between {
    align-items: stretch;
    flex-direction: column;
  }

  .staff-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .staff-summary-card {
    min-width: 0;
    padding: 0.85rem;
  }

  .staff-summary-card strong {
    font-size: 1.1rem;
    overflow-wrap: anywhere;
  }

  .staff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .staff-tile {
    min-width: 0;
    padding: 0.85rem 0.55rem;
    border-radius: 12px;
  }

  .staff-tile-avatar {
    width: 58px;
    height: 58px;
    margin-bottom: 0.7rem;
  }

  .staff-tile-name {
    font-size: 0.88rem;
  }

  .staff-tile .badge {
    padding: 0.22rem 0.45rem;
    font-size: 0.64rem;
  }

  .staff-tile-meta {
    font-size: 0.74rem;
  }

  .tab-headers,
  .tab-bar {
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.25rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .tab-header {
    flex: 0 0 auto;
    padding: 0.7rem 0.85rem;
    white-space: nowrap;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0.75rem;
    overflow-y: auto;
  }

  .modal-content {
    max-width: none !important;
    max-height: calc(100dvh - 1.5rem);
    padding: 1.25rem;
    border-radius: 12px;
    overflow-y: auto;
  }

  .staff-modal-header {
    align-items: flex-start;
  }

  .staff-modal-avatar {
    width: 64px;
    height: 64px;
  }

  .action-row {
    flex-direction: column;
  }

  .action-row .btn,
  .staff-header-row > .btn,
  .flex-between > .btn {
    width: 100% !important;
  }

  .log-details-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .store-item[style*="flex-direction:row"] {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center !important;
  }

  .store-item[style*="flex-direction:row"] > img {
    width: 64px !important;
    height: 64px !important;
    margin-right: 0 !important;
  }

  .store-item[style*="flex-direction:row"] > div:nth-child(3) {
    grid-column: 1 / 2;
    margin-right: 0 !important;
  }

  .store-item[style*="flex-direction:row"] > .store-price {
    grid-column: 2 / 3;
    margin: 0 !important;
    font-size: 1rem;
    text-align: right;
  }

  .store-item[style*="flex-direction:row"] > .btn-danger {
    grid-column: 1 / -1;
    width: 100% !important;
    margin-left: 0 !important;
  }

  #toastContainer {
    right: 0.75rem;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 0.75rem;
    align-items: stretch;
  }

  .toast {
    width: 100%;
    min-width: 0;
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 380px) {
  .main-content {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .nav-link {
    min-width: 82px;
    padding-right: 0.55rem;
    padding-left: 0.55rem;
  }

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