:root {
  --bg: #eef6fb;
  --bg-soft: #f7fbfe;
  --panel: #ffffff;
  --panel-tint: #f2f9fc;
  --text: #14344c;
  --text-strong: #092f4b;
  --muted: #60798a;
  --line: #d4e6f0;
  --line-strong: #b7d8ea;
  --accent: #12649a;
  --accent-dark: #0b4b77;
  --accent-soft: #dceffa;
  --gold: #d7a84f;
  --danger: #b91c1c;
  --danger-bg: #fff0f0;
  --ok: #087f5b;
  --ok-bg: #e7f8ef;
  --shadow: 0 18px 45px rgb(9 47 75 / 10%);
  --shadow-soft: 0 8px 24px rgb(19 62 93 / 9%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 12%, rgb(117 189 224 / 32%), transparent 34vw),
    linear-gradient(135deg, #f7fbfe 0%, #eef6fb 48%, #dcedf7 100%);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(18 100 154 / 24%);
  outline-offset: 2px;
}

.app { min-height: 100vh; display: grid; }
.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  width: min(62vw, 760px);
  aspect-ratio: 1;
  right: -22vw;
  top: -18vw;
  border-radius: 50%;
  border: 1px solid rgb(18 100 154 / 14%);
  box-shadow:
    0 0 0 90px rgb(18 100 154 / 5%),
    0 0 0 180px rgb(18 100 154 / 4%);
}

.loginMetamorph,
.welcomeHive {
  --hive-bg: #060a0e;
  --hive-bg-soft: #0b1116;
  --hive-surface: #111920;
  --hive-amber: #f5a000;
  --hive-text: #ffffff;
  --hive-muted: #98a4ad;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 45%, rgb(245 160 0 / 9%), transparent 22rem),
    radial-gradient(circle at 12% 16%, rgb(37 79 103 / 24%), transparent 22rem),
    linear-gradient(145deg, #030507 0%, var(--hive-bg) 46%, var(--hive-bg-soft) 100%);
  color: var(--hive-text);
}

.welcomeHive {
  align-content: center;
}

.welcomeHive .honeycombField {
  animation-delay: .15s;
}

.welcomeHive .honeycombPattern {
  animation-delay: .45s;
}

.welcomeCard {
  width: min(560px, calc(100vw - 36px));
  display: grid;
  gap: 22px;
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgb(245 160 0 / 22%);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgb(17 25 32 / 82%), rgb(7 11 15 / 78%)),
    rgb(17 25 32 / 64%);
  box-shadow:
    0 34px 92px rgb(0 0 0 / 58%),
    inset 0 1px 0 rgb(255 255 255 / 6%);
  backdrop-filter: blur(18px);
  animation: welcomeCardEnter .9s cubic-bezier(.18, .84, .22, 1) both;
}

.welcomeCard::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgb(245 160 0 / 15%), transparent 46%),
    linear-gradient(110deg, transparent, rgb(245 160 0 / 8%), transparent);
  pointer-events: none;
}

.welcomeCard::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgb(245 160 0 / 10%);
  border-radius: 12px;
  pointer-events: none;
}

.welcomeBrand,
.welcomeCopy,
.welcomeCard .visitorMainAction {
  position: relative;
  z-index: 1;
}

