:root {
  --red: #e2231a;
  --red-dark: #c81e16;
  --ink: #14141a;
  --muted: #666673;
  --line: #e8e8ee;
  --bg: #f7f7f9;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #111116;
  color: #fff;
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand small {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--red);
  font-weight: 800;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
}

nav a.active,
nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

main {
  padding: 36px;
  max-width: 1180px;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stats article,
.notice,
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
}

.stats strong {
  display: block;
  font-size: 30px;
}

.stats span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.notice {
  margin-top: 14px;
  background: #fff8f7;
  border-color: #ffd9d6;
}

.notice p {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-actions {
  display: grid;
  grid-template-columns: minmax(180px, 260px) max-content;
  gap: 10px;
  align-items: center;
}

.reply-form {
  display: grid;
  grid-template-columns: 1fr max-content max-content;
  gap: 10px;
  align-items: center;
}

.release-form {
  display: grid;
  grid-template-columns: 130px 140px 1fr 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.release-form textarea {
  grid-column: 1 / -2;
  min-height: 62px;
}

.version-list {
  display: grid;
  gap: 7px;
}

.version-row {
  display: grid;
  grid-template-columns: 100px 110px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
}

.reply-form textarea {
  grid-column: auto;
  min-height: 48px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.inline-check input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}

textarea {
  min-height: 94px;
  grid-column: 1 / -1;
  resize: vertical;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  padding: 11px 16px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  background: var(--red-dark);
}

.button.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.auth-page {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  max-width: 460px;
  padding: 0;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(20, 20, 26, 0.09);
}

.auth-brand {
  color: var(--ink);
  margin-bottom: 28px;
}

.auth-brand small {
  color: var(--muted);
}

.auth-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.form-error {
  color: #991b1b;
  background: #fee2e2;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
  font-size: 13px;
}

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

.item {
  display: grid;
  gap: 8px;
}

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

.badge {
  display: inline-flex;
  width: max-content;
  border-radius: 100px;
  padding: 4px 9px;
  background: #eef2ff;
  color: #263a8b;
  font-size: 12px;
  font-weight: 800;
}

.badge.open,
.badge.active {
  background: #dcfce7;
  color: #166534;
}

.badge.overdue,
.badge.revoked {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 820px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  main {
    padding: 20px;
  }

  .topbar,
  .section-head,
  .row {
    align-items: start;
    flex-direction: column;
  }

  .stats,
  .form-grid,
  .admin-actions,
  .reply-form,
  .release-form,
  .version-row {
    grid-template-columns: 1fr;
  }

  .release-form textarea {
    grid-column: auto;
  }
}
