/* ===== XNET HUB ADMIN SITE LAYER ===== */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.admin-shell {
  --admin-content-max: 1760px;
  --admin-side-gap: clamp(16px, 3vw, 42px);
  padding-top: calc(var(--toolbar-height, 52px) + env(safe-area-inset-top));
}

body.admin-shell .navbar {
  position: fixed !important;
  inset: 0 0 auto 0;
  z-index: 1400;
  height: calc(var(--toolbar-height, 52px) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top) !important;
  padding-bottom: 0 !important;
  display: flex;
  align-items: center;
}

body.admin-shell .nav-inner,
body.admin-shell .status-inner,
body.admin-shell .ph-inner,
body.admin-shell .page-header-inner,
body.admin-shell .main,
body.admin-shell .footer-inner {
  width: min(var(--admin-content-max), calc(100vw - var(--admin-side-gap) - var(--admin-side-gap)));
  max-width: none !important;
  margin: 0 auto !important;
}

body.admin-shell .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--toolbar-height, 52px);
  min-height: var(--toolbar-height, 52px);
}

body.admin-shell .nav-brand {
  gap: 14px;
  flex-wrap: nowrap;
}

body.admin-shell .nav-brand,
body.admin-shell .nav-actions {
  height: 100%;
  display: flex;
  align-items: center;
}

body.admin-shell .nav-title {
  line-height: 1;
}

body.admin-shell .admin-toolbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(var(--primary-rgb) / 0.1), rgba(255, 158, 100, 0.08));
  color: var(--signal-gold);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow: 0 0 20px rgba(var(--primary-rgb) / 0.12);
}

body.admin-shell .admin-toolbar-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  animation: blink 1.4s steps(1) infinite;
}

body.admin-shell .nav-logo,
body.admin-shell .nav-logo-placeholder {
  width: clamp(30px, calc(var(--toolbar-height, 52px) - 8px), 42px);
  height: clamp(30px, calc(var(--toolbar-height, 52px) - 8px), 42px);
}

body.admin-shell .theme-toggle,
body.admin-shell .hamburger {
  width: clamp(36px, calc(var(--toolbar-height, 52px) - 6px), 42px);
  min-width: clamp(36px, calc(var(--toolbar-height, 52px) - 6px), 42px);
  height: clamp(36px, calc(var(--toolbar-height, 52px) - 6px), 42px);
  min-height: clamp(36px, calc(var(--toolbar-height, 52px) - 6px), 42px);
  align-self: center;
}

body.admin-shell .theme-toggle .toggle-pill {
  width: 24px;
}

body.admin-shell .theme-toggle .toggle-dot {
  top: 1px;
}

body.admin-shell .nav-links {
  top: calc(var(--toolbar-height, 52px) + env(safe-area-inset-top) + 8px);
  right: max(24px, var(--admin-side-gap));
  width: min(360px, calc(100vw - 28px));
}

body.admin-shell .status-bar,
body.admin-shell .page-header,
body.admin-shell .hero,
body.admin-shell footer {
  padding-left: var(--admin-side-gap) !important;
  padding-right: var(--admin-side-gap) !important;
}

body.admin-shell .status-bar {
  position: relative;
  background:
    linear-gradient(90deg, rgba(255, 158, 100, 0.06), rgba(var(--primary-rgb) / 0.08), rgba(126, 200, 227, 0.05)),
    var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

body.admin-shell .status-bar::after {
  content: '';
  position: absolute;
  left: var(--admin-side-gap);
  right: var(--admin-side-gap);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal-orange), var(--primary), var(--signal-cyan), transparent);
  opacity: 0.75;
}

body.admin-shell .status-inner,
body.admin-shell .page-tag,
body.admin-shell .hero-tag,
body.admin-shell .sec-label {
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

body.admin-shell .sdot {
  animation: blink 1.2s steps(1) infinite;
}

body.admin-shell .page-header,
body.admin-shell .hero {
  position: relative;
  overflow: hidden;
  padding-top: 120px !important;
  padding-bottom: 68px !important;
  border-bottom: 1px solid var(--border-bright);
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 158, 100, 0.08), transparent 26%),
    radial-gradient(circle at 82% 78%, rgba(126, 200, 227, 0.08), transparent 30%),
    radial-gradient(ellipse 60% 48% at 50% 16%, rgba(var(--primary-rgb) / 0.12), transparent 68%),
    var(--bg-dark);
}

