:root {
  --black: #000000;
  --white: #ffffff;
  --red: #c3102e;
  --navy: #002269;
  --grey-secondary: #595959;
  --grey-hairline: #262626;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--white);
  font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

h1, h2, h3, .btn, .badge, .brand-title {
  font-family: "Rajdhani", "Barlow", -apple-system, sans-serif;
  text-transform: uppercase;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--grey-hairline);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand img {
  width: 32px;
  height: 32px;
  display: block;
}
.topbar .brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.topbar .user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--grey-secondary);
}
.topbar form { margin: 0; }

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
}
.main-content {
  flex: 1;
  min-width: 0; /* lets the grid below shrink/scroll instead of blowing out the flex item */
}
@media (max-width: 900px) {
  .page-layout { flex-direction: column; }
}

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.center-page .card {
  max-width: 440px;
}
.center-page img.crest {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  display: block;
}
.center-page h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}
.center-page p {
  color: var(--grey-secondary);
  line-height: 1.7;
  margin: 0 0 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: none;
  padding: 13px 28px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: #a10d26; transform: translateY(-1px); }
.btn.secondary {
  background: transparent;
  border: 1px solid var(--grey-hairline);
  color: var(--white);
}
.btn.secondary:hover { background: #0a0a0a; }

.error-banner {
  background: rgba(195, 16, 46, 0.12);
  border: 1px solid var(--red);
  color: var(--white);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

h2.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.open { background: rgba(195, 16, 46, 0.18); color: #ff5c74; }
.badge.in-progress { background: rgba(0, 34, 105, 0.4); color: #7c9cf0; }
.badge.closed { background: rgba(89, 89, 89, 0.25); color: #a8a8a8; }

.empty-state {
  color: var(--grey-secondary);
  text-align: center;
  padding: 40px 0;
}

/* Left nav */
.nav-sidebar {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 24px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--grey-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-link .icon { font-size: 1rem; }
.nav-link:hover { background: #0a0a0a; color: var(--white); }
.nav-link.active {
  background: rgba(195, 16, 46, 0.12);
  color: var(--white);
  font-weight: 600;
}

.page-subtitle {
  color: var(--grey-secondary);
  font-size: 0.88rem;
  margin: -8px 0 24px;
}

/* Data grid — a spreadsheet-style table shared by suggestions/invites/xp: one CSS grid
   container, each row is a <form> or <div> with display:contents so its cells become direct
   grid items and stay column-aligned with every other row. Each page sets its own
   grid-template-columns on the specific class below. */
.data-grid {
  display: grid;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 40px;
}
.data-grid .grid-header,
.data-grid .grid-row {
  display: contents;
}
.data-grid .grid-header > div {
  background: #0a0a0a;
  padding: 12px 14px;
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--grey-secondary);
  border-bottom: 1px solid var(--grey-hairline);
}
.data-grid .grid-row > div {
  padding: 12px 14px;
  border-bottom: 1px solid var(--grey-hairline);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  min-width: 0;
}
.data-grid .grid-row:last-child > div { border-bottom: none; }
.data-grid .grid-row.add-row > div {
  background: rgba(195, 16, 46, 0.05);
  border-bottom: 1px solid var(--grey-hairline);
}
.data-grid .cell-title { font-weight: 600; }
.data-grid .cell-title a { text-decoration: none; }
.data-grid .cell-title a:hover { text-decoration: underline; }
.data-grid .cell-description,
.data-grid .cell-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-grid .cell-meta {
  color: var(--grey-secondary);
  font-size: 0.78rem;
}
.data-grid input[type="text"] {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--grey-hairline);
  color: var(--white);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: "Barlow", sans-serif;
  font-size: 0.88rem;
}
.data-grid .status-form,
.data-grid .add-row {
  display: contents;
}
.data-grid select {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--grey-hairline);
  color: var(--white);
  border-radius: 6px;
  padding: 7px 8px;
  font-family: "Barlow", sans-serif;
  font-size: 0.82rem;
}
.data-grid .add-row .btn {
  padding: 8px 16px;
  font-size: 0.78rem;
  width: 100%;
}

.invites-grid { grid-template-columns: 1fr 90px 1fr 1fr; }
.xp-grid { grid-template-columns: 44px minmax(120px, 1fr) 110px 100px 90px 100px 90px 90px; }

/* Suggestions — tiles, not a grid, specifically so long descriptions get to wrap and stay
   fully readable instead of being truncated to fit a fixed-height row. */
.suggestion-form {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 32px;
}
.suggestion-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-secondary);
  margin-bottom: 6px;
}
.suggestion-form input[type="text"],
.suggestion-form textarea {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--grey-hairline);
  color: var(--white);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: "Barlow", sans-serif;
  font-size: 0.95rem;
  margin-bottom: 16px;
  resize: vertical;
}
.suggestion-form textarea { min-height: 90px; }

.suggestion-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.suggestion-tile {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.tile-header h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  font-family: "Barlow", sans-serif;
}
.tile-description {
  color: #d4d4d4;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0 0 14px;
  flex: 1;
}
.tile-meta {
  color: var(--grey-secondary);
  font-size: 0.76rem;
  margin-bottom: 14px;
}
.tile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--grey-hairline);
}
.tile-actions select {
  background: var(--black);
  border: 1px solid var(--grey-hairline);
  color: var(--white);
  border-radius: 6px;
  padding: 7px 8px;
  font-family: "Barlow", sans-serif;
  font-size: 0.82rem;
}
.tile-actions .btn-discuss { margin-left: auto; }

