:root {
  --bg-0: #030508;
  --bg-1: #080c14;
  --bg-2: #0f1522;
  --accent: #3b82f6;
  --accent-soft: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
  --text: #f4f6fb;
  --muted: #8b95a8;
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(8, 12, 20, 0.78);
  --glass-strong: rgba(12, 18, 30, 0.92);
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "Rajdhani", system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #0a1628 0%, var(--bg-0) 50%, #000 100%);
}

#bg-canvas, .scanlines, .vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#bg-canvas { width: 100%; height: 100%; }
.scanlines {
  z-index: 1;
  opacity: 0.03;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,.35) 2px, rgba(255,255,255,.35) 3px);
}
.vignette {
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.7) 100%);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }

.app-shell, .blocked-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.panel-wrap {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem 2rem;
  padding: 1.75rem 0 1.25rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  width: 100%;
}

.site-header .tab-nav {
  justify-self: center;
  min-width: 0;
}

.account-menu {
  justify-self: end;
  flex-shrink: 0;
  position: relative;
}

.account-dropdown {
  position: fixed;
  top: 5.25rem;
  right: max(1.25rem, calc((100vw - 1040px) / 2 + 1.25rem));
  width: min(22rem, calc(100vw - 2rem));
  z-index: 50;
}

.account-dropdown-panel {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .4rem .7rem .4rem .45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-strong);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.account-chip:hover,
.account-chip:focus-visible {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.08);
  outline: none;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.account-avatar-default {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.account-avatar-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.account-avatar-img {
  object-fit: cover;
  border: 1px solid var(--line);
}

.account-avatar-lg {
  width: 3.25rem;
  height: 3.25rem;
}

.account-avatar-lg .account-avatar-icon {
  width: 1.85rem;
  height: 1.85rem;
}

.account-role-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--accent-soft);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  white-space: nowrap;
}

.account-profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0 0 .85rem;
  margin-bottom: .85rem;
  border-bottom: 1px solid var(--line);
}

.account-profile-info {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
  flex: 1;
}

.account-profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.2;
}

.account-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.profile-upload-btn {
  cursor: pointer;
}

.account-dropdown-stats {
  margin-bottom: 1rem;
}

.account-dropdown-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.account-logout-btn {
  margin-left: 0;
}

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

.auth-card {
  width: min(100%, 420px);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}

.auth-brand { margin-bottom: 1rem; }
.auth-hint { margin-bottom: 1.25rem; font-size: .95rem; }

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

.auth-tab-btn {
  flex: 1;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
}

.auth-tab-btn.active {
  color: var(--accent-soft);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.auth-form label {
  display: block;
  margin-bottom: .85rem;
  font-weight: 600;
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
}

.auth-form .btn { width: 100%; margin-top: .5rem; }

.auth-error {
  margin-top: 1rem;
  padding: .65rem .75rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  font-weight: 600;
}

.account-panel, .referrals-panel { margin-top: 1rem; }

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.account-form {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
}

.account-form label {
  display: block;
  margin-bottom: .75rem;
  font-weight: 600;
}

.account-form input {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-1);
  color: var(--text);
}

.log-search-row { margin-bottom: 1rem; }

.core-team-wrap { margin-top: .75rem; }

.team-role-select {
  padding: .35rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-body);
}

@media (max-width: 700px) {
  .account-actions { grid-template-columns: 1fr; }
}

.brand {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-shrink: 0;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-soft);
  letter-spacing: .08em;
  font-size: 1.15rem;
}
.brand-sub { color: var(--muted); font-weight: 600; font-size: 1.15rem; }

.tab-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.tab-btn {
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 1.3rem;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 5px;
  transition: color 0.15s ease;
}

.tab-btn:hover,
.tab-btn:focus-visible {
  color: var(--accent-soft);
  text-decoration: underline;
}

.tab-btn.active {
  color: var(--accent-soft);
  text-decoration: underline;
}

