:root {
  --void: #07080b;
  --surface: #11131a;
  --surface-2: #181b24;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f5f7;
  --muted: #9aa3b5;
  --red: #e51c2a;
  --red-soft: rgba(229, 28, 42, 0.16);
  --gold: #c9a227;
  --ok: #3dd68c;
  --warn: #f0b429;
  --danger: #ff6b7a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Barlow", system-ui, sans-serif;
  --display: "Barlow Condensed", "Barlow", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--void);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(229, 28, 42, 0.22), transparent 55%),
    radial-gradient(700px 420px at 95% 8%, rgba(201, 162, 39, 0.08), transparent 50%),
    linear-gradient(180deg, #0b0d12 0%, var(--void) 48%, #050607 100%);
  overflow: hidden;
}

.bg-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent 0,
      transparent 14px,
      rgba(255, 255, 255, 0.015) 14px,
      rgba(255, 255, 255, 0.015) 15px
    );
  pointer-events: none;
}

.bg-layer::after {
  content: "";
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  right: -18vmax;
  bottom: -22vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 28, 42, 0.12), transparent 65%);
  filter: blur(8px);
  animation: drift 18s var(--ease) infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4%, -3%) scale(1.06); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 72px;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(229, 28, 42, 0.35), rgba(229, 28, 42, 0.08)),
    var(--surface);
  border: 1px solid rgba(229, 28, 42, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(229, 28, 42, 0.15);
  margin-bottom: 18px;
}

.brand-mark--sm {
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 12px;
}

.brand-mark__arrow {
  width: 18px;
  height: 18px;
  background: var(--red);
  clip-path: polygon(0 35%, 58% 35%, 58% 0, 100% 50%, 58% 100%, 58% 65%, 0 65%);
  transform: rotate(-12deg);
}

.login-wrap {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
}

.login-stage {
  width: min(420px, 100%);
  padding: 36px 32px 32px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  animation: rise 0.55s var(--ease) both;
}

.login-title {
  margin: 6px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 3.4rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
}

.lede {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

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

.field {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(229, 28, 42, 0.7);
  box-shadow: 0 0 0 3px var(--red-soft);
}

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

button, .btn, .btn-primary, .btn-ghost {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), opacity 0.18s;
}

button:hover, .btn:hover, .btn-primary:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary,
button:not(.ghost):not(.btn-ghost):not(.ok):not(.warn) {
  background: linear-gradient(180deg, #f02836, var(--red));
  color: #fff;
  box-shadow: 0 10px 24px rgba(229, 28, 42, 0.28);
}

.tabs button:not(.active) {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn-block { width: 100%; }

.btn-ghost, button.ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: none;
}

button.ok { background: linear-gradient(180deg, #4ae09a, #2fbf74); color: #04140c; }
button.warn { background: linear-gradient(180deg, #ffd15c, var(--warn)); color: #1a1200; }

.error {
  color: var(--danger);
  margin: 12px 0 0;
  font-size: 0.92rem;
}

.shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  animation: rise 0.45s var(--ease) both;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.shell-title {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: rgba(17, 19, 26, 0.85);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  animation: rise 0.5s var(--ease) 0.05s both;
}

.tabs button {
  background: transparent;
  border: 0;
  color: var(--muted);
  box-shadow: none;
  padding: 10px 16px;
  font-weight: 600;
}

.tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transform: none;
}

.tabs button.active {
  background: var(--red-soft);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(229, 28, 42, 0.45);
}

.shell-main { animation: rise 0.55s var(--ease) 0.08s both; }

.panel { display: grid; gap: 16px; }

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 36%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.card h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--red);
  opacity: 0.85;
}

.stat span {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

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

.actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.foot-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}

.badge.pending { color: var(--warn); border-color: rgba(240, 180, 41, 0.35); }
.badge.accepted { color: var(--ok); border-color: rgba(61, 214, 140, 0.35); }
.badge.rejected { color: var(--danger); border-color: rgba(255, 107, 122, 0.35); }

.question-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 8px;
  background: var(--surface-2);
  margin-top: 12px;
}

.answers {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.answers b {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

a { color: #ff8a93; }
a:hover { color: #fff; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  color: #c9d0dd;
}

@media (max-width: 720px) {
  #app { padding: 18px 14px 56px; }
  .login-stage { padding: 28px 20px; }
  .tabs { border-radius: 18px; }
  .shell-title { font-size: 1.7rem; }
  table, thead, tbody, th, td, tr { display: block; }
  th { display: none; }
  td { border: 0; padding: 4px 0; }
  tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--surface-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