body.admin-shell .page-header::before,
body.admin-shell .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(var(--primary-rgb) / 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%);
  pointer-events: none;
  z-index: 2;
}

body.admin-shell .page-header::after,
body.admin-shell .hero::after {
  content: '';
  position: absolute;
  left: var(--admin-side-gap);
  right: var(--admin-side-gap);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal-orange), var(--primary), var(--signal-cyan), transparent);
  opacity: 0.85;
  z-index: 4;
}

body.admin-shell .hero-space-canvas,
body.admin-shell .hero-hex-grid,
body.admin-shell .hero-space-nebula,
body.admin-shell .hero-space-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body.admin-shell .hero-space-canvas { z-index: 0; }
body.admin-shell .hero-hex-grid { z-index: 1; opacity: 0.24; }
body.admin-shell .hero-space-nebula { z-index: 3; }
body.admin-shell .hero-space-vignette { z-index: 3; }

body.admin-shell .page-header > :not(.hero-space-canvas):not(.hero-hex-grid):not(.hero-space-nebula):not(.hero-space-vignette),
body.admin-shell .hero > :not(.hero-space-canvas):not(.hero-hex-grid):not(.hero-space-nebula):not(.hero-space-vignette) {
  position: relative;
  z-index: 5;
}

body.admin-shell .page-header h1,
body.admin-shell .hero h1 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(28px, 5vw, 56px) !important;
  font-weight: 900 !important;
  line-height: 1.06;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

body.admin-shell .page-header h1 span,
body.admin-shell .hero h1 span {
  color: var(--primary);
}

body.admin-shell .page-header p,
body.admin-shell .hero-sub,
body.admin-shell .sec-desc {
  color: var(--text-secondary) !important;
  font-size: 15px !important;
  line-height: 1.85;
  max-width: 760px;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero {
  text-align: initial;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero-inner {
  width: min(860px, calc(100vw - var(--admin-side-gap) - var(--admin-side-gap)));
  margin: 0 auto;
  display: block;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero-copy {
  min-width: 0;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero-logo-wrap {
  justify-content: flex-start;
  margin-bottom: 16px;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero-tag,
body.admin-shell[data-admin-page="admin-panel.html"] .hero-sub {
  margin-left: 0;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero-sub {
  margin-bottom: 0;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero-aside {
  display: none;
}

body.admin-shell[data-admin-page="admin-panel.html"] .hero {
  padding-top: 104px !important;
  padding-bottom: 42px !important;
}

body.admin-shell[data-admin-page="admin-panel.html"] .main {
  padding-top: 20px !important;
}

body.admin-shell[data-admin-page="admin-panel.html"] .section:first-child {
  margin-top: 0;
}

body.admin-shell[data-admin-page="admin-panel.html"] .section:has(.db-grid) {
  display: none !important;
}

body.admin-shell .main {
  padding-top: 34px !important;
  padding-bottom: 80px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.admin-shell .section {
  margin-bottom: 46px;
}

body.admin-shell .panel,
body.admin-shell .profile-modal,
body.admin-shell .modal,
body.admin-shell .result-box,
body.admin-shell .terminal,
body.admin-shell .stat-card,
body.admin-shell .stat-mini,
body.admin-shell .tool-card,
body.admin-shell .config-row,
body.admin-shell .cat-item,
body.admin-shell .ch-item,
body.admin-shell .user-item,
body.admin-shell .profile-field,
body.admin-shell .pf,
body.admin-shell .app-download-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb) / 0.05), transparent 28%),
    linear-gradient(135deg, rgba(255, 158, 100, 0.03), transparent 40%),
    var(--bg-card);
  border: 1px solid var(--border) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 20px 46px rgba(0, 0, 0, 0.22);
}

body.admin-shell .panel::before,
body.admin-shell .profile-modal::before,
body.admin-shell .modal::before,
body.admin-shell .stat-card::before,
body.admin-shell .stat-mini::before,
body.admin-shell .tool-card::before,
body.admin-shell .config-row::before,
body.admin-shell .cat-item::before,
body.admin-shell .ch-item::before,
body.admin-shell .user-item::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -40%;
  width: 34%;
  height: 160%;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb) / 0.16), rgba(255, 158, 100, 0.08), transparent);
  transform: skewX(-26deg);
  opacity: 0;
  transition: left 0.45s ease, opacity 0.25s ease;
  pointer-events: none;
}

