:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.55);
  --faint: rgba(255, 255, 255, 0.32);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#lines {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

main {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 16px;
  text-align: center;
}

.logo {
  width: 112px;
  height: 112px;
  filter: drop-shadow(0 0 24px rgba(255, 255, 255, 0.25));
  animation: rise 900ms cubic-bezier(.2, .7, .2, 1) both;
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  animation: rise 900ms 120ms cubic-bezier(.2, .7, .2, 1) both;
}

h1 {
  font-size: clamp(44px, 10vw, 104px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  animation: rise 900ms 220ms cubic-bezier(.2, .7, .2, 1) both;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  animation: rise 900ms 420ms cubic-bezier(.2, .7, .2, 1) both;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.button.primary {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.button.primary:hover {
  background: rgba(255, 255, 255, 0.88);
}

.button svg {
  width: 20px;
  height: 20px;
  flex: none;
}

@media (max-width: 480px) {
  .links {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }
}

footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .logo, .eyebrow, h1, .links { animation: none; }
  .button { transition: none; }
  .button:hover { transform: none; }
}

/* ---- Staff panel ---- */

body.panel-page {
  overflow: auto;
}

.card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(10px);
  text-align: center;
  animation: rise 700ms cubic-bezier(.2, .7, .2, 1) both;
}

.card .logo {
  width: 72px;
  height: 72px;
  animation: none;
}

.card h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.card .button {
  width: 100%;
  margin-top: 8px;
}

.card.wide {
  max-width: 640px;
  align-items: flex-start;
  text-align: left;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
}

.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.button.small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand span,
  .account-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
}

/* ---- Staff panel pages ---- */

.tabs {
  display: flex;
  gap: 4px;
  margin-right: auto;
  margin-left: 24px;
}

.tabs a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

.tabs a[aria-current="page"] {
  color: var(--bg);
  background: var(--fg);
}

main.panel {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 104px 24px 64px;
  text-align: left;
}

main.panel > * + * {
  margin-top: 20px;
}

main.panel h1 {
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: -0.02em;
  animation: none;
}

main.panel h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

main.panel h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 8px;
}

main.panel .eyebrow {
  animation: none;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.box {
  position: relative;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(8px);
}

.box-link {
  display: block;
  color: var(--fg);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.box-link:hover {
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.box-link h2 {
  margin-bottom: 6px;
}

.grid-2,
.links-grid,
.stats {
  display: grid;
  gap: 16px;
}

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

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

.stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(8, 8, 8, 0.88);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 800;
}

.stat-sub {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
  margin-left: -6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-on {
  background: #3ba55d;
  box-shadow: 0 0 10px rgba(59, 165, 93, 0.8);
}

.dot-off {
  background: #ed4245;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
  font-weight: 500;
}

.nowrap {
  white-space: nowrap;
}

.list {
  list-style: none;
  display: grid;
  gap: 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--role, #99aab5);
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.badge-active {
  background: rgba(59, 165, 93, 0.18);
  color: #7ee2a0;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.reason {
  min-width: 200px;
  max-width: 360px;
  overflow-wrap: anywhere;
}

tr.is-voided td {
  opacity: 0.5;
}

tr.is-voided td.reason {
  text-decoration: line-through;
}

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

.member-link {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.member-link:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--fg);
}

.profile {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile .avatar {
  width: 72px;
  height: 72px;
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}

.flash-ok {
  border: 1px solid rgba(59, 165, 93, 0.5);
  background: rgba(59, 165, 93, 0.14);
}

.flash-error {
  border: 1px solid rgba(237, 66, 69, 0.55);
  background: rgba(237, 66, 69, 0.14);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field-wide,
.form-actions {
  grid-column: 1 / -1;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

input,
select,
textarea {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}

input[type="number"] {
  width: 84px;
}

.inline-form input[type="text"] {
  min-width: 160px;
  flex: 1;
}

textarea {
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 1px;
}

select option {
  background: #111;
}

button.button {
  cursor: pointer;
}

button.button:disabled {
  opacity: 0.5;
  cursor: progress;
}

.button-danger {
  border-color: rgba(237, 66, 69, 0.6);
  color: #ff8a8c;
}

.button-danger:hover {
  background: rgba(237, 66, 69, 0.16);
  border-color: rgba(237, 66, 69, 0.9);
}

@media (max-width: 1100px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .tabs {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
  }

  main.panel {
    padding-top: 132px;
  }
}

@media (max-width: 480px) {
  main.panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .box {
    padding: 18px 16px;
  }

  .profile {
    flex-direction: column;
    align-items: flex-start;
  }
}

.subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.88);
}

.subtabs a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.subtabs a:hover {
  color: var(--fg);
}

.subtabs a[aria-current="page"] {
  color: var(--bg);
  background: var(--fg);
}

.box h2 + p.small {
  margin: -6px 0 16px;
}

/* Searchable member picker (assets/panel.js) */

.picker {
  position: relative;
}

.picker input {
  width: 100%;
}

.picker-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  list-style: none;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #0c0c0c;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.picker-list li {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
  cursor: pointer;
}

.picker-list li:hover,
.picker-list li.active {
  background: rgba(255, 255, 255, 0.1);
}

.picker-list li.empty {
  color: var(--muted);
  cursor: default;
}

/* Keep an open picker list above the boxes below it. */
.box:focus-within {
  z-index: 2;
}
