:root {
  --bg: #0c1320;
  --bg-deep: #151528;
  --sidebar: #17172a;
  --panel: rgba(20, 29, 43, 0.92);
  --panel-strong: #101827;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --ink: #f7f7fb;
  --muted: #a7adba;
  --line: rgba(255, 255, 255, 0.105);
  --line-strong: rgba(255, 255, 255, 0.18);
  --red: #d72b35;
  --red-dark: #a91f2a;
  --blue: #4c8df0;
  --green: #13c463;
  --green-dark: #0a8f48;
  --amber: #f0b84c;
  --violet: #9b7cff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(18, 20, 42, 0.96) 0%, rgba(11, 18, 30, 0.94) 48%, rgba(0, 119, 58, 0.68) 100%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 44%, #101528 100%);
  font-family: "Segoe UI", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 86px 86px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 82%);
}

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

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(21, 21, 40, 0.92);
  backdrop-filter: blur(14px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  box-shadow: 12px 0 38px rgba(0, 0, 0, 0.16);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: 0 0 22px rgba(19, 196, 99, 0.18);
  overflow: hidden;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.38));
}

.back-link {
  width: fit-content;
  margin: 0 0 28px 54px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.back-link:hover {
  color: var(--green);
}

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

.boards::before {
  content: "Board";
  margin: 0 0 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.board-button,
.admin-nav button,
.side-nav button {
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #dce1ea;
  text-align: left;
  padding: 7px 9px;
  font-size: 15px;
  font-weight: 800;
}

.board-button,
.side-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.board-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.board-label > span:last-child {
  line-height: 1;
}

.board-icon {
  flex: 0 0 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.board-button b {
  min-width: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfd6e2;
  padding: 2px 7px;
  text-align: center;
  font-size: 12px;
}

.board-button:hover,
.board-button.active,
.admin-nav button:hover,
.admin-nav button.active,
.side-nav button:hover {
  border-color: rgba(19, 196, 99, 0.34);
  background: linear-gradient(90deg, rgba(19, 196, 99, 0.18), rgba(255, 255, 255, 0.045));
  color: #ffffff;
}

.side-nav,
.admin-nav {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  align-self: start;
}

.user-card {
  align-self: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card span {
  color: var(--muted);
  font-size: 14px;
}

.auth-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.main {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 48px) 42px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(115deg, rgba(20, 22, 43, 0.95) 0%, rgba(16, 27, 43, 0.88) 54%, rgba(6, 125, 64, 0.62) 100%),
    var(--panel-strong);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 76px 76px;
  opacity: 0.55;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.topbar h1,
.modal-head h2 {
  margin: 0;
  line-height: 1.05;
}

.topbar h1 {
  max-width: 680px;
  font-size: clamp(28px, 4.1vw, 46px);
  font-weight: 950;
  line-height: 0.96;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.38);
}

.topbar p {
  max-width: 700px;
  margin: 10px 0 0;
  color: #cbd2df;
  font-size: 16px;
}

.top-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.search input {
  width: min(360px, 52vw);
}

.primary,
.secondary,
.danger,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 900;
}

.primary {
  border-color: rgba(19, 196, 99, 0.65);
  background: linear-gradient(180deg, #20d870 0%, var(--green) 100%);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(19, 196, 99, 0.28);
}

.primary:hover {
  border-color: rgba(19, 196, 99, 0.9);
  background: linear-gradient(180deg, #25e779 0%, var(--green-dark) 100%);
}

.secondary {
  background: rgba(255, 255, 255, 0.075);
  color: #f5f7fb;
}

.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.12);
}

.discord-login {
  white-space: nowrap;
  border-color: rgba(88, 101, 242, 0.88);
  background: linear-gradient(180deg, #6f7dff 0%, #5865f2 52%, #4752c4 100%);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(88, 101, 242, 0.34);
}

.discord-login:hover {
  border-color: rgba(111, 125, 255, 0.96);
  background: linear-gradient(180deg, #8590ff 0%, #6571f6 52%, #5865f2 100%);
}

.discord-login__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.discord-login__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.secondary.blue {
  border-color: rgba(76, 141, 240, 0.36);
  color: #dce9ff;
  background: rgba(76, 141, 240, 0.14);
}

.secondary.green {
  border-color: rgba(19, 196, 99, 0.36);
  color: #d9ffe8;
  background: rgba(19, 196, 99, 0.14);
}

.danger {
  border-color: rgba(215, 43, 53, 0.55);
  background: rgba(215, 43, 53, 0.13);
  color: #ffdce0;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.view {
  display: none;
  gap: 14px;
}

.view.active {
  display: grid;
}

.filters {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 24, 0.82);
  color: var(--ink);
  padding: 0 11px;
}

select {
  color-scheme: dark;
}

textarea {
  padding: 10px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #747d8f;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(19, 196, 99, 0.34);
  outline-offset: 2px;
}

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

.post,
.roadmap-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.post {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.post:hover {
  transform: translateY(-1px);
  border-color: rgba(19, 196, 99, 0.34);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.vote {
  border: none;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: #ffffff;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 0;
  font-weight: 950;
  font-size: 19px;
  line-height: 1;
  min-height: 112px;
}

.vote.active {
  background: rgba(19, 196, 99, 0.16);
  box-shadow: inset 0 0 0 1px rgba(19, 196, 99, 0.42);
}

.vote span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vote-arrow {
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--green);
  border-left: 2px solid var(--green);
  transform: rotate(45deg);
}

.post-main {
  min-width: 0;
  padding: 17px 18px;
  display: grid;
  gap: 6px;
  align-content: center;
}

.post-category {
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.post h3 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.post h3 button,
.roadmap-card button {
  all: unset;
  cursor: pointer;
}

.post h3 button:hover,
.roadmap-card button:hover {
  color: var(--green);
}

.post p {
  margin: 0;
  color: #c2cad8;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 6px;
}

.meta-owner-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.meta-owner-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-owner-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd3df;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status-published {
  color: #bde9ff;
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.35);
}

.status-under_review {
  color: #eadfff;
  background: rgba(155, 124, 255, 0.16);
  border-color: rgba(155, 124, 255, 0.36);
}

.status-planned {
  color: #dce9ff;
  background: rgba(76, 141, 240, 0.16);
  border-color: rgba(76, 141, 240, 0.36);
}

.status-in_progress {
  color: #ffdce0;
  background: rgba(215, 43, 53, 0.15);
  border-color: rgba(215, 43, 53, 0.35);
}

.status-in_test {
  color: #d7fff1;
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(20, 184, 166, 0.34);
}

.status-released {
  color: #d9ffe8;
  background: rgba(19, 196, 99, 0.16);
  border-color: rgba(19, 196, 99, 0.38);
}

.status-rejected,
.status-duplicate,
.status-archived,
.status-private {
  color: #ffdce0;
  background: rgba(215, 43, 53, 0.15);
  border-color: rgba(215, 43, 53, 0.34);
}

.priority {
  font-weight: 700;
}

.priority-p0 {
  color: #ffe2e2;
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.44);
}

.priority-p1 {
  color: #ffe7cf;
  background: rgba(234, 88, 12, 0.18);
  border-color: rgba(234, 88, 12, 0.42);
}

.priority-p2 {
  color: #fff3bf;
  background: rgba(202, 138, 4, 0.18);
  border-color: rgba(202, 138, 4, 0.42);
}

.priority-p3 {
  color: #dcfce7;
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(22, 163, 74, 0.42);
}

.priority-p4 {
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.42);
}

.assigned-staff {
  color: #dce9ff;
  background: rgba(76, 141, 240, 0.16);
  border-color: rgba(76, 141, 240, 0.36);
}

.creator-pill {
  color: #ffe8c2;
  background: rgba(240, 184, 76, 0.16);
  border-color: rgba(240, 184, 76, 0.36);
}

.unassigned-pill {
  color: #cbd3df;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.category-bug {
  --category-color: var(--red);
}

.category-idea {
  --category-color: var(--amber);
}

.post.category-bug,
.post.category-idea {
  border-left: 4px solid var(--category-color);
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.roadmap-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.roadmap-head {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  padding: 12px;
  font-weight: 950;
}

.roadmap-card {
  border-left: 4px solid var(--category-color, var(--blue));
  padding: 12px;
  display: grid;
  gap: 8px;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 16, 0.74);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(820px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #111a28;
  box-shadow: var(--shadow);
  padding: 14px 18px 16px;
  display: grid;
  gap: 10px;
}

.modal-panel.small {
  width: min(460px, calc(100vw - 32px));
}

.modal-panel.detail {
  width: min(920px, calc(100vw - 24px));
}

.modal-head {
  margin: -14px -18px 4px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #141f30;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  position: sticky;
  top: -14px;
  z-index: 2;
}

.modal-panel label,
.admin-edit label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.form-grid,
.admin-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.message {
  min-height: 20px;
  margin: 0;
  color: #ff7a85;
  font-weight: 800;
}

.detail-body {
  display: grid;
  gap: 12px;
}

.detail-post {
  box-shadow: none;
}

.copy {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #d7deea;
}

.detail-block {
  display: grid;
  gap: 8px;
}

.detail-image {
  display: block;
  width: min(78%, 720px);
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  object-fit: contain;
}

.image-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.comments {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.moderation-panel {
  border: 1px solid rgba(19, 196, 99, 0.28);
  border-radius: var(--radius);
  background: rgba(19, 196, 99, 0.08);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.moderation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.moderation-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.comment {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.comment.staff {
  background: rgba(19, 196, 99, 0.11);
  border-color: rgba(19, 196, 99, 0.32);
}

.comment.internal {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-strong);
}

.comment p {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-form textarea {
  min-height: 96px;
}

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

.summary article,
.table-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
}

.summary span,
.table-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.summary strong {
  display: block;
  color: #ffffff;
  font-size: 30px;
}

.table-list {
  display: grid;
  gap: 9px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 12px;
}

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

@media (max-width: 1040px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
  }

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

  .top-actions,
  .search,
  .search input,
  .primary,
  .secondary {
    width: 100%;
  }

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

  .boards::before {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 16px 12px 28px;
  }

  .topbar {
    padding: 20px 16px;
  }

  .topbar h1 {
    font-size: 27px;
  }

  .boards,
  .form-grid,
  .admin-edit,
  .moderation-grid,
  .summary,
  .table-row {
    grid-template-columns: 1fr;
  }

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

  .vote {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    grid-auto-flow: column;
    justify-content: start;
    padding: 12px 16px;
  }
}
