:root {
  --navy: #071724;
  --navy-2: #0c2638;
  --ink: #10202e;
  --gold: #d5a650;
  --gold-soft: #f2d895;
  --white: #f8fbfc;
  --muted: #9fb2c0;
  --line: rgba(213, 166, 80, 0.28);
  --danger: #c84b4b;
  --ok: #4ca37a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(213, 166, 80, 0.16), transparent 34rem),
    linear-gradient(135deg, #04101a 0%, #071724 52%, #101923 100%);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 16, 26, 0.88);
  backdrop-filter: blur(18px);
}

.app-shell.is-locked {
  display: none;
}

.login-gate {
  width: min(1180px, calc(100% - 2rem));
  min-height: calc(100vh - 5rem);
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 3rem 0;
}

.login-gate.is-hidden {
  display: none;
}

.login-panel {
  width: min(42rem, 100%);
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(8, 28, 42, 0.88);
  box-shadow: var(--shadow);
}

.login-panel img {
  width: 7rem;
  height: 7rem;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.34));
}

.login-panel h1 {
  font-size: clamp(2.2rem, 7vw, 4.3rem);
}

.login-panel p:not(.eyebrow) {
  margin: 0;
  color: #d6e2ea;
  line-height: 1.65;
}

.brand,
.topnav,
.hero-actions,
.form-footer,
.dashboard-tools,
.role-form {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.8rem;
  min-width: 13rem;
}

.brand img {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(213, 166, 80, 0.24));
}

.brand p,
.brand span,
.eyebrow,
.section-heading p {
  margin: 0;
}

.brand p {
  font-weight: 800;
  color: var(--gold-soft);
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.topnav {
  gap: 0.8rem;
  color: #d7e0e7;
  font-size: 0.94rem;
}

.topnav a {
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.07);
}

.discord-button,
.submit-button,
.primary-link,
.secondary-link {
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  color: var(--white);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.discord-button,
.secondary-link {
  background: rgba(255, 255, 255, 0.06);
}

.discord-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.discord-button.large {
  min-width: 10rem;
  justify-content: center;
}

.discord-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #5865f2;
  box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.18);
}

.primary-link,
.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #edc775, #b7832e);
  color: #071724;
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(213, 166, 80, 0.24);
}

.secondary-link {
  display: inline-flex;
  align-items: center;
}

.discord-button:hover,
.submit-button:hover,
.primary-link:hover,
.secondary-link:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 216, 149, 0.72);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding: 4rem 0 3rem;
}

.hero-copy {
  max-width: 45rem;
}

.eyebrow,
.section-heading p {
  color: var(--gold-soft);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0.4rem 0 1rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(3rem, 9vw, 6.8rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.hero-copy > p:not(.eyebrow) {
  max-width: 42rem;
  margin: 0 0 1.6rem;
  color: #d6e2ea;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.65;
}

.hero-actions {
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-emblem {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.hero-emblem::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: rgba(213, 166, 80, 0.1);
  box-shadow: var(--shadow);
}

.hero-emblem img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 30px 45px rgba(0, 0, 0, 0.42));
}

.workspace {
  margin: 0 0 2rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  background: rgba(8, 28, 42, 0.78);
  box-shadow: var(--shadow);
}

.section-heading {
  margin-bottom: 1.4rem;
}

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

label {
  display: grid;
  gap: 0.45rem;
  color: #dbe6ed;
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.45rem;
  background: rgba(2, 12, 20, 0.68);
  color: var(--white);
  padding: 0.85rem 0.9rem;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 9rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(213, 166, 80, 0.12);
}

.form-footer {
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.form-footer p {
  max-width: 46rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.access-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(213, 166, 80, 0.08);
}

.access-panel strong,
.access-panel span {
  display: block;
}

.access-panel span {
  margin-top: 0.3rem;
  color: var(--muted);
}

.dashboard {
  margin-top: 1rem;
}

.dashboard.is-locked {
  display: none;
}

.role-manager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem);
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.055);
}

.role-manager h3 {
  margin: 0.35rem 0 0.35rem;
  font-size: 1.25rem;
}

.role-manager span {
  color: var(--muted);
}

.role-form {
  align-items: end;
  gap: 0.75rem;
}

.role-form label {
  flex: 1 1 auto;
}

.role-form .secondary-link {
  min-width: 7rem;
  white-space: nowrap;
}

.role-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.role-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(2, 12, 20, 0.42);
  color: #e8eff3;
  font-size: 0.9rem;
  font-weight: 700;
}

.role-check input {
  width: auto;
  accent-color: var(--gold);
}

.dashboard-tools {
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.dashboard-tools label {
  flex: 1 1 14rem;
}

.dashboard-tools .search-field {
  flex: 2 1 20rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stats-grid div {
  min-height: 6rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.055);
}

.stats-grid span {
  display: block;
  color: var(--gold-soft);
  font-size: 2rem;
  font-weight: 900;
}

.stats-grid p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.reports-list {
  display: grid;
  gap: 0.85rem;
}

.report-card {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-left: 4px solid var(--gold);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.055);
  padding: 1rem;
}

.report-card.critical {
  border-left-color: var(--danger);
}

.report-card.establishment {
  border-left-color: var(--ok);
}

.report-card.establishment.critical {
  border-left-color: var(--danger);
}

.report-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.report-top h3 {
  margin: 0;
  font-size: 1.08rem;
}

.report-meta,
.report-details {
  color: var(--muted);
  line-height: 1.55;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #e8eff3;
  font-size: 0.84rem;
}

.type-pill {
  border-color: rgba(213, 166, 80, 0.36);
  background: rgba(213, 166, 80, 0.13);
  color: var(--gold-soft);
}

.status-select {
  min-width: 9rem;
}

.empty-state {
  padding: 1.3rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(28rem, calc(100% - 2rem));
  transform: translateY(1rem);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #081c2a;
  color: var(--white);
  box-shadow: var(--shadow);
  padding: 0.95rem 1rem;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .topbar,
  .access-panel,
  .report-top {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 0.45rem;
    font-size: 0.82rem;
  }

  .topnav a,
  .topnav .discord-button,
  .access-panel .discord-button {
    justify-content: center;
    width: 100%;
    min-height: 2.45rem;
    padding-inline: 0.45rem;
    text-align: center;
    line-height: 1.12;
    white-space: normal;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 2rem;
  }

  .hero-emblem {
    max-width: 22rem;
    margin: 0 auto;
  }

  .report-form,
  .stats-grid,
  .role-manager {
    grid-template-columns: 1fr;
  }

  .role-form {
    align-items: stretch;
    flex-direction: column;
  }
}