.data-grid .cell-actions { gap: 8px; }

.btn-discuss {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--grey-hairline);
  color: var(--white);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn-discuss:hover { background: rgba(0, 34, 105, 0.35); border-color: var(--navy); }

.btn-delete {
  background: transparent;
  border: 1px solid var(--grey-hairline);
  color: #ff5c74;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.btn-delete:hover { background: rgba(195, 16, 46, 0.12); border-color: var(--red); }

/* Suggestion detail / discussion page */
.back-link {
  display: inline-block;
  color: var(--grey-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--white); }
.detail-card {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  padding: 24px;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
  margin: 0;
}
.detail-meta {
  color: var(--grey-secondary);
  font-size: 0.8rem;
  margin: 8px 0 18px;
}
.detail-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #d4d4d4;
  white-space: pre-wrap;
  margin: 0 0 20px;
}
.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--grey-hairline);
}
.detail-actions select { min-width: 140px; }

.comment-form {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 24px;
}
.comment-form textarea {
  width: 100%;
  min-height: 80px;
  background: var(--black);
  border: 1px solid var(--grey-hairline);
  color: var(--white);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: "Barlow", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 12px;
  resize: vertical;
}
.image-preview {
  display: block;
  max-width: 240px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid var(--grey-hairline);
  margin-bottom: 12px;
}

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--grey-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid var(--grey-hairline);
  border-radius: 6px;
  padding: 10px 14px;
}
.file-input-label:hover { color: var(--white); border-color: var(--white); }
.file-input-label input[type="file"] { display: none; }

.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 8px;
  padding: 14px 16px;
}
.comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--grey-secondary);
  margin-bottom: 6px;
}
.comment-meta strong { color: var(--white); font-weight: 600; }
.comment-body {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #d4d4d4;
  white-space: pre-wrap;
}
.comment-image {
  display: block;
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  border: 1px solid var(--grey-hairline);
}

.online-widget {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.online-member {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
}
.online-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
}
.online-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #0a0a0a;
  position: absolute;
  left: 22px;
  top: 20px;
}
.online-status.online { background: #3ba55d; }
.online-status.idle { background: #faa61a; }
.online-status.dnd { background: #ed4245; }
.online-name { font-size: 0.82rem; }

.member-event-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--grey-hairline);
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 36px;
}
.member-event {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0a0a0a;
  padding: 10px 16px;
  font-size: 0.85rem;
}
.event-icon {
  width: 20px;
  text-align: center;
  font-weight: 700;
}
.event-icon.join { color: #3ba55d; }
.event-icon.leave { color: #ff5c74; }
.event-username { font-weight: 600; }
.event-type-label { color: var(--grey-secondary); }
.event-time {
  margin-left: auto;
  color: var(--grey-secondary);
  font-size: 0.78rem;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--grey-hairline);
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  overflow: hidden;
}
.audit-entry {
  background: #0a0a0a;
  padding: 12px 16px;
}
.audit-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.audit-action { font-weight: 600; }
.audit-detail {
  color: #d4d4d4;
  font-size: 0.85rem;
  font-family: "Barlow", monospace;
}
.audit-by { color: var(--grey-secondary); font-size: 0.85rem; }
.audit-reason {
  color: #d4d4d4;
  font-size: 0.82rem;
  font-style: italic;
  margin-top: 4px;
}
.audit-time {
  color: var(--grey-secondary);
  font-size: 0.75rem;
  margin-top: 6px;
}

/* Discord Statistics page */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.stat-card {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  padding: 18px;
}
.stat-value {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
}
.stat-label {
  color: var(--grey-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.growth-chart {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  padding: 16px;
}
.growth-chart svg { display: block; }

/* Assets library */
.asset-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.asset-tile {
  background: #0a0a0a;
  border: 1px solid var(--grey-hairline);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.asset-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  background: #050505;
  border-bottom: 1px solid var(--grey-hairline);
}
.asset-preview img {
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
}
.asset-icon { font-size: 2.8rem; }
.asset-info { padding: 12px 14px; flex: 1; }
.asset-filename {
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-description {
  color: #d4d4d4;
  font-size: 0.8rem;
  margin-top: 4px;
}
.asset-meta {
  color: var(--grey-secondary);
  font-size: 0.72rem;
  margin-top: 8px;
}
.asset-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--grey-hairline);
}
.asset-actions .btn-discuss { flex: 1; text-align: center; justify-content: center; }