body.admin-shell .panel:hover::before,
body.admin-shell .stat-card:hover::before,
body.admin-shell .stat-mini:hover::before,
body.admin-shell .tool-card:hover::before,
body.admin-shell .config-row:hover::before,
body.admin-shell .cat-item:hover::before,
body.admin-shell .ch-item:hover::before,
body.admin-shell .user-item:hover::before {
  left: 118%;
  opacity: 1;
}

body.admin-shell .panel-head,
body.admin-shell .modal-head,
body.admin-shell .modal-head-bar,
body.admin-shell .profile-header,
body.admin-shell .profile-head {
  background:
    linear-gradient(90deg, rgba(var(--primary-rgb) / 0.08), rgba(126, 200, 227, 0.05)),
    rgba(var(--primary-rgb) / 0.03);
  border-bottom: 1px solid var(--border) !important;
}

body.admin-shell .panel-title,
body.admin-shell .modal-title,
body.admin-shell .profile-name,
body.admin-shell .sec-title {
  font-family: 'Orbitron', monospace;
  font-weight: 800 !important;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
}

body.admin-shell .panel-title span,
body.admin-shell .modal-title span,
body.admin-shell .sec-title span {
  color: var(--primary);
}

body.admin-shell .btn,
body.admin-shell .filter-btn,
body.admin-shell .act-btn,
body.admin-shell .tab-btn,
body.admin-shell .retry-btn {
  position: relative;
  overflow: hidden;
  font-family: 'Orbitron', monospace !important;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 1.8px !important;
  text-transform: uppercase;
  transition: all 0.25s ease;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

body.admin-shell .btn::before,
body.admin-shell .filter-btn::before,
body.admin-shell .act-btn::before,
body.admin-shell .retry-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 10%, rgba(255, 255, 255, 0.22) 45%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.4s ease;
}

body.admin-shell .btn:hover::before,
body.admin-shell .filter-btn:hover::before,
body.admin-shell .act-btn:hover::before,
body.admin-shell .retry-btn:hover::before {
  transform: translateX(120%);
}

body.admin-shell .btn-primary,
body.admin-shell .filter-btn.active,
body.admin-shell .tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--signal-orange)) !important;
  color: #051205 !important;
  border-color: transparent !important;
  box-shadow: 0 14px 28px rgba(var(--primary-rgb) / 0.24);
}

body.admin-shell .btn-warn {
  background: rgba(255, 215, 0, 0.1) !important;
  color: var(--signal-gold) !important;
  border-color: rgba(255, 215, 0, 0.3) !important;
}

body.admin-shell .btn-danger {
  background: rgba(255, 68, 68, 0.12) !important;
  color: var(--signal-red) !important;
  border-color: rgba(255, 68, 68, 0.28) !important;
}

body.admin-shell .filter-btn,
body.admin-shell .act-btn,
body.admin-shell .tab-btn,
body.admin-shell .retry-btn {
  background: rgba(var(--primary-rgb) / 0.05);
  color: var(--text-secondary);
  border-color: var(--border) !important;
}

body.admin-shell .tab-bar {
  gap: 10px;
  border-bottom: none !important;
  margin-bottom: 24px;
}

body.admin-shell .tab-btn {
  min-height: 42px;
  padding: 10px 18px !important;
}

