* {
  box-sizing: border-box;
}

/* Ensure the `hidden` attribute always wins over author display rules
   (e.g. .login-shell / .admin-layout set display:grid). */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f7fbff;
  background: #090e16;
  overflow-x: hidden;
}

#signal-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.login-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: 40px;
}

.compact-login {
  width: min(520px, calc(100vw - 32px));
  grid-template-columns: 1fr;
}

.hero-copy h1,
header h1 {
  margin: 10px 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 620px;
  color: #aeb9c8;
  font-size: 18px;
}

.eyebrow {
  color: #47d8c4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel,
section {
  background: rgba(14, 22, 34, 0.78);
  border: 1px solid rgba(71, 216, 196, 0.22);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  border-radius: 8px;
}

.panel {
  position: relative;
  padding: 32px;
  overflow: hidden;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid #ffcd60;
  opacity: 0.85;
  pointer-events: none;
}

.pulse-ring {
  width: 72px;
  height: 72px;
  border: 1px solid rgba(71, 216, 196, 0.6);
  border-radius: 50%;
  margin-bottom: 22px;
  box-shadow: 0 0 0 0 rgba(71, 216, 196, 0.4);
  animation: pulse 2.4s infinite;
}

.dashboard {
  width: min(1080px, calc(100vw - 32px));
  margin: 32px auto;
}

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

section {
  margin-top: 24px;
  padding: 20px;
}

.row {
  min-height: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #edf7ff;
}

.muted {
  color: #9fb2c8;
}

input,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(71, 216, 196, 0.35);
  border-radius: 6px;
  background: rgba(4, 8, 14, 0.62);
  color: #f7fbff;
  font-family: inherit;
}

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

/* Version management ------------------------------------------------------ */
.version-item {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 0;
}

.version-item .version-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.version-actions .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.version-badges {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.badge.off {
  color: #ff9a8b;
}

.badge.hidden-badge {
  color: #c7a4ff;
}

.changelog {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(4, 8, 14, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #d7e2f0;
  font-size: 14px;
}

.changelog :is(h1, h2, h3) {
  font-size: 16px;
  margin: 8px 0 4px;
}

.changelog ul {
  margin: 4px 0;
  padding-left: 20px;
}

.changelog code {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

.version-edit {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.settings-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.settings-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: #c7d4e4;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #47d8c4, #ffcd60);
  color: #091016;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.home-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f7fbff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

small {
  display: block;
  color: #aeb9c8;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(71, 216, 196, 0.42), inset 0 0 28px rgba(71, 216, 196, 0.18);
  }
  70% {
    box-shadow: 0 0 0 24px rgba(71, 216, 196, 0), inset 0 0 28px rgba(71, 216, 196, 0.18);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(71, 216, 196, 0), inset 0 0 28px rgba(71, 216, 196, 0.18);
  }
}

/* ------------------------------------------------------------------ */
/* Admin console: sidebar layout                                       */
/* ------------------------------------------------------------------ */
.admin-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px;
  width: min(1200px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  background: rgba(14, 22, 34, 0.78);
  border: 1px solid rgba(71, 216, 196, 0.22);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.admin-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-brand strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #c7d4e4;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f7fbff;
}

.admin-nav a.active {
  background: rgba(71, 216, 196, 0.14);
  border-color: rgba(71, 216, 196, 0.4);
  color: #eafffb;
}

.admin-nav a .nav-icon {
  width: 20px;
  text-align: center;
  opacity: 0.85;
}

.admin-side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.admin-content > header {
  margin-bottom: 8px;
}

.admin-content header h1 {
  font-size: clamp(28px, 4vw, 40px);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.stat-card {
  padding: 20px;
  background: rgba(14, 22, 34, 0.78);
  border: 1px solid rgba(71, 216, 196, 0.22);
  border-radius: 8px;
}

.stat-card .stat-value {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  margin-top: 8px;
}

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

  .admin-sidebar {
    position: static;
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 40px 0;
  }

  header,
  .row,
  form {
    align-items: stretch;
    flex-direction: column;
  }
}