.content { padding: 1.5rem 0 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-head {
  text-align: center;
  margin-bottom: .5rem;
}
.panel-head h1 {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.panel-head p { margin: 0 0 1.25rem; color: var(--muted); }

.search-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  justify-content: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.search-row input {
  flex: 1 1 260px;
  min-width: 0;
  padding: .75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

.btn {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: .75rem 1.1rem;
  border-radius: 12px;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn.ghost:hover { border-color: var(--accent-soft); }
.btn.danger {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.45);
  color: #fecaca;
}
.btn.confidential {
  background: rgba(245,158,11,.15);
  border-color: rgba(245,158,11,.45);
  color: #fde68a;
}

.profile-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  padding: 1.25rem;
}
.profile-result.empty { color: var(--muted); }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.stat-card {
  padding: .85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
}
.stat-card .label { color: var(--muted); font-size: .9rem; }
.stat-card .value { font-size: 1.2rem; font-weight: 700; }

.status-pill {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
}
.status-pill.bad { background: rgba(239,68,68,.2); color: #fca5a5; }
.status-pill.ok { background: rgba(34,197,94,.2); color: #86efac; }
.status-pill.warn { background: rgba(245,158,11,.2); color: #fcd34d; }

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

.history-block { margin-top: 1.25rem; }
.history-block h3 {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-soft);
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.history-list li {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.history-list li:last-child { border-bottom: 0; }

.confidential-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(245,158,11,.5);
  background: rgba(245,158,11,.08);
}

.log-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--glass);
  min-height: 360px;
}
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.log-table th, .log-table td {
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.log-table th {
  position: sticky;
  top: 0;
  background: var(--glass-strong);
  color: var(--muted);
  font-weight: 700;
}

.whitelist-access-wrap {
  margin-top: 1rem;
}

.whitelist-reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.whitelist-reveal-btn:hover,
.whitelist-reveal-btn:focus-visible,
.whitelist-reveal-btn.active {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.08);
  outline: none;
}

.whitelist-eye-icon {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--accent-soft);
}

.whitelist-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.whitelist-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: .5rem;
  background: var(--glass);
}
.whitelist-entry-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}
.whitelist-member-btn {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.whitelist-member-btn:hover strong,
.whitelist-member-btn:focus-visible strong {
  color: var(--accent-soft);
}
.whitelist-member-meta {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.whitelist-member-meta strong {
  font-size: 1.05rem;
}
.whitelist-account {
  font-weight: 700;
  color: var(--accent-soft);
}

.tab-btn-member {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-panel {
  margin-top: 1rem;
}

.member-profile-card {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.member-ip-line {
  margin: .35rem 0 0;
}

.member-section-title {
  margin: 1.25rem 0 .75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-soft);
}

.link-btn,
.member-link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover,
.member-link-btn:hover {
  color: var(--text);
}

.history-list .member-link-btn {
  font-size: inherit;
}

.plugins-layout,
.logs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}

.plugin-list,
.log-categories {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.plugin-list-btn,
.log-category-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.plugin-list-btn .emoji,
.log-category-btn .emoji {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.plugin-list-btn .plugin-list-meta {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.plugin-list-btn .plugin-list-name {
  color: var(--text);
  font-weight: 700;
}

.plugin-list-btn .plugin-list-cmds {
  font-size: .85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plugin-list-btn:hover,
.plugin-list-btn:focus-visible,
.log-category-btn:hover,
.log-category-btn:focus-visible {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.plugin-list-btn.active,
.log-category-btn.active {
  color: var(--accent-soft);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.18);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.plugin-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  padding: 1.25rem;
  min-height: 360px;
}

.plugin-detail-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.plugin-detail-header h2 {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.plugin-tag {
  display: inline-block;
  margin-top: .35rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-soft);
}

.command-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .65rem;
  background: rgba(0, 0, 0, 0.2);
}

.command-card h4 {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  color: var(--accent-soft);
}

.command-card h4 code {
  font-size: 1.05rem;
}

.command-card p {
  margin: .25rem 0;
  font-size: .95rem;
  color: var(--muted);
}

.command-card .cmd-meta {
  font-size: .88rem;
  color: var(--muted);
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  background: rgba(0, 0, 0, 0.15);
}

.feature-card strong {
  color: var(--text);
}

.confidential-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.confidential-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.section-title {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--warn);
}

.section-desc {
  margin: 0 0 1rem;
}

.confidential-search {
  max-width: 100%;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .65rem;
}

.settings-card {
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.settings-card .label {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: .2rem;
}

.settings-card .value {
  font-weight: 700;
  font-size: 1.05rem;
}

.settings-card .value.on { color: var(--success); }
.settings-card .value.off { color: var(--danger); }

.logs-main {
  min-width: 0;
}

.blocked-screen {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.blocked-card {
  max-width: 420px;
  padding: 2rem;
  border: 1px solid rgba(239,68,68,.35);
  border-radius: var(--radius);
  background: var(--glass-strong);
  text-align: center;
}

.blocked-card h1 { color: var(--danger); font-family: var(--font-display); }

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand account"
      "nav nav";
  }
  .site-header .brand { grid-area: brand; }
  .site-header .tab-nav {
    grid-area: nav;
    justify-self: stretch;
    justify-content: center;
  }
  .site-header .account-menu { grid-area: account; }
}

@media (max-width: 700px) {
  .panel-wrap { padding: 0 1rem 1.5rem; }
  .site-header {
    gap: 1rem;
  }
  .tab-btn { font-size: 1.15rem; }
  .logs-layout {
    grid-template-columns: 1fr;
  }
  .plugins-layout {
    grid-template-columns: 1fr;
  }
  .log-categories {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .plugin-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .log-category-btn,
  .plugin-list-btn {
    width: auto;
    flex: 1 1 calc(50% - .25rem);
    min-width: 140px;
  }
}
