:root {
  color-scheme: dark;
  --bg: #05040a;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.13);
  --text: #f6f1ff;
  --muted: rgba(246, 241, 255, 0.66);
  --soft: rgba(246, 241, 255, 0.45);
  --accent: #a855f7;
  --accent-strong: #c084fc;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 75% 10%, rgba(168, 85, 247, 0.18), transparent 28rem),
    linear-gradient(180deg, #080612, var(--bg));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.shell-narrow {
  width: min(560px, calc(100% - 32px));
}

.panel,
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.panel {
  border-radius: 18px;
  padding: clamp(28px, 5vw, 56px);
}

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

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(115deg, rgba(168, 85, 247, 0.14), transparent 60%);
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 820px;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
}

h2 {
  font-size: 1.15rem;
}

.lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

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

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 34px rgba(168, 85, 247, 0.32);
}

.button.secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.card,
.metric-card {
  border-radius: 14px;
  padding: 22px;
}

.card p,
.note {
  color: var(--muted);
  line-height: 1.7;
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
}

.note {
  margin: 22px 0 0;
  font-size: 0.92rem;
}

.alert {
  margin: 24px 0 0;
  border: 1px solid rgba(248, 113, 113, 0.38);
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
  padding: 13px 14px;
}

.alert ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.logout-form {
  margin-top: 28px;
}

.dashboard-hero .logout-form {
  margin-top: 0;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 44px);
}

.dashboard-hero .logout-form {
  position: absolute;
  top: clamp(28px, 4vw, 44px);
  right: clamp(28px, 4vw, 44px);
  z-index: 1;
}

.dashboard-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(115deg, rgba(168, 85, 247, 0.13), transparent 62%);
  pointer-events: none;
}

.dashboard-hero > * {
  position: relative;
}

.dashboard-hero-top {
  padding-right: 130px;
}

.dashboard-hero h1 {
  max-width: 920px;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 1.04;
}

.dashboard-hero .lead {
  margin-top: 18px;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}

.status-bar div,
.metric-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
}

.status-bar div {
  border-radius: 12px;
  padding: 14px;
}

.status-bar dt,
.metric-card p {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-bar dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.dashboard-section {
  margin-top: 28px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

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

.metric-card {
  min-height: 128px;
}

.metric-card strong {
  display: block;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.dashboard-grid {
  margin-top: 20px;
}

.module-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-nav a,
.admin-nav button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

.admin-nav a.is-active {
  border-color: rgba(192, 132, 252, 0.55);
  background: rgba(168, 85, 247, 0.16);
}

.admin-nav form {
  margin-left: auto;
}

.page-panel h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.table-wrap {
  margin-top: 28px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

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

.admin-table th {
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-table td strong,
.admin-table td span {
  display: block;
}

.admin-table td strong {
  color: var(--text);
  margin-bottom: 4px;
}

.status-pill {
  display: inline-flex;
  border: 1px solid rgba(192, 132, 252, 0.36);
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.12);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 10px;
}

.empty-state {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 28px;
}

.empty-state p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-form {
  max-width: 860px;
}

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

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

@media (max-width: 720px) {
  .shell {
    padding: 28px 0;
  }

  .dashboard-hero h1 {
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .dashboard-hero-top {
    padding-right: 0;
  }

  .dashboard-hero .logout-form {
    position: static;
    margin-top: 20px;
  }

  .status-bar,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-nav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .admin-nav form {
    margin-left: 0;
  }

  .page-header,
  .form-grid {
    display: grid;
  }

  .actions {
    flex-direction: column;
  }
}
