:root {
  --bg: #060608;
  --bg-elevated: #0b0b10;
  --bg-card: rgba(16, 16, 22, 0.78);
  --bg-input: #0a0a0f;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.18);
  --specular: rgba(255, 255, 255, 0.09);
  --text: #ededf2;
  --text-muted: #8a8a98;
  --white: #f7f7fa;
  --accent: #d9264e;
  --accent-soft: rgba(217, 38, 78, 0.15);
  --accent-border: rgba(217, 38, 78, 0.45);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #38bdf8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.52);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Segoe UI Variable', 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

html[data-theme="glass"] {
  --bg: #07090d;
  --bg-card: rgba(20, 26, 38, 0.56);
  --bg-input: rgba(14, 18, 28, 0.76);
  --border: rgba(255, 255, 255, 0.12);
  --border-bright: rgba(255, 255, 255, 0.24);
  --specular: rgba(255, 255, 255, 0.15);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14.5px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: background 0.35s var(--ease-out);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 65% 32% at 18% -10%, rgba(217, 38, 78, 0.12), transparent 65%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.4) 55%, transparent 95%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.4) 55%, transparent 95%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

header, main, section {
  position: relative;
  z-index: 1;
}

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

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(6, 6, 8, 0.84);
  border-bottom: 1px solid var(--border);
}

html[data-theme="glass"] .navbar {
  background: rgba(10, 14, 22, 0.68);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-mark {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(217, 38, 78, 0.65);
  display: inline-block;
  transition: transform 0.35s var(--ease-spring);
}

.brand:hover .brand-mark {
  transform: rotate(45deg);
}

.brand-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--white);
  letter-spacing: 0.06em;
}

/* Quick Status Switcher in Topbar */
.quick-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.qs-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.qs-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.qs-btn.active[data-qstatus="Undetect"] {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.38);
}

.qs-btn.active[data-qstatus="Update"] {
  color: #facc15;
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.38);
}

.qs-btn.active[data-qstatus="Detect"] {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.38);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.theme-toggle:hover {
  color: var(--white);
  border-color: var(--border-bright);
}

.theme-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

html[data-theme="glass"] .theme-dot {
  background: #e2e8f0;
  box-shadow: 0 0 8px rgba(226, 232, 240, 0.8);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), background 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 var(--specular);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--white);
  border-color: var(--white);
  color: #08080a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
}

.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

.btn-outline {
  border-color: var(--border);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--border-bright);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
  color: #86efac;
}

.btn-success:hover {
  background: rgba(34, 197, 94, 0.22);
}

.btn-warn {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.34);
  color: #fde047;
}

.btn-warn:hover {
  background: rgba(234, 179, 8, 0.22);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-active, .badge-online {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.1);
}

.badge-unused {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(56, 189, 248, 0.1);
}

.badge-frozen, .badge-updating {
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.32);
  background: rgba(234, 179, 8, 0.1);
}

.badge-expired {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.08);
}

.badge-banned, .badge-danger {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.1);
}

/* Metrics & Cards */
.admin-shell {
  padding: 24px 0 64px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 var(--specular);
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out);
}

.metric-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.metric-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.metric-value {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: inset 0 1px 0 var(--specular), var(--shadow);
}

.card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--white);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  transition: all 0.18s ease;
}

.tab-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-bright);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: panelFade 0.28s var(--ease-out) both;
}

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

/* Collapsible Key Generator Drawer */
.gen-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--ease-out), margin-bottom 0.34s var(--ease-out);
  margin-bottom: 0;
}

.gen-drawer.open {
  grid-template-rows: 1fr;
  margin-bottom: 18px;
}

.gen-drawer > .gen-drawer-inner {
  overflow: hidden;
}

/* Inputs & Forms */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.2s ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.toolbar-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
}

.toolbar-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

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

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

.actions-row {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  align-items: center;
}

/* Login */
.login-wrap {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #121218;
  border: 1px solid var(--accent-border);
  color: var(--white);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.22s var(--ease-out);
  z-index: 1500;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Clickable IDs & Ban Details Modal */
.id-link {
  background: none;
  border: none;
  padding: 0;
  color: #f4f4f5;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.id-link:hover {
  color: var(--accent);
  text-decoration-style: solid;
}

.id-link-danger {
  color: #fca5a5;
}

.id-link-danger:hover {
  color: #fecaca;
}

.ev-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--white);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  vertical-align: middle;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.82);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-backdrop.open {
  display: flex;
  animation: panelFade 0.22s var(--ease-out) both;
}

.modal-dialog {
  width: 100%;
  max-width: 1080px;
  max-height: 90vh;
  background: #0d0d13;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  flex-wrap: wrap;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ban-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.ban-section h4 {
  font-size: 0.92rem;
  margin-bottom: 12px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ban-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 16px;
}

.ban-kv-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ban-kv-val {
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
}

.ban-shot-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #050508;
  text-align: center;
}

.ban-shot-img {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  cursor: zoom-in;
}

.ban-scroll-table {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.ban-scroll-table table {
  font-size: 0.81rem;
}

.ban-scroll-table th,
.ban-scroll-table td {
  padding: 7px 10px;
}

.proc-suspect td {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #fecaca;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1200;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 96vw;
  max-height: 94vh;
  border-radius: 6px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.8);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.75);
}

.bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  animation: panelFade 0.2s var(--ease-out) both;
}

.note-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.78rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.note-edit-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 960px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .actions-row {
    flex-wrap: wrap;
  }
}
