:root {
  --bg: #000000;
  --surface: rgba(11, 12, 15, 0.93);
  --surface-solid: #0b0c0f;
  --surface-2: #14161b;
  --surface-deep: #060709;
  --border: #252830;
  --border-hi: #4b505c;
  --text: #f4f4f0;
  --muted: #8b909c;
  --dim: #5d626e;
  --nothing-red: #d71921;
  --nothing-red-hover: #ef232b;
  --primary: #f4f4f0;
  --primary-ink: #000000;
  --discord: #4752c4;
  --discord-hover: #5865f2;
  --ok: #3fbf7f;
  --warn: #d4a143;
  --danger: #d71921;
  --radius: 2px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  position: relative;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body > iframe {
  position: fixed;
  width: 0;
  height: 0;
  border: 0;
  pointer-events: none;
}

.glyph-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-lockup {
  height: 52px;
  width: auto;
  display: block;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px 6px 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: -0.01em;
}

/* 3-App Launcher Strip — flush full-bleed square icons, sharp grotesk grid */
.app-dock-section {
  margin-bottom: 24px;
}

.app-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

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

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

.dock-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s linear, background 0.12s linear;
  position: relative;
  overflow: hidden;
  min-height: 92px;
}

.dock-item:hover {
  border-color: var(--text);
  background: var(--surface-2);
}

.dock-item:active {
  border-color: var(--nothing-red);
}

.dock-icon-wrap {
  width: 92px;
  min-width: 92px;
  height: auto;
  border-radius: 0;
  background: var(--surface-deep);
  border-right: 1px solid var(--border);
  padding: 0;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
}

.dock-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.dock-meta {
  min-width: 0;
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dock-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dock-title {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.dock-path {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 3px;
}

.dock-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

/* Panels & Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card-accent {
  border-color: var(--nothing-red);
  border-left-width: 3px;
}

.center-card {
  max-width: 520px;
  margin: 28px auto;
  text-align: left;
  padding: 28px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

h1 {
  margin: 0 0 10px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.86rem;
}
.tiny {
  font-size: 0.74rem;
}
.hidden {
  display: none !important;
}

code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1px 6px;
  color: var(--text);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

/* Segmented Tabs — crisp architectural block bar */
.tabs {
  display: inline-flex;
  gap: 0;
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
}

.tab {
  background: transparent;
  color: var(--muted);
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s linear, color 0.1s linear;
}

.tab:last-child {
  border-right: none;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab.active {
  background: var(--text);
  color: var(--bg);
}

.badge {
  background: var(--nothing-red);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 1px 6px;
  font-size: 0.68rem;
  font-weight: 700;
}

/* Buttons — sharp rectangular Swiss Grotesk controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s linear, border-color 0.1s linear, color 0.1s linear;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 0.8rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.7rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: #ffffff;
  border-color: #ffffff;
}

.btn-red {
  background: var(--nothing-red);
  color: #ffffff;
  border-color: var(--nothing-red);
}

.btn-red:hover:not(:disabled) {
  background: var(--nothing-red-hover);
  border-color: var(--nothing-red-hover);
}

.btn-discord {
  background: var(--discord);
  color: #ffffff;
  border-color: var(--discord);
}

.btn-discord:hover:not(:disabled) {
  background: var(--discord-hover);
  border-color: var(--discord-hover);
}

.btn-ghost {
  background: var(--surface-deep);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--text);
}

.btn-danger {
  background: transparent;
  color: #ff9fa3;
  border-color: var(--nothing-red);
}

.btn-danger:hover:not(:disabled) {
  background: var(--nothing-red);
  color: #ffffff;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 0 16px;
}

.banner {
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-left-width: 3px;
  background: var(--surface-solid);
}

.banner-ok {
  border-color: var(--ok);
  color: #b7f5d4;
}

.banner-err {
  border-color: var(--nothing-red);
  color: #ffc2c5;
}

.invite-notice {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-deep);
  border: 1px solid var(--nothing-red);
  border-left-width: 3px;
  color: #ffd0d2;
  font-size: 0.84rem;
}

/* Technical Status Tags */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius);
  padding: 3px 7px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.pill-ok {
  color: var(--ok);
  border-color: var(--ok);
  background: transparent;
}

.pill-pending {
  color: var(--warn);
  border-color: var(--warn);
  background: transparent;
}

.pill-admin {
  color: #ffffff;
  border-color: var(--nothing-red);
  background: var(--nothing-red);
}

.pill-google {
  color: var(--text);
  border-color: var(--border-hi);
  background: transparent;
}

.pill-discord {
  color: #c7d2fe;
  border-color: var(--discord);
  background: transparent;
}

.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.provider-row {
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.provider-name {
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}

.provider-actions {
  display: flex;
  gap: 8px;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="number"] {
  background: var(--surface-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 0.88rem;
  outline: none;
  flex: 1;
  min-width: 140px;
  transition: border-color 0.1s linear;
}

input:focus {
  border-color: var(--text);
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.item-row {
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.toolbar {
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.users-table th,
.users-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.users-table th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Crisp hardware square-track toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--surface-deep);
  border: 1px solid var(--border-hi);
  transition: 0.12s linear;
  border-radius: var(--radius);
}

.slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: var(--muted);
  transition: 0.12s linear;
  border-radius: 1px;
}

.switch input:checked + .slider {
  background: var(--surface-2);
  border-color: var(--ok);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
  background: var(--ok);
}

.switch input:disabled + .slider {
  opacity: 0.45;
  cursor: not-allowed;
}

.checks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px 7px 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.1s linear;
}

.toggle-chip:hover {
  border-color: var(--border-hi);
}

.inline-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-sm {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-hi);
  border-top-color: var(--nothing-red);
  border-radius: 0;
  margin: 0 0 12px;
  animation: spin 0.85s steps(8) infinite;
}

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