:root {
  --bg: #060606;
  --bg-soft: #121212;
  --panel: rgba(14, 14, 14, 0.9);
  --ink: #f3efea;
  --muted: #c9b8b8;
  --accent: #a10014;
  --accent-bright: #e0122d;
  --accent-soft: rgba(161, 0, 20, 0.2);
  --line: rgba(255, 255, 255, 0.18);
  --success: #193824;
  --error: #4d0a12;
  --shadow: rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(224, 18, 45, 0.14), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #000 0%, var(--bg) 50%, #090909 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a {
  color: #fff;
  text-decoration-color: var(--accent-bright);
}

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

button,
.secondary-button {
  border: 1px solid var(--accent-bright);
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(224, 18, 45, 0.18);
}

.secondary-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.site-header {
  padding: 2rem 2rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-mark {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(224, 18, 45, 0.28));
}

.page-chrome {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bloodline {
  position: absolute;
  inset: 0 0 auto;
  height: 92px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 12px),
    linear-gradient(180deg, #350008 0, #190003 55%, transparent 100%);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 96% 68%, 92% 54%, 88% 78%, 84% 52%, 79% 74%, 73% 49%, 69% 82%, 61% 47%, 56% 69%, 50% 50%, 46% 81%, 42% 58%, 36% 76%, 31% 46%, 25% 72%, 19% 51%, 13% 80%, 8% 57%, 4% 70%, 0 59%);
  opacity: 0.95;
}

.noise-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
}

.bat-swarm {
  position: absolute;
  inset: 0;
}

.bat {
  position: absolute;
  width: 46px;
  height: 20px;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.04);
  clip-path: polygon(0 66%, 12% 38%, 20% 52%, 29% 15%, 38% 48%, 50% 60%, 62% 48%, 71% 15%, 80% 52%, 88% 38%, 100% 66%, 79% 67%, 64% 92%, 50% 70%, 36% 92%, 21% 67%);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.55);
}

.bat-one { top: 86px; right: 14%; transform: rotate(-9deg) scale(1.1); }
.bat-two { top: 118px; right: 23%; transform: rotate(8deg) scale(0.8); }
.bat-three { top: 62px; right: 31%; transform: rotate(13deg) scale(0.7); }
.bat-four { top: 146px; right: 7%; transform: rotate(-16deg) scale(0.95); }

.site-header::after {
  content: "BIOHACKING / WITCHCRAFT / PARTS AND SUPPLIES";
  position: absolute;
  right: 2rem;
  bottom: -0.1rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.28em;
}

.brand {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(224, 18, 45, 0.38), 0 0 2px #fff;
}

.tagline,
.helper-copy,
.eyebrow {
  color: var(--muted);
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.link-button {
  background: transparent;
  color: #fff;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.page-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto 3rem;
  position: relative;
  z-index: 1;
}

.hero,
.content-grid {
  display: grid;
  gap: 1rem;
}

.hero {
  grid-template-columns: 2fr 1fr;
  margin-bottom: 1rem;
}

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

.stacked-panels {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel,
.hero-card,
.order-card,
.code-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 20%),
    var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 24px 60px var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::before,
.hero-card::before,
.order-card::before,
.code-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-bright), transparent 78%);
}

.narrow {
  max-width: 520px;
  margin: 3rem auto;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 480px);
  gap: 1rem;
  align-items: stretch;
  margin: 2.5rem auto 0;
}

.auth-panel {
  min-height: 100%;
}

.auth-copy-panel {
  display: grid;
  align-content: center;
  gap: 0.8rem;
  min-height: 480px;
}

.auth-title {
  margin: 0 0 0.4rem;
}

.auth-lede {
  max-width: 34rem;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink);
}

.auth-symbol-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  margin-top: 0.5rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(224, 18, 45, 0.1), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
    rgba(255, 255, 255, 0.02);
}

.auth-symbol {
  width: min(100%, 330px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 24px rgba(224, 18, 45, 0.18));
}

.hero-mark-card {
  display: grid;
  gap: 0.9rem;
  justify-items: start;
}

.hero-mark {
  width: 130px;
  height: auto;
  display: block;
  opacity: 0.95;
  filter: drop-shadow(0 0 16px rgba(224, 18, 45, 0.2));
}

.stack-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.88rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.flash.success {
  background: var(--success);
}

.flash.error {
  background: var(--error);
}

.card-list,
.plain-list {
  display: grid;
  gap: 0.75rem;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-list li {
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.product-table {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(140px, 180px) minmax(90px, 120px) minmax(80px, 100px);
  gap: 0.75rem;
  align-items: center;
}

.product-table-header {
  font-weight: bold;
  padding-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
}

.product-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-table {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.admin-table-head {
  font-weight: bold;
}

.admin-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.email-wrap {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.admin-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 820px;
  table-layout: fixed;
}

.admin-list-table th,
.admin-list-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.admin-list-table th {
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.02);
}

.admin-list-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-list-table td {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
}

.admin-list-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.admin-list-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.035);
}

.member-link {
  color: #fff;
  font-weight: bold;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
}

.member-link:hover {
  color: var(--accent-soft);
}

.admin-list-table-members .member-col-name {
  width: 17%;
}

.admin-list-table-members .member-col-email {
  width: 29%;
}

.admin-list-table-members .member-col-role {
  width: 8%;
}

.admin-list-table-members .member-col-credit {
  width: 9%;
}

.admin-list-table-members .member-col-since {
  width: 12%;
}

.admin-list-table-members .member-col-invite {
  width: 25%;
}

.admin-list-table-group-orders .group-order-col-label {
  width: 20%;
}

.admin-list-table-group-orders .group-order-col-date {
  width: 10%;
}

.admin-list-table-group-orders .group-order-col-city {
  width: 11%;
}

.admin-list-table-group-orders .group-order-col-count {
  width: 6%;
}

.admin-list-table-group-orders .group-order-col-status {
  width: 8%;
}

.admin-list-table-group-orders .group-order-col-note {
  width: 30%;
}

.admin-list-table-group-orders .group-order-col-actions {
  width: 15%;
}

.admin-list-table-group-orders {
  table-layout: auto;
}

.admin-list-table-group-orders th,
.admin-list-table-group-orders td {
  padding: 0.75rem 0.7rem;
}

.admin-list-table-group-orders .group-order-label-cell,
.admin-list-table-group-orders .group-order-date-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-list-table-group-orders .group-order-note-cell {
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-list-table-group-orders .group-order-city-cell,
.admin-list-table-group-orders .group-order-count-cell,
.admin-list-table-group-orders .group-order-status-cell,
.admin-list-table-group-orders .group-order-action-cell {
  white-space: nowrap;
}

.admin-list-table-products .product-sort-cell,
.admin-list-table-products .product-price-cell,
.admin-list-table-products .product-max-cell,
.admin-list-table-products .product-status-cell {
  white-space: nowrap;
}

.admin-list-table-products .product-name-cell {
  min-width: 0;
}

.admin-list-table-products .product-sizes-cell {
  color: var(--text-soft);
}

.admin-list-table-products .product-action-cell {
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge-open {
  background: rgba(25, 56, 36, 0.9);
  border-color: rgba(96, 170, 122, 0.55);
  color: #d8f2df;
}

.status-badge-closed {
  background: rgba(77, 10, 18, 0.9);
  border-color: rgba(190, 64, 84, 0.5);
  color: #ffd8de;
}

.member-name-cell,
.member-role-cell,
.member-credit-cell,
.member-since-cell {
  white-space: nowrap;
}

.member-email-cell,
.member-invite-cell {
  color: var(--text-soft);
}

.compact-form {
  gap: 0.6rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-row input {
  width: auto;
}

.inline-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form {
  margin: 0;
}

.small-button {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
}

.danger-button {
  background: #3c0008;
  border-color: #8b1120;
}

.product-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.member-admin-summary,
.member-admin-actions {
  min-width: 0;
}

.member-admin-actions {
  display: grid;
  gap: 0.6rem;
  justify-items: end;
}

.member-admin-actions .inline-form input[type="text"] {
  min-width: 180px;
}

.order-group-stack {
  display: grid;
  gap: 1rem;
}

.order-batch {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.order-batch-header {
  margin-bottom: 0.9rem;
}

.order-batch-header h3 {
  margin-bottom: 0.25rem;
}

.order-card-stack {
  display: grid;
  gap: 1rem;
}

.order-entry-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}

.order-entry-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
  gap: 0.9rem;
  align-items: start;
}

.order-entry-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.9fr);
  gap: 0.9rem;
  align-items: start;
}

.order-entry-section {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  line-height: 1.4;
}

.order-entry-label {
  display: inline-block;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.order-entry-member,
.order-entry-amount,
.order-entry-payment,
.order-entry-items,
.order-entry-action {
  min-width: 0;
}

.order-entry-due {
  font-size: 1.25rem;
}

.order-entry-items {
  line-height: 1.5;
}

.order-entry-action form {
  width: 100%;
}

.downline-tree {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem;
  display: grid;
  gap: 0.75rem;
}

.downline-node {
  position: relative;
}

.downline-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.member-picker,
.thread-stack {
  display: grid;
  gap: 0.75rem;
}

.member-picker {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.member-option {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
}

.thread-message {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.thread-message-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.thread-message p {
  margin: 0;
  white-space: pre-wrap;
}

.admin-page-header {
  align-items: center;
  justify-content: space-between;
}

.admin-form-drawer {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background:
    radial-gradient(circle at top right, rgba(224, 18, 45, 0.08), transparent 32%),
    rgba(255, 255, 255, 0.018);
  overflow: hidden;
}

.admin-form-drawer summary {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
}

.admin-form-drawer summary::-webkit-details-marker {
  display: none;
}

.admin-form-drawer summary strong {
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-form-drawer summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.admin-form-drawer[open] summary::after {
  content: "−";
}

.admin-form-drawer-body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: rgba(243, 239, 234, 0.72);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.admin-member-grid {
  align-items: start;
}

.admin-nav-shell {
  display: grid;
  gap: 1rem;
}

.admin-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-nav-active {
  border-color: var(--accent-bright);
  box-shadow: 0 0 18px rgba(224, 18, 45, 0.18);
}

.admin-hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.admin-manage-grid {
  align-items: start;
}

.panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.inline-filter-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inline-filter-form select {
  min-width: 12rem;
}

.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.admin-filter-field {
  display: grid;
  gap: 0.45rem;
  min-width: 16rem;
  flex: 1 1 16rem;
}

.admin-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.admin-search-shell {
  display: grid;
  gap: 0.45rem;
  min-width: min(100%, 320px);
}

.admin-search-label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.16em;
}

.admin-search-shell input[type="search"] {
  min-width: 0;
}

.admin-empty-state {
  margin-top: 1rem;
}

.detail-stack {
  display: grid;
  gap: 0.65rem;
}

.admin-nested-list {
  margin-top: 0.75rem;
  padding-left: 1rem;
}

.admin-nested-list > li {
  margin-top: 0.75rem;
}

.spacer-sm {
  height: 1rem;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin-bottom: 0.3rem;
}

.hero-copy strong,
.code-panel strong {
  color: #fff;
  text-shadow: 0 0 14px rgba(224, 18, 45, 0.35);
}

@media (max-width: 720px) {
  .site-header,
  .hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-copy-panel {
    min-height: auto;
  }

  .order-entry-summary,
  .order-entry-detail {
    grid-template-columns: 1fr;
  }

  .product-table {
    grid-template-columns: 1fr;
  }

  .admin-table {
    grid-template-columns: 1fr;
  }

  .product-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .member-admin-actions {
    justify-items: stretch;
  }

  .site-header::after {
    position: static;
    display: block;
    margin-top: 0.5rem;
  }
}