body.admin-shell input,
body.admin-shell textarea,
body.admin-shell select,
body.admin-shell .search-box,
body.admin-shell .kv-key,
body.admin-shell .kv-val,
body.admin-shell .f-input,
body.admin-shell .f-textarea {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--bg-card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.admin-shell input:focus,
body.admin-shell textarea:focus,
body.admin-shell select:focus,
body.admin-shell .search-box:focus,
body.admin-shell .kv-key:focus,
body.admin-shell .kv-val:focus {
  border-color: var(--signal-cyan) !important;
  box-shadow: 0 0 0 2px rgba(126, 200, 227, 0.1), 0 0 20px rgba(126, 200, 227, 0.08);
}

body.admin-shell .user-table th,
body.admin-shell .f-label,
body.admin-shell .form-group label,
body.admin-shell .page-tag,
body.admin-shell .sec-label,
body.admin-shell .stat-label,
body.admin-shell .sm-label,
body.admin-shell .pf-label {
  color: var(--signal-gold) !important;
}

body.admin-shell .spinner {
  position: relative;
  border: 0 !important;
  border-radius: 0 !important;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb) / 0.18), rgba(255, 158, 100, 0.12)),
    rgba(0, 0, 0, 0.2);
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0 50%);
  box-shadow: 0 0 18px rgba(var(--primary-rgb) / 0.24);
  animation: hexSpinner 1.8s linear infinite !important;
}

body.admin-shell .spinner::before,
body.admin-shell .spinner::after {
  content: '';
  position: absolute;
  clip-path: inherit;
}

body.admin-shell .spinner::before {
  inset: 16%;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

body.admin-shell .spinner::after {
  inset: 32%;
  background: linear-gradient(135deg, var(--primary), var(--signal-cyan));
  box-shadow: 0 0 14px rgba(var(--primary-rgb) / 0.28);
}

body.admin-shell .loading,
body.admin-shell .profile-loading {
  color: var(--signal-cyan) !important;
  letter-spacing: 2px;
}

body.admin-shell .terminal,
body.admin-shell .result-box {
  background: var(--terminal-black) !important;
  border-left: 3px solid var(--signal-gold);
}

body.admin-shell footer {
  position: relative;
  padding-top: 28px !important;
  padding-bottom: 28px !important;
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb) / 0.06), transparent 24%),
    var(--bg-dark) !important;
  border-top: 1px solid var(--border-bright) !important;
}

body.admin-shell footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--admin-side-gap);
  right: var(--admin-side-gap);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal-orange), var(--primary), var(--signal-cyan), transparent);
}

body.admin-shell .footer-name,
body.admin-shell .footer-brand,
body.admin-shell .footer-links a {
  color: var(--text-secondary);
}

body.admin-shell .footer-copy {
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  body.admin-shell {
    --admin-side-gap: clamp(14px, 3vw, 20px);
  }

  body.admin-shell .admin-toolbar-badge {
    display: none;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .hero {
    padding-top: 96px !important;
    padding-bottom: 38px !important;
  }
}

@media (max-width: 768px) {
  body.admin-shell {
    padding-top: calc(var(--toolbar-height, 52px) + env(safe-area-inset-top));
  }

  body.admin-shell .nav-links {
    left: 12px;
    right: 12px;
    width: auto;
  }

  body.admin-shell .page-header,
  body.admin-shell .hero {
    padding-top: 108px !important;
    padding-bottom: 54px !important;
  }

  body.admin-shell .main {
    padding-bottom: 56px !important;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .status-inner {
    justify-content: center;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .hero {
    text-align: center;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .hero-logo-wrap {
    justify-content: center;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .hero-tag,
  body.admin-shell[data-admin-page="admin-panel.html"] .hero-sub {
    margin-right: auto;
    margin-left: auto;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .hero {
    padding-top: 92px !important;
    padding-bottom: 32px !important;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .main {
    padding-top: 16px !important;
  }
}

@media (max-width: 560px) {
  body.admin-shell .nav-brand {
    max-width: calc(100% - 104px);
  }

  body.admin-shell .nav-title {
    font-size: 14px;
    letter-spacing: 1px;
  }

  body.admin-shell .page-header h1,
  body.admin-shell .hero h1 {
    font-size: clamp(24px, 8vw, 40px) !important;
  }

  body.admin-shell[data-admin-page="admin-panel.html"] .hero {
    padding-top: 88px !important;
    padding-bottom: 28px !important;
  }
}