.welcomeBrand {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.welcomeLogo {
  width: clamp(118px, 34vw, 178px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgb(245 160 0 / 18%));
}

.welcomeBrand span {
  color: var(--hive-amber);
  font-size: clamp(42px, 10vw, 72px);
  font-weight: 950;
  line-height: .9;
  letter-spacing: .14em;
  text-indent: .14em;
  text-shadow:
    0 0 18px rgb(245 160 0 / 20%),
    0 0 38px rgb(245 160 0 / 10%);
}

.welcomeBrand strong {
  color: #aeb8c0;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  line-height: 1.45;
  text-transform: uppercase;
}

.welcomeBrand em {
  color: #ffffff;
  font-size: 15px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.congregationLinks {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.congregationLinks a {
  color: #d7dde2;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.congregationLinks a:hover {
  color: var(--hive-amber);
}

.routeTopbar {
  width: min(1100px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.routeTopbar strong {
  display: block;
  color: var(--hive-amber);
  font-size: 24px;
  line-height: 1;
}

.routeTopbar span {
  color: #aeb8c0;
  font-size: 13px;
  font-weight: 800;
}

.churchRoute {
  align-content: center;
}

.churchFrame {
  width: min(1100px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 120px));
  border: 1px solid rgb(245 160 0 / 22%);
  border-radius: 14px;
  background: #060a0e;
  box-shadow: 0 28px 80px rgb(0 0 0 / 46%);
  position: relative;
  z-index: 1;
}

.welcomeCopy {
  display: grid;
  gap: 12px;
  text-align: center;
}

.welcomeCopy h1 {
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-size: clamp(30px, 6vw, 46px);
  letter-spacing: 0;
  line-height: 1.06;
}

.welcomeCopy p,
.visitorLanding .welcomeCopy p {
  margin: 0;
  color: #aeb8c0;
  font-size: 16px;
  line-height: 1.6;
}

.welcomeCard .visitorMainAction {
  min-height: 52px;
  border-color: rgb(245 160 0 / 80%);
  background: linear-gradient(135deg, #f5a000, #c97800);
  color: #14100a;
  box-shadow:
    0 16px 34px rgb(245 160 0 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 28%);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.welcomeCard .visitorMainAction:hover {
  background: linear-gradient(135deg, #ffb323, #d88400);
  box-shadow:
    0 20px 40px rgb(245 160 0 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 34%);
}

.welcomeCard .aboutButton {
  position: relative;
  z-index: 1;
  min-height: 42px;
}

.welcomeCard .gearButton {
  z-index: 3;
  border-color: rgb(245 160 0 / 18%);
  background: rgb(6 10 14 / 68%);
  color: #aeb8c0;
  box-shadow: 0 10px 22px rgb(0 0 0 / 22%);
}

.welcomeCard .gearButton:hover {
  border-color: rgb(245 160 0 / 42%);
  background: rgb(245 160 0 / 10%);
  color: #fff;
}

.welcomeCard .ministryAccess {
  border-color: rgb(245 160 0 / 18%);
  background: rgb(7 11 15 / 96%);
  box-shadow: 0 22px 45px rgb(0 0 0 / 36%);
}

.welcomeCard .ministryAccess span {
  color: var(--hive-amber);
}

.welcomeCard .ministryAccess button {
  border-color: rgb(245 160 0 / 14%);
  background: rgb(17 25 32 / 76%);
  color: #d8dee3;
}

.welcomeCard .ministryAccess button:hover {
  border-color: rgb(245 160 0 / 34%);
  background: rgb(245 160 0 / 10%);
  color: #fff;
}

.honeycombField {
  position: absolute;
  inset: -4%;
  z-index: -3;
  width: 108%;
  height: 108%;
  opacity: 0;
  filter: drop-shadow(0 0 10px rgb(245 160 0 / 8%));
  animation: honeycombReveal 1.6s ease 1.6s forwards;
}

.honeycombPattern {
  opacity: .2;
  transform-origin: center;
  animation: honeycombDrift 28s linear 2.1s infinite alternate;
}

.honeycombSweep {
  opacity: 0;
  mix-blend-mode: screen;
  animation: honeycombGlow 9s ease-in-out 4.2s infinite;
}

.loginVignette {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgb(6 10 14 / 82%), transparent 30%, transparent 70%, rgb(6 10 14 / 82%)),
    radial-gradient(circle at 50% 50%, transparent 0 20rem, rgb(0 0 0 / 46%) 45rem);
}

.morphStage {
  width: min(420px, calc(100vw - 32px));
  min-height: 560px;
  display: grid;
  place-items: center;
  position: relative;
}

.morphLogo {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  color: var(--hive-amber);
  font-size: clamp(58px, 12vw, 116px);
  font-weight: 950;
  line-height: .9;
  letter-spacing: .08em;
  text-indent: .08em;
  text-shadow:
    0 0 16px rgb(245 160 0 / 18%),
    0 0 36px rgb(245 160 0 / 11%);
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0;
  filter: blur(14px);
  animation: hiveLogoBirth 3.25s cubic-bezier(.18, .85, .22, 1) forwards;
  pointer-events: none;
}

.morphLogoImage {
  width: clamp(112px, 28vw, 196px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 26px rgb(245 160 0 / 20%));
}

.authCard {
  width: min(100%, 392px);
  min-height: 472px;
  display: grid;
  align-content: start;
  gap: 13px;
  position: relative;
  padding: 34px 30px 28px;
  overflow: hidden;
  border: 1px solid rgb(245 160 0 / 0%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(17 25 32 / 80%), rgb(7 11 15 / 76%)),
    rgb(17 25 32 / 62%);
  box-shadow:
    0 32px 90px rgb(0 0 0 / 55%),
    inset 0 1px 0 rgb(255 255 255 / 6%);
  backdrop-filter: blur(18px);
  transform: translateY(12px) scaleX(.56) scaleY(.09);
  transform-origin: center;
  opacity: 0;
  animation: authMetamorph 2.35s cubic-bezier(.18, .84, .22, 1) 1.35s forwards;
}

.authCard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgb(245 160 0 / 15%), transparent),
    radial-gradient(circle at 50% 0%, rgb(245 160 0 / 12%), transparent 46%);
  opacity: 0;
  animation: authSurfaceAwake 1.4s ease 2.25s forwards;
  pointer-events: none;
}

.authCard::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgb(245 160 0 / 10%);
  border-radius: 12px;
  opacity: 0;
  animation: authInnerLine 1s ease 3.1s forwards;
  pointer-events: none;
}

.authBrand,
.authIntro,
.authCard label,
.authCard .status,
.authSubmit,
.authBack {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(8px);
  animation: authContentReveal .7s ease forwards;
}

.authBrand { animation-delay: 3s; }
.authIntro { animation-delay: 3.15s; }
.authCard label:nth-of-type(1) { animation-delay: 3.35s; }
.authCard label:nth-of-type(2) { animation-delay: 3.48s; }
.authCard .status { animation-delay: 3.58s; }
.authSubmit { animation-delay: 3.66s; }
.authBack { animation-delay: 3.74s; }

.authBrand {
  display: grid;
  gap: 3px;
  justify-items: center;
  padding-bottom: 8px;
}

.authLogo {
  width: 96px;
  height: auto;
  object-fit: contain;
  margin-bottom: 5px;
}

.authBrand strong {
  color: var(--hive-amber);
  font-size: 31px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .15em;
  text-indent: .15em;
  text-shadow: 0 0 18px rgb(245 160 0 / 18%);
}

.authBrand span {
  color: var(--hive-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.authIntro {
  display: grid;
  gap: 6px;
  text-align: center;
  margin-bottom: 2px;
}

.authIntro h1 {
  margin: 0;
  color: var(--hive-text);
  font-family: inherit;
  font-size: 25px;
  letter-spacing: 0;
  line-height: 1.1;
}

.authIntro p {
  margin: 0;
  color: var(--hive-muted);
  font-size: 13px;
  line-height: 1.45;
}

.authCard label {
  color: #cfd6dc;
  font-size: 11px;
  letter-spacing: .11em;
}

.authCard input {
  min-height: 46px;
  border-color: rgb(245 160 0 / 18%);
  background: rgb(4 8 12 / 62%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.authCard input::placeholder { color: rgb(152 164 173 / 62%); }

.authCard input:focus-visible {
  border-color: rgb(245 160 0 / 68%);
  outline: 3px solid rgb(245 160 0 / 15%);
}

.authCard .status {
  min-height: 20px;
  font-size: 12px;
  text-align: center;
}

.authCard .status.ok { color: #ffd282; }
.authCard .status.bad { color: #ff8f8f; }

.authSubmit.primary {
  min-height: 48px;
  margin-top: 2px;
  border-color: rgb(245 160 0 / 80%);
  background: linear-gradient(135deg, #f5a000, #c97800);
  color: #14100a;
  box-shadow:
    0 14px 28px rgb(245 160 0 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 28%);
  letter-spacing: .14em;
}

.authSubmit.primary:hover {
  background: linear-gradient(135deg, #ffb323, #d88400);
  box-shadow:
    0 18px 34px rgb(245 160 0 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 34%);
}

.authBack.secondary {
  min-height: 38px;
  border-color: rgb(245 160 0 / 14%);
  background: transparent;
  color: var(--hive-muted);
  box-shadow: none;
}

.authBack.secondary:hover {
  background: rgb(245 160 0 / 7%);
  color: #fff;
}

@keyframes hiveLogoBirth {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: translate(-50%, -50%) scale(.88);
  }
  24% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  48% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  78% {
    opacity: .96;
    filter: blur(.4px);
    transform: translate(-50%, calc(-50% - 178px)) scale(.31);
  }
  100% {
    opacity: 0;
    filter: blur(4px);
    transform: translate(-50%, calc(-50% - 178px)) scale(.29);
  }
}

@keyframes authMetamorph {
  0% {
    opacity: 0;
    border-color: rgb(245 160 0 / 0%);
    border-radius: 999px;
    transform: translateY(12px) scaleX(.56) scaleY(.09);
  }
  18% {
    opacity: 1;
    border-color: rgb(245 160 0 / 42%);
    transform: translateY(12px) scaleX(.86) scaleY(.1);
  }
  52% {
    border-radius: 26px;
    transform: translateY(8px) scaleX(1) scaleY(.34);
  }
  100% {
    opacity: 1;
    border-color: rgb(245 160 0 / 22%);
    border-radius: 16px;
    transform: translateY(0) scaleX(1) scaleY(1);
  }
}

@keyframes authSurfaceAwake {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes authInnerLine {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes authContentReveal {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes honeycombReveal {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes honeycombDrift {
  from { transform: translate3d(-18px, -12px, 0); }
  to { transform: translate3d(22px, 18px, 0); }
}

@keyframes honeycombGlow {
  0%, 62%, 100% { opacity: 0; transform: translateX(-34%); }
  74% { opacity: .55; }
  88% { opacity: 0; transform: translateX(340%); }
}

@keyframes welcomeCardEnter {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(18px) scale(.96);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

.entryPanel, .panel {
  background: rgb(255 255 255 / 94%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.entryPanel {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.entryPanel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), #75bde0, var(--gold));
}

.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brandLogo {
  flex: 0 0 auto;
  width: 54px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgb(0 0 0 / 22%));
}
.brandMark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #0d4771);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgb(18 100 154 / 22%);
}
.brand strong {
  color: var(--text-strong);
  letter-spacing: .12em;
  font-weight: 900;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 8px;
  color: var(--text-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -.03em;
}
h2 { margin-bottom: 14px; color: var(--text-strong); font-size: 20px; line-height: 1.2; }
h3 { margin-bottom: 8px; color: var(--text-strong); font-size: 16px; }
p { line-height: 1.55; }
hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.muted { color: var(--muted); font-weight: 700; }
.hint { margin: -2px 0 6px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.status { min-height: 22px; color: var(--muted); font-weight: 800; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }

.entryGrid { display: grid; gap: 10px; }
.entryGrid button, .primary, .secondary, .danger {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 900;
  border: 1px solid transparent;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}
.entryGrid button, .primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 9px 20px rgb(18 100 154 / 18%);
}
.entryGrid button:hover, .primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgb(18 100 154 / 24%);
}
.secondary {
  background: #fff;
  color: var(--accent-dark);
  border-color: var(--line-strong);
}
.secondary:hover { background: var(--accent-soft); }
.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}
.danger:hover { background: #fee2e2; }
.visitorLanding p, .visitorLogin p, .thanksPanel p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 0;
}
.visitorMainAction {
  min-height: 50px;
  font-size: 16px;
}
.gearButton {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 6px 14px rgb(9 47 75 / 8%);
}
.gearButton:hover {
  color: var(--accent-dark);
  border-color: var(--line-strong);
  background: var(--panel-tint);
}
.ministryAccess {
  position: absolute;
  top: 56px;
  right: 14px;
  z-index: 4;
  width: min(230px, calc(100% - 28px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 18px 35px rgb(9 47 75 / 18%);
}
.ministryAccess span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ministryAccess div {
  display: grid;
  gap: 8px;
}
.ministryAccess button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.ministryAccess button:hover {
  border-color: var(--line-strong);
  color: var(--accent-dark);
  background: var(--panel-tint);
}
.linkButton {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  padding: 18px 16px;
  background: linear-gradient(180deg, #092f4b 0%, #0d4771 100%);
  border-right: 1px solid rgb(255 255 255 / 12%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 12px 0 30px rgb(9 47 75 / 12%);
}
.sidebar .brandMark {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: none;
}
.sidebar .brand strong { color: #fff; }
.sidebar .muted { color: #c9e8f7; font-size: 12px; }
.nav { display: grid; gap: 8px; }
.nav button {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 11px 12px;
  font-weight: 850;
  color: #e8f6fd;
}
.nav button.active, .nav button:hover {
  background: rgb(255 255 255 / 13%);
  border-color: rgb(255 255 255 / 24%);
  color: #fff;
}
.nav button:last-child {
  margin-top: 8px;
  color: #d7ecf8;
  border-color: rgb(255 255 255 / 16%);
}

.content {
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.topbar h1 { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.metric {
  min-height: 92px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 5px;
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.metric:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgb(9 47 75 / 14%);
}
.metric span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.metric strong { color: var(--text-strong); font-size: 26px; line-height: 1; }

form, .form { display: grid; gap: 10px; }
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}
label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: #8da5b4; }
textarea { min-height: 92px; resize: vertical; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.searchRow { align-items: stretch; }
.searchRow input { flex: 1 1 240px; }
.rowActions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rowActions button { min-height: 36px; padding: 8px 10px; }
.panelHeader { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.panelHeader h2 { margin-bottom: 0; }
.panelHeader span { color: var(--muted); font-size: 12px; font-weight: 900; }

.table {
  display: grid;
  overflow-x: auto;
  border-radius: 8px;
}
.tableHead, .tableRow {
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr .8fr;
  min-width: 640px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 11px 4px;
}
.tableHead {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tableRow:hover { background: rgb(220 239 247 / 38%); }
.tableRow button { justify-self: start; }
.peopleRow { grid-template-columns: minmax(150px, 1.2fr) minmax(120px, 1fr) 80px minmax(150px, .9fr); }
.cultoRow { grid-template-columns: minmax(180px, 1fr) 130px 150px minmax(220px, 1.4fr); }
.usersRow { grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.1fr) minmax(120px, .8fr) 90px minmax(150px, .8fr); }
.rolesRow { grid-template-columns: minmax(150px, 1fr) 110px 90px minmax(150px, .8fr); }
.list { display: grid; gap: 9px; }
.cardButton {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 4px;
  color: var(--text);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.cardButton:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.check { display: flex; align-items: center; gap: 8px; text-transform: none; font-size: 13px; letter-spacing: 0; }
.check input { width: auto; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--accent-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}
.pill.ok { background: var(--ok-bg); border-color: #b7ebd0; color: var(--ok); }
.pill.warn { background: #fff8e6; border-color: #f4d58d; color: #935f00; }
.metric.signal { border-left: 4px solid var(--accent); }
.metric.signal.ok { border-left-color: var(--ok); }
.metric.signal.warn { border-left-color: var(--gold); }
.metric small { color: var(--muted); font-size: 12px; font-weight: 700; }
.phoneField {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}
.phoneField .flag {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(135deg, #159447 0 34%, #f6d74a 34% 66%, #174ea6 66%);
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgb(0 0 0 / 34%);
}
.phoneField input { border-radius: 0 8px 8px 0; }
.visitorHeader { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.timeline { display: grid; gap: 9px; }
.timelineItem {
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  background: var(--panel-tint);
  border-radius: 0 8px 8px 0;
}
.hidden { display: none !important; }
.mobileFab { display: none; }
.dashboardFilters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.dashboardDetails { align-content: start; }
.dashboardDetailRow { grid-template-columns: minmax(180px, 1.2fr) minmax(130px, .8fr) minmax(70px, .35fr) minmax(150px, .9fr) minmax(120px, .55fr); }
.personForm { gap: 12px; }
.formColumns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.visitorForm { max-height: min(88vh, 760px); overflow: auto; }
.adminGrid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .95fr); }
.orgRow { grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.1fr) minmax(90px, .45fr) minmax(150px, .7fr); }
.textAction {
  display: block;
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}
.textAction:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}
.modalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(9 47 75 / 48%);
}
.modalCard {
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 24px 60px rgb(9 47 75 / 30%);
}
.modalCard.large { width: min(880px, 100%); }
.aboutModal {
  text-align: center;
}

.aboutModal .panelHeader {
  text-align: left;
}

.aboutBrand {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--accent);
  font-size: clamp(36px, 9vw, 58px);
  font-weight: 950;
  line-height: .9;
  letter-spacing: .14em;
  text-indent: .14em;
  text-shadow:
    0 0 18px rgb(245 160 0 / 20%),
    0 0 38px rgb(245 160 0 / 10%);
}

.aboutLogo {
  width: 150px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgb(0 0 0 / 22%));
}

.aboutModal p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.permissionGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.permissionItem {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-tint);
}

/* HIVE global dark theme */
:root {
  --bg: #060a0e;
  --bg-soft: #0b1116;
  --panel: rgb(17 25 32 / 82%);
  --panel-tint: rgb(245 160 0 / 7%);
  --text: #d8dee3;
  --text-strong: #ffffff;
  --muted: #98a4ad;
  --line: rgb(245 160 0 / 14%);
  --line-strong: rgb(245 160 0 / 28%);
  --accent: #f5a000;
  --accent-dark: #c97800;
  --accent-soft: rgb(245 160 0 / 10%);
  --gold: #f5a000;
  --danger: #ff8f8f;
  --danger-bg: rgb(255 143 143 / 10%);
  --ok: #7ee0b8;
  --ok-bg: rgb(126 224 184 / 10%);
  --shadow: 0 34px 92px rgb(0 0 0 / 58%);
  --shadow-soft: 0 24px 58px rgb(0 0 0 / 34%);
}

html,
body {
  background:
    radial-gradient(circle at 50% 35%, rgb(245 160 0 / 8%), transparent 26rem),
    radial-gradient(circle at 12% 16%, rgb(37 79 103 / 20%), transparent 22rem),
    linear-gradient(145deg, #030507 0%, #060a0e 46%, #0b1116 100%);
  color: var(--text);
  scrollbar-color: rgb(245 160 0 / 42%) #060a0e;
}

html {
  overflow-x: hidden;
  background-color: #060a0e !important;
}

body {
  overflow-x: hidden;
  background-color: #060a0e !important;
}

.app,
.hero,
.shell {
  width: 100%;
  max-width: 100vw;
}

* {
  scrollbar-color: rgb(245 160 0 / 42%) rgb(6 10 14 / 84%);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgb(6 10 14 / 92%);
}

*::-webkit-scrollbar-thumb {
  background: rgb(245 160 0 / 34%);
  border: 2px solid rgb(6 10 14 / 92%);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgb(245 160 0 / 54%);
}

body::before {
  content: "";
  position: fixed;
  inset: -4%;
  z-index: -1;
  pointer-events: none;
  opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='138' viewBox='0 0 160 138'%3E%3Cg fill='none' stroke='%23F5A000' stroke-width='1.35' stroke-linejoin='round'%3E%3Cpolygon points='40,0 80,23 80,69 40,92 0,69 0,23'/%3E%3Cpolygon points='120,0 160,23 160,69 120,92 80,69 80,23'/%3E%3Cpolygon points='80,69 120,92 120,138 80,161 40,138 40,92'/%3E%3Cpolygon points='0,69 40,92 40,138 0,161 -40,138 -40,92'/%3E%3Cpolygon points='160,69 200,92 200,138 160,161 120,138 120,92'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 160px 138px;
  filter: drop-shadow(0 0 10px rgb(245 160 0 / 8%));
}

.hero,
.shell {
  background:
    radial-gradient(circle at 50% 34%, rgb(245 160 0 / 8%), transparent 26rem),
    radial-gradient(circle at 12% 16%, rgb(37 79 103 / 20%), transparent 22rem),
    linear-gradient(145deg, #030507 0%, #060a0e 46%, #0b1116 100%);
  color: var(--text);
}

.hero::before {
  display: none;
}

.hero::after,
.shell::before {
  content: "";
  position: absolute;
  inset: -4%;
  z-index: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='138' viewBox='0 0 160 138'%3E%3Cg fill='none' stroke='%23F5A000' stroke-width='1.35' stroke-linejoin='round'%3E%3Cpolygon points='40,0 80,23 80,69 40,92 0,69 0,23'/%3E%3Cpolygon points='120,0 160,23 160,69 120,92 80,69 80,23'/%3E%3Cpolygon points='80,69 120,92 120,138 80,161 40,138 40,92'/%3E%3Cpolygon points='0,69 40,92 40,138 0,161 -40,138 -40,92'/%3E%3Cpolygon points='160,69 200,92 200,138 160,161 120,138 120,92'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 160px 138px;
  transform: translate3d(-12px, -8px, 0);
}

.hero > *,
.shell > * {
  position: relative;
  z-index: 1;
}

.shell {
  position: relative;
  overflow: hidden;
}

.content {
  position: relative;
}

.content::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(6 10 14 / 72%), transparent 28%, transparent 76%, rgb(6 10 14 / 72%)),
    radial-gradient(circle at 58% 30%, transparent 0 20rem, rgb(0 0 0 / 34%) 46rem);
}

.entryPanel,
.panel,
.metric,
.modalCard,
.cardButton,
.permissionItem {
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgb(17 25 32 / 86%), rgb(7 11 15 / 80%)),
    rgb(17 25 32 / 70%);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.entryPanel,
.modalCard {
  box-shadow: var(--shadow);
}

.entryPanel::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .82;
}

.panel,
.entryPanel,
.modalCard,
.metric,
.cardButton,
.permissionItem,
.table {
  border-radius: 12px;
}

.brandMark {
  background: linear-gradient(145deg, #f5a000, #c97800);
  color: #14100a;
  font-family: inherit;
  box-shadow: 0 14px 28px rgb(245 160 0 / 18%);
}

.brand strong,
h1,
h2,
h3,
.metric strong,
.cardButton strong,
.tableRow strong {
  color: var(--text-strong);
}

h1 {
  font-family: inherit;
  letter-spacing: 0;
}

.muted,
.hint,
label,
label small,
.metric small,
.panelHeader span,
.visitorLanding p,
.visitorLogin p,
.thanksPanel p,
.cardButton span,
.cardButton small {
  color: var(--muted);
}

hr,
.tableHead,
.tableRow {
  border-color: var(--line);
}

.tableHead,
.metric span {
  color: var(--accent);
}

.tableRow:hover,
.cardButton:hover,
.timelineItem {
  background: rgb(245 160 0 / 7%);
}

input,
select,
textarea {
  border-color: var(--line-strong);
  background: rgb(4 8 12 / 66%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

input::placeholder,
textarea::placeholder {
  color: rgb(152 164 173 / 68%);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: rgb(245 160 0 / 68%);
  outline: 3px solid rgb(245 160 0 / 15%);
}

.primary,
.entryGrid button {
  border-color: rgb(245 160 0 / 80%);
  background: linear-gradient(135deg, #f5a000, #c97800);
  color: #14100a;
  box-shadow:
    0 14px 28px rgb(245 160 0 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 28%);
}

.primary:hover,
.entryGrid button:hover {
  background: linear-gradient(135deg, #ffb323, #d88400);
  box-shadow:
    0 18px 34px rgb(245 160 0 / 24%),
    inset 0 1px 0 rgb(255 255 255 / 34%);
}

.secondary {
  border-color: var(--line);
  background: rgb(17 25 32 / 68%);
  color: var(--text);
  box-shadow: none;
}

.secondary:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: #fff;
}

.danger {
  border-color: rgb(255 143 143 / 28%);
  background: var(--danger-bg);
  color: var(--danger);
}

.danger:hover {
  background: rgb(255 143 143 / 16%);
}

.sidebar {
  background:
    linear-gradient(180deg, rgb(17 25 32 / 94%), rgb(4 8 12 / 92%)),
    #0b1116;
  border-right-color: var(--line);
  box-shadow: 16px 0 42px rgb(0 0 0 / 36%);
  backdrop-filter: blur(18px);
}

.sidebar .brandMark {
  background: linear-gradient(145deg, #f5a000, #c97800);
  color: #14100a;
}

.sidebar .brand strong {
  color: var(--accent);
}

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

.nav button {
  color: #d8dee3;
}

.nav button.active,
.nav button:hover {
  border-color: var(--line-strong);
  background: rgb(245 160 0 / 10%);
  color: #fff;
}

.nav button:last-child {
  border-color: rgb(255 255 255 / 10%);
  color: #b7c0c8;
}

.pill {
  border-color: var(--line);
  background: rgb(245 160 0 / 9%);
  color: #ffd282;
}

.pill.ok {
  border-color: rgb(126 224 184 / 28%);
  background: var(--ok-bg);
  color: var(--ok);
}

.pill.warn {
  border-color: rgb(245 160 0 / 28%);
  background: rgb(245 160 0 / 10%);
  color: #ffd282;
}

.metric.signal {
  border-left-color: var(--accent);
}

.metric.signal.ok {
  border-left-color: var(--ok);
}

.metric.signal.warn {
  border-left-color: var(--accent);
}

.phoneField .flag {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, #f5a000, #c97800);
  color: #14100a;
  text-shadow: none;
}

.timelineItem {
  border-left-color: var(--accent);
}

.modalBackdrop {
  background: rgb(0 0 0 / 62%);
  backdrop-filter: blur(10px);
}

.mobileFab {
  background: linear-gradient(135deg, #f5a000, #c97800);
  color: #14100a;
  box-shadow: 0 16px 34px rgb(245 160 0 / 24%);
}

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

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(82vw, 280px);
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 20px 0 45px rgb(9 47 75 / 28%);
  }
  .sidebar.mobileOpen { transform: translateX(0); }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .metrics, .dashboardFilters, .formColumns { grid-template-columns: 1fr; }
  .tableHead { display: none; }
  .tableRow, .peopleRow, .cultoRow, .usersRow, .rolesRow { grid-template-columns: 1fr; min-width: 0; gap: 7px; padding: 13px 0; }
  .tableRow > [data-label] {
    display: grid;
    gap: 4px;
  }
  .tableRow > [data-label]::before {
    content: attr(data-label);
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .rowActions { width: 100%; }
  .rowActions button { flex: 1 1 120px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .visitorHeader { grid-template-columns: 1fr; }
  .content { padding: 16px; padding-bottom: 88px; }
  .entryPanel, .panel { padding: 16px; }
  .adminGrid, .permissionGrid { grid-template-columns: 1fr; }
  .mobileFab {
    display: inline-flex;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 30;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 14px 26px rgb(18 100 154 / 28%);
    font-weight: 900;
  }
}

@media (max-width: 520px) {
  .hero { padding: 14px; }
  .loginMetamorph,
  .welcomeHive { padding: 14px; }
  .welcomeCard {
    width: min(100%, 360px);
    gap: 18px;
    padding: 32px 20px 24px;
  }
  .welcomeLogo { width: min(148px, 58vw); }
  .welcomeBrand span { font-size: clamp(42px, 15vw, 58px); }
  .welcomeBrand strong {
    font-size: 10px;
    letter-spacing: .09em;
  }
  .welcomeCopy p,
  .visitorLanding .welcomeCopy p {
    font-size: 14px;
  }
  .morphStage {
    width: min(100%, 360px);
    min-height: 540px;
  }
  .authCard {
    min-height: 456px;
    padding: 30px 20px 22px;
  }
  .authBrand strong { font-size: 28px; }
  .authLogo { width: 82px; }
  .authIntro h1 { font-size: 23px; }
  .morphLogo {
    font-size: clamp(52px, 18vw, 76px);
  }
  .morphLogoImage { width: min(144px, 48vw); }
  h1 { font-size: clamp(28px, 12vw, 42px); }
  .entryGrid button, .primary, .secondary, .danger { width: 100%; }
  .nav { grid-template-columns: 1fr; }
  .brand { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .honeycombField,
  .honeycombPattern,
  .honeycombSweep,
  .morphLogo,
  .welcomeCard,
  .authCard,
  .authCard::before,
  .authCard::after,
  .authBrand,
  .authIntro,
  .authCard label,
  .authCard .status,
  .authSubmit,
  .authBack {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}
