:root {
  color-scheme: dark;
  --bg: #100d18;
  --bg-soft: #171221;
  --panel: rgba(29, 23, 42, 0.9);
  --panel-strong: #21192f;
  --panel-soft: #292036;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5effa;
  --muted: #aea4bb;
  --primary: #b455e0;
  --secondary: #f080c8;
  --danger: #ff758f;
  --warning: #f5c86b;
  --success: #70d7a6;
  --info: #7aa8ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% -10%, rgba(180, 85, 224, 0.2), transparent 36%),
    radial-gradient(circle at 10% 100%, rgba(240, 128, 200, 0.13), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.17;
  pointer-events: none;
}

.ambient-one {
  top: -160px;
  right: -120px;
  background: var(--primary);
}

.ambient-two {
  bottom: -180px;
  left: -150px;
  background: var(--secondary);
}

.center-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-panel {
  width: min(460px, 100%);
  padding: 38px;
  text-align: center;
}

.hazoria-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 14px 35px rgba(180, 85, 224, 0.3);
}

.hazoria-logo.login-logo {
  margin: 0 auto 18px;
}

.hazoria-logo.small {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: none;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(29px, 5vw, 36px);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(23px, 3vw, 28px);
}

h3 {
  margin-bottom: 20px;
  font-size: 20px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 26px;
  text-align: left;
}

.stack.compact {
  margin-top: 0;
}

