:root {
  color-scheme: dark;
  --bg: #08101d;
  --bg-elevated: rgba(11, 18, 32, 0.72);
  --bg-panel: rgba(16, 25, 42, 0.82);
  --bg-panel-strong: rgba(14, 21, 37, 0.94);
  --line: rgba(128, 160, 218, 0.18);
  --line-strong: rgba(128, 160, 218, 0.28);
  --text: #ecf3ff;
  --muted: #96a3bd;
  --muted-strong: #b7c2d9;
  --blue: #5a8dff;
  --blue-strong: #3f72ff;
  --gold: #f5b544;
  --emerald: #31c796;
  --danger: #ff7272;
  --shadow: 0 28px 90px rgba(1, 7, 18, 0.48);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --sidebar-width: 280px;
  --content-width: 1560px;
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 16%, rgba(85, 123, 255, 0.2), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(245, 181, 68, 0.18), transparent 26%),
    linear-gradient(180deg, #091120 0%, #050c17 50%, #040913 100%);
  color: var(--text);
  font-family: var(--font-body);
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  cursor: pointer;
}

.admin-stage {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 24px;
}

.admin-stage__noise,
.admin-stage__glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.admin-stage__noise {
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 36%, transparent 90%);
}

.admin-stage__glow {
  filter: blur(120px);
}

.admin-stage__glow--left {
  background: radial-gradient(circle at 10% 20%, rgba(90, 141, 255, 0.32), transparent 22%);
}

.admin-stage__glow--right {
  background: radial-gradient(circle at 86% 16%, rgba(245, 181, 68, 0.24), transparent 22%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #88a5ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-shell,
.app-shell {
  position: relative;
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  z-index: 1;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 48px);
}

.auth-shell__visual,
.auth-shell__panel,
.sidebar,
.main-shell,
.panel-card,
.hero-panel,
.metric-card,
.status-chip,
.sidebar__card,
.resource-card,
.timeline-item {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-shell__visual,
.auth-shell__panel,
.sidebar,
.main-shell,
.panel-card,
.hero-panel,
.status-chip,
.sidebar__card,
.resource-card,
.timeline-item {
  background: linear-gradient(180deg, rgba(14, 23, 39, 0.94), rgba(9, 15, 28, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-shell__visual,
.auth-shell__panel,
.sidebar,
.main-shell {
  border-radius: var(--radius-xl);
}

.auth-shell__visual,
.auth-shell__panel {
  padding: 40px;
}

.auth-shell__visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
}

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

.brand-mark h1 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 4vw, 4.6rem);
  line-height: 0.95;
}

.brand-mark__badge {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(98, 149, 255, 0.35), rgba(26, 42, 78, 0.8)),
    rgba(30, 45, 74, 0.7);
  border: 1px solid rgba(133, 170, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 16px 40px rgba(58, 92, 170, 0.34);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
}

.brand-mark--compact strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.auth-shell__lede {
  max-width: 58ch;
  margin: 0;
  color: var(--muted-strong);
  font-size: 1.03rem;
  line-height: 1.7;
}

.visual-orbit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.orbit-card {
  position: relative;
  overflow: hidden;
  min-height: 174px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(133, 170, 255, 0.2);
  background: linear-gradient(180deg, rgba(17, 29, 49, 0.92), rgba(10, 18, 31, 0.96));
}

.orbit-card::after {
  content: "";
  position: absolute;
  inset: auto -16px -18px auto;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(90, 141, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.orbit-card--primary {
  grid-column: span 2;
}

.orbit-card--tertiary::after {
  background: radial-gradient(circle, rgba(245, 181, 68, 0.22), transparent 70%);
}

.orbit-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 16px;
  background: rgba(27, 40, 67, 0.9);
  border: 1px solid rgba(133, 170, 255, 0.22);
}

.orbit-card__icon img,
.status-chip img,
.nav-button img,
.sidebar__card-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) saturate(100%) invert(88%) sepia(12%) saturate(526%) hue-rotate(183deg) brightness(102%) contrast(101%);
}

.orbit-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-size: 1.18rem;
}

.orbit-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.visual-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 18px;
  border-radius: 20px;
}

.status-chip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-chip strong {
  font-family: var(--font-heading);
}

.auth-shell__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.panel-card {
  border-radius: var(--radius-lg);
  padding: 28px;
}

.panel-card--auth {
  padding: 32px;
}

.panel-card__header {
  margin-bottom: 24px;
}

.panel-card__header--inline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.panel-card__header h2,
.panel-card__header h3 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  line-height: 1.05;
}

.panel-card__header h2 {
  font-size: 2rem;
}

.panel-card__header h3 {
  font-size: 1.5rem;
}

.panel-card__header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.form-stack,
.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(126, 158, 217, 0.18);
  border-radius: 16px;
  background: rgba(13, 21, 35, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(90, 141, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(90, 141, 255, 0.14);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field--full {
  grid-column: 1 / -1;
}

.field--toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.field--toggle span {
  flex: 1;
}

.field--toggle input {
  width: 22px;
  height: 22px;
  padding: 0;
  accent-color: var(--blue);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid rgba(133, 170, 255, 0.18);
  border-radius: 16px;
  background: rgba(12, 20, 34, 0.86);
  color: var(--text);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(133, 170, 255, 0.36);
}

.button--full {
  width: 100%;
}

.button--primary {
  border-color: rgba(103, 149, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(93, 143, 255, 0.98), rgba(60, 107, 255, 0.98)),
    rgba(60, 107, 255, 0.94);
  box-shadow: 0 18px 40px rgba(63, 114, 255, 0.24);
}

.button--ghost {
  background: rgba(11, 19, 34, 0.7);
}

.button--danger {
  border-color: rgba(255, 114, 114, 0.28);
  color: #ffd4d4;
  background: rgba(53, 16, 20, 0.72);
}

.system-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(8, 14, 26, 0.68);
  border: 1px solid var(--line);
}

.system-note__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 8px rgba(49, 199, 150, 0.08);
}

.system-note p {
  margin: 0;
  color: var(--muted-strong);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100vh - 48px);
}

.sidebar,
.main-shell {
  padding: 24px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.sidebar__top {
  display: grid;
  gap: 28px;
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  width: 100%;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
  text-align: left;
}

.nav-button.is-active {
  background: linear-gradient(180deg, rgba(86, 135, 255, 0.24), rgba(42, 74, 161, 0.18));
  border-color: rgba(90, 141, 255, 0.28);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-button[hidden] {
  display: none;
}

.sidebar__card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
}

.sidebar__card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.sidebar__card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(27, 42, 72, 0.82);
}

.main-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 4px;
}

.topbar h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 2.2rem;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill,
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(11, 19, 34, 0.78);
}

.status-pill {
  color: #b9c8ea;
  font-weight: 700;
}

.user-pill strong {
  display: block;
}

.user-pill span {
  color: var(--muted);
  font-size: 0.85rem;
}

.user-pill__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(96, 145, 255, 0.5), rgba(38, 63, 117, 0.82)),
    rgba(29, 44, 72, 0.92);
  font-weight: 800;
}

.view {
  display: none;
  gap: 22px;
  align-content: start;
}

.view.is-active {
  display: grid;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  padding: 32px;
  border-radius: 30px;
}

.hero-panel__content h3 {
  margin: 0 0 18px;
  max-width: 14ch;
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  line-height: 0.94;
}

.hero-panel__content p {
  max-width: 60ch;
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.8;
}

.hero-panel__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 29, 49, 0.92), rgba(10, 17, 28, 0.96));
  border: 1px solid rgba(133, 170, 255, 0.16);
}

.metric-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.metric-card strong {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 2vw, 2.6rem);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.section-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 2rem;
}

.section-header p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.7;
  text-align: right;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.content-grid--overview {
  align-items: start;
}

.content-grid--single-top {
  align-items: start;
}

.resource-list {
  display: grid;
  gap: 14px;
}

.resource-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(133, 170, 255, 0.14);
  text-align: left;
}

.resource-card.is-selected {
  border-color: rgba(90, 141, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(90, 141, 255, 0.24);
}

.resource-card__meta {
  display: grid;
  gap: 8px;
}

.resource-card__meta strong {
  font-family: var(--font-heading);
  font-size: 1.08rem;
}

.resource-card__meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.resource-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(24, 37, 61, 0.82);
  color: #cad6f0;
  font-size: 0.78rem;
  font-weight: 700;
}

.resource-tag--accent {
  background: rgba(90, 141, 255, 0.2);
  color: #d7e3ff;
}

.resource-tag--gold {
  background: rgba(245, 181, 68, 0.2);
  color: #ffe6ba;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-list--dense {
  gap: 12px;
}

.timeline-item {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(133, 170, 255, 0.14);
}

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

.timeline-item strong {
  font-family: var(--font-heading);
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.timeline-item time {
  color: var(--muted);
  font-size: 0.84rem;
}

.check-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted-strong);
  line-height: 1.7;
}

.check-list li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), #8fb0ff);
  box-shadow: 0 0 0 6px rgba(90, 141, 255, 0.12);
}

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 12px;
  z-index: 20;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 32, 0.96);
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 6px;
}

.toast p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.toast--success {
  border-color: rgba(49, 199, 150, 0.34);
}

.toast--error {
  border-color: rgba(255, 114, 114, 0.34);
}

.toast--info {
  border-color: rgba(90, 141, 255, 0.34);
}

.is-busy {
  opacity: 0.64;
  pointer-events: none;
}

.is-readonly .button--primary,
.is-readonly .button--danger,
.is-readonly .button--ghost[data-write],
.is-readonly .form-actions .button:not(.button--ghost) {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 1280px) {
  .auth-shell,
  .app-shell,
  .hero-panel,
  .content-grid,
  .visual-status-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: start;
  }

  .section-header p {
    text-align: left;
  }
}

@media (max-width: 980px) {
  .admin-stage {
    padding: 16px;
  }

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

  .sidebar {
    padding: 20px;
  }

  .nav-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .topbar__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .admin-stage {
    padding: 12px;
  }

  .auth-shell__visual,
  .auth-shell__panel,
  .sidebar,
  .main-shell,
  .panel-card,
  .hero-panel {
    padding: 22px;
  }

  .panel-card {
    padding: 22px;
  }

  .form-grid,
  .visual-orbit,
  .hero-panel__stats,
  .nav-stack {
    grid-template-columns: 1fr;
  }

  .orbit-card--primary {
    grid-column: auto;
  }

  .brand-mark h1 {
    font-size: 2.3rem;
  }

  .hero-panel__content h3 {
    font-size: 2.3rem;
  }

  .topbar h2,
  .section-header h3 {
    font-size: 1.6rem;
  }

  .button,
  .status-pill,
  .user-pill {
    width: 100%;
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