label {
  display: grid;
  gap: 8px;
  color: #d8cede;
  font-size: 13px;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: rgba(8, 6, 13, 0.62);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  background: rgba(12, 8, 18, 0.78);
  box-shadow: 0 0 0 3px rgba(180, 85, 224, 0.14);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

.code-area {
  min-height: 250px;
  font: 12px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}

button,
.button-link {
  min-height: 42px;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  color: white;
  font-weight: 750;
  transition: transform 0.15s, opacity 0.15s, border-color 0.15s, background 0.15s;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

button:focus-visible,
.button-link:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.primary {
  background: linear-gradient(135deg, var(--primary), #8f42c4);
}

.secondary {
  border: 1px solid rgba(240, 128, 200, 0.3);
  background: #352547;
}

.ghost {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.ghost:hover,
.secondary:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.09);
}

.button-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.compact-button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.danger-text {
  color: var(--danger);
}

.error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 1px solid var(--border);
  background: rgba(12, 9, 18, 0.88);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-lockup strong {
  display: block;
  font-size: 17px;
}

.brand-lockup span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(180, 85, 224, 0.18);
  background: rgba(180, 85, 224, 0.14);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.sidebar-footer button {
  min-height: auto;
  padding: 8px 10px;
  font-size: 12px;
}

.version-label {
  color: var(--muted);
  font: 11px/1.4 "SFMono-Regular", Consolas, monospace;
}

.workspace {
  min-width: 0;
  padding: 28px 34px 50px;
}

.topbar {
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pill {
  flex: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.pill.online {
  border-color: rgba(112, 215, 166, 0.3);
  color: var(--success);
}

.pill.offline {
  border-color: rgba(255, 117, 143, 0.3);
  color: var(--danger);
}

.notice {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin-bottom: 20px;
  padding: 12px 15px;
  border: 1px solid rgba(112, 215, 166, 0.25);
  border-radius: 10px;
  background: rgba(39, 91, 67, 0.94);
  box-shadow: var(--shadow);
  color: #c8f5dc;
}

.notice.error-notice {
  border-color: rgba(255, 117, 143, 0.25);
  background: rgba(104, 39, 53, 0.95);
  color: #ffd1da;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
  animation: tab-in 0.2s ease-out;
}

@keyframes tab-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.metric-grid {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(39, 29, 54, 0.9), rgba(22, 17, 31, 0.9));
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.two.unequal {
  grid-template-columns: minmax(360px, 0.85fr) minmax(430px, 1.15fr);
}

.section-gap {
  margin-top: 18px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.button-grid .button-link {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.form-grid.two-cols {
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-row p {
  margin: 0;
}

.form-divider {
  position: relative;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 13px;
}

.detail-list div {
  padding-bottom: 12px;
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) 1.3fr;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.detail-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  text-align: right;
}

.detail-list a {
  color: var(--secondary);
}

.preview-panel {
  min-height: 420px;
  background:
    linear-gradient(rgba(23, 21, 27, 0.92), rgba(23, 21, 27, 0.92)),
    radial-gradient(circle at 50% 0, var(--primary), transparent 48%);
}

.profile-preview {
  margin: 48px auto 26px;
  width: min(500px, 100%);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #232428;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.25);
}

.avatar-wrap {
  position: relative;
  flex: none;
}

.avatar-wrap img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
}

.presence-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 19px;
  height: 19px;
  border: 4px solid #232428;
  border-radius: 50%;
  background: #23a55a;
}

.profile-preview strong {
  font-size: 18px;
}

.profile-preview p {
  margin: 7px 0 0;
  color: #b5bac1;
  line-height: 1.45;
}

.app-badge {
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #5865f2;
  color: white;
  font-size: 10px;
  font-weight: 800;
  vertical-align: 2px;
}

.discord-embed {
  position: relative;
  width: min(520px, 100%);
  margin-top: 35px;
  padding: 14px 16px 14px 0;
  display: grid;
  grid-template-columns: 5px 1fr;
  gap: 14px;
  overflow: hidden;
  border-radius: 4px;
  background: #2b2d31;
  color: #f2f3f5;
}

.embed-accent {
  border-radius: 4px 0 0 4px;
  background: var(--primary);
}

.discord-embed h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.discord-embed p {
  color: #dbdee1;
  line-height: 1.45;
  white-space: pre-wrap;
}

.discord-embed small {
  color: #b5bac1;
}

.section-head {
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.section-head h3 {
  margin-bottom: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.status,
.audit-level {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(180, 85, 224, 0.13);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.status-open,
.level-info {
  color: #9fbaff;
  background: rgba(88, 101, 242, 0.16);
}

.status-claimed,
.level-warning {
  color: #f8d98f;
  background: rgba(245, 200, 107, 0.14);
}

.status-closed,
.level-success {
  color: #9eeac4;
  background: rgba(112, 215, 166, 0.14);
}

.level-error {
  color: #ffabbc;
  background: rgba(255, 117, 143, 0.14);
}

.diagnostic-summary {
  margin-bottom: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.diagnostic-summary span {
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-ok {
  border-color: rgba(112, 215, 166, 0.28);
  background: rgba(112, 215, 166, 0.07);
}

.diagnostic-warning {
  border-color: rgba(245, 200, 107, 0.28);
  background: rgba(245, 200, 107, 0.07);
}

.check-list {
  max-height: 560px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.check-item {
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.check-item strong,
.check-item small {
  display: block;
}

.check-item strong {
  font-size: 13px;
}

.check-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.check-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.check-item.ok .check-icon {
  background: rgba(112, 215, 166, 0.15);
  color: var(--success);
}

.check-item.failed .check-icon {
  background: rgba(245, 200, 107, 0.15);
  color: var(--warning);
}

.backup-settings {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.backup-list {
  max-height: 390px;
  display: grid;
  gap: 9px;
  overflow-y: auto;
}

.backup-item {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.backup-item strong,
.backup-item span {
  display: block;
}

.backup-item strong {
  font-size: 12px;
}

.backup-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.backup-item code {
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-url {
  margin-top: 18px;
  padding: 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.integration-url span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.integration-url code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-list,
.steps {
  margin: 0;
  padding-left: 20px;
  color: #d6ccdd;
  line-height: 1.85;
}

.code-panel textarea {
  min-height: 610px;
  font: 12px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.inline-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #f4c6e5;
  overflow-wrap: anywhere;
}

.mono-list {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 1320px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .grid.two,
  .grid.two.unequal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    gap: 18px;
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .workspace {
    padding: 22px 16px 40px;
  }
}

@media (max-width: 620px) {
  .login-panel {
    padding: 28px 22px;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
  }

  .metric-grid,
  .form-grid,
  .button-grid {
    grid-template-columns: 1fr;
  }

  .button-grid .button-link,
  .form-grid .full {
    grid-column: auto;
  }

  .panel {
    padding: 19px;
  }

  .copy-row,
  .backup-item,
  .detail-list div {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .copy-row,
  .backup-item {
    flex-direction: column;
  }

  .backup-item code {
    max-width: 100%;
  }

  .detail-list dd {
    text-align: left;
  }

  .integration-url {
    grid-template-columns: 1fr;
  }
}

.signed-user {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.signed-user span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.table-shell { overflow-x: auto; }
.table-shell table { width: 100%; border-collapse: collapse; min-width: 820px; }
.table-shell th, .table-shell td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table-shell th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.table-shell select { min-width: 170px; }
.tag { display: inline-flex; margin-top: 6px; padding: 3px 8px; border-radius: 999px; font-size: .74rem; background: var(--panel-soft); }
.tag.warning { color: var(--warning); }
.role-summary { display: grid; gap: 10px; }
.role-summary p { margin: 0; color: var(--muted); }
.role-summary strong { color: var(--text); }
.modal-panel { width: min(520px, calc(100vw - 32px)); color: var(--text); background: var(--panel-strong); border: 1px solid var(--border-strong); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.modal-panel::backdrop { background: rgba(8, 5, 14, .78); backdrop-filter: blur(5px); }
.modal-panel h3 { margin-top: 0; }
