/* Page-level layout: hero, listings, server detail, forms, auth.
   Depends on the tokens in site.css. */

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  isolation: isolate;
  padding: 34px 0 33px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    /* warm low sun, roughly where the mockup puts it */
    radial-gradient(46rem 22rem at 54% 78%, rgba(255, 140, 70, .14), transparent 70%),
    linear-gradient(160deg, rgba(58, 34, 84, .40) 0%, transparent 46%),
    /* keeps the copy legible and fades the photo into the page below */
    linear-gradient(to bottom, rgba(11, 15, 23, .26) 0%, rgba(11, 15, 23, .06) 34%, rgba(11, 15, 23, .55) 92%, var(--bg) 100%),
    linear-gradient(to right, rgba(11, 15, 23, .93) 0%, rgba(11, 15, 23, .80) 30%, rgba(11, 15, 23, .48) 58%, rgba(11, 15, 23, .72) 100%),
    url("/assets/img/hero-0793a1a1d0.webp") center bottom / cover no-repeat;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 514px;
  gap: 32px;
  align-items: start;
}

.hero-copy { max-width: 664px; padding-top: 30px; }
.hero h1 {
  font-size: 48px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero-sub {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin-top: 26px;
  padding: 6px 6px 6px 16px;
  background: rgba(10, 14, 24, .82);
  border: 1px solid var(--border);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-search-icon { width: 19px; height: 19px; color: var(--text-dim); flex: none; }
.hero-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  border: 0;
  background: none;
  font-size: 14.5px;
  color: #fff;
}
.hero-search-input::placeholder { color: var(--text-dim); }
.hero-search-input:focus { outline: none; }
.hero-search-input::-webkit-search-cancel-button { display: none; }
.hero-search-version {
  flex: none;
  width: auto;
  height: 38px;
  padding: 0 34px 0 14px;
  background-color: rgba(23, 28, 38, .9);
  border-color: var(--border-strong);
  border-radius: 6px;
  font-size: 14.5px;
  color: #fff;
}
.hero-search-btn { height: 38px; padding: 0 18px; font-size: 14px; border-radius: 6px; flex: none; }

.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.hero-tags .chip { height: 31px; padding: 0 11px; font-size: 13px; background: rgba(23, 28, 38, .85); }
.hero-tags .chip:hover { background: rgba(29, 35, 48, .95); }
.hero-tags .chip.is-active { background: var(--accent); color: #fff; }
.hero-tags .menu-panel { min-width: 170px; }

/* -------------------------------------------------------------- featured */

.featured { overflow: hidden; padding: 12px; }
.featured-banner {
  position: relative;
  display: block;
  aspect-ratio: 486 / 172;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
}
.featured-banner img { width: 100%; height: 100%; object-fit: cover; }
.featured-banner-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  background: linear-gradient(135deg, #2b1c3a, #4a2740 60%, #7a3b34);
  color: #fff; text-align: center; padding: 16px;
}
.featured-badge { position: absolute; top: 10px; left: 10px; z-index: 1; }

.featured-body { padding: 16px 10px 6px; }
.featured-title { display: flex; align-items: center; gap: 8px; }
.featured-title h2 { font-size: 21px; }
.featured-title .server-row-version { margin-left: auto; }
.featured-tagline {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.featured-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px; flex-wrap: wrap;
}

/* ------------------------------------------------------------ home grid */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 448px;
  gap: 32px;
  align-items: start;
  padding-top: 14px;
}
.home-side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 24px); }
.side-title { font-size: 17px; }
.side-title-row { margin-bottom: 4px; }

.stat-list { margin: 17px 0 0; display: grid; gap: 8px; }
.stat-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; line-height: 1.35; }
.stat-list dt { color: var(--text-muted); font-size: 13px; }
.stat-list dd { margin: 0; font-size: 15px; font-weight: 700; }

/* ---------------------------------------------------------- server list */

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

.server-row {
  display: grid;
  grid-template-columns: 48px 128px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 5px 20px 5px 14px;
  transition: border-color .12s, background-color .12s;
}
.server-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.server-row-rank {
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-dim);
}
/* Top three are picked out, gold-silver-bronze style but in the site palette. */
.server-list > .server-row:nth-child(1) .server-row-rank { color: #f0a13a; }
.server-list > .server-row:nth-child(2) .server-row-rank { color: #c3c8d2; }
.server-list > .server-row:nth-child(3) .server-row-rank { color: #d08a52; }

.server-row-icon { display: block; }
.server-icon {
  width: 56px; height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  image-rendering: pixelated;
}
.server-thumb {
  width: 128px; height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}
.server-row-body { min-width: 0; display: grid; gap: 5px; }
.server-row-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.server-row-title h3 { font-size: 15.5px; font-weight: 700; }
.server-row-title h3 a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-row-tagline {
  font-size: 12.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.server-row-version { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.server-row-meta {
  display: grid; gap: 22px; justify-items: end; align-content: space-between;
  height: 100%; padding: 12px 0;
}

/* --------------------------------------------------------- server cards */

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.server-card { display: flex; flex-direction: column; overflow: hidden; }
.server-card-banner {
  position: relative;
  display: block;
  aspect-ratio: 468 / 132;
  background: var(--surface-2);
  overflow: hidden;
}
.server-card-banner img { width: 100%; height: 100%; object-fit: cover; }
.server-card-banner-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center; padding: 12px; text-align: center;
  background: linear-gradient(135deg, #2b1c3a, #4a2740 60%, #7a3b34);
  color: #fff; font-weight: 700; font-size: 18px;
}
.server-card-body { display: grid; gap: 9px; padding: 16px 18px 18px; flex: 1; }
.server-card-body .server-row-version { margin-left: auto; }
.server-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: auto; padding-top: 4px; font-size: 14px;
}

/* -------------------------------------------------------------- reviews */

.review-list { margin-top: 18px; display: grid; gap: 22px; }
.review-list .review + .review { border-top: 1px solid var(--border); padding-top: 22px; }
.review { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.review-body { min-width: 0; display: grid; gap: 8px; }
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.review-author { font-weight: 700; font-size: 13.5px; }
.review-head time { font-size: 12.5px; white-space: nowrap; }
.review-text { font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }
.review-server {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--text-muted);
}
.review-server img { width: 24px; height: 24px; border-radius: 4px; image-rendering: pixelated; }

/* -------------------------------------------------------- listing page */

.page-head { padding: 34px 0 0; }
.page-head h1 { font-size: 32px; }
.page-head p { margin-top: 8px; color: var(--text-muted); font-size: 16px; }

.breadcrumb {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 22px 0 0;
  font-size: 14.5px; color: var(--text-muted);
}
.breadcrumb .icon { width: 16px; height: 16px; }

.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 22px 0 24px;
}
.filters .input, .filters .select { width: auto; height: 40px; }
.filters .search-field { position: relative; flex: 1 1 260px; min-width: 200px; }
.filters .search-field .input { width: 100%; padding-left: 40px; }
.filters .search-field .icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-dim); pointer-events: none;
}
.result-count { color: var(--text-muted); font-size: 14.5px; margin-left: auto; }

/* --------------------------------------------------------- server detail */

.server-hero { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 32px; padding: 20px 0 30px; }
.server-hero-banner {
  position: relative;
  aspect-ratio: 420 / 190;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
}
.server-hero-banner img { width: 100%; height: 100%; object-fit: cover; }
.server-hero-tags { margin-top: 14px; }
.server-hero-main { display: grid; gap: 12px; align-content: start; }
.server-hero-main .badge { justify-self: start; }
.server-hero-title { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.server-hero-title h1 { font-size: 33px; }
.server-hero-title .badge-verified { width: 22px; height: 22px; }
.server-hero-tagline { font-size: 15.5px; line-height: 1.6; color: var(--text-muted); max-width: 46ch; }
.server-hero-stats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.server-address { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text-muted); }
.server-address code { font-family: var(--mono); font-size: 14px; color: var(--text); }

.copy-btn { display: inline-flex; align-items: center; gap: 7px; }
.copy-btn.is-copied { color: var(--green); border-color: rgba(34,197,94,.4); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.detail-stack { display: grid; gap: 22px; }

.info-list { display: grid; gap: 0; margin: 16px 0 0; }
.info-list > div {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--text-muted); font-size: 14.5px; }
.info-list dd { margin: 0; font-size: 14.5px; font-weight: 600; text-align: right; }

.feature-list { display: grid; gap: 16px; margin-top: 20px; }
.feature { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 13px; }
.feature-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.feature-icon .icon { width: 17px; height: 17px; }
.feature h3 { font-size: 15px; }
.feature p { margin-top: 3px; font-size: 14px; line-height: 1.5; color: var(--text-muted); }

.prose { font-size: 15px; line-height: 1.7; color: var(--text-muted); }
.prose h2 { font-size: 21px; color: var(--text); margin: 28px 0 12px; }
.prose h3 { font-size: 17px; color: var(--text); margin: 22px 0 10px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.prose pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; overflow-x: auto; margin-bottom: 16px;
}
.prose pre code { background: none; padding: 0; }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.gallery a { scroll-snap-align: start; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

.rating-summary { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 6px 0 4px; }
.rating-score { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.rating-summary p { font-size: 13.5px; color: var(--text-muted); }

.review-compact { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-compact:last-child { border-bottom: 0; }
.review-compact .avatar { width: 34px; height: 34px; }
.review-compact-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-compact-head time { margin-left: auto; font-size: 13px; color: var(--text-dim); }

/* The reviews card on the detail page: score and call to action on the left,
   the reviews themselves on the right. */
.reviews-grid { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 30px; align-items: start; }
.reviews-summary { display: grid; justify-items: center; gap: 16px; }
.reviews-all { display: block; margin-top: 14px; text-align: center; }
.review-form { display: grid; gap: 16px; }

/* ---------------------------------------------------------------- forms */

.form-page { max-width: 620px; margin: 44px auto 0; }
.form-page h1 { font-size: 28px; }
.form-page > p { margin-top: 10px; color: var(--text-muted); }
.form-card { margin-top: 26px; display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 4px; }

.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-picker label {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: 6px; background: var(--surface-2);
  border: 1px solid transparent;
  font-size: 14px; color: var(--text-muted); cursor: pointer;
}
.tag-picker input { position: absolute; opacity: 0; pointer-events: none; }
.tag-picker label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-picker label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Star input for writing a review. Rendered as radios so it works without JS. */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { cursor: pointer; color: var(--surface-3); line-height: 0; }
.star-input label .icon { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--accent); }

/* ----------------------------------------------------------------- auth */

.auth-page { max-width: 420px; margin: 72px auto; }
.auth-card { padding: 30px; display: grid; gap: 20px; }
.auth-head { text-align: center; display: grid; gap: 8px; }
.auth-head h1 { font-size: 24px; }
.auth-head p { color: var(--text-muted); font-size: 14.5px; }
.auth-divider {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
  color: var(--text-dim); font-size: 13px;
}
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--border); }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; color: #fff; }
.auth-legal { font-size: 12.5px; color: var(--text-dim); text-align: center; line-height: 1.6; }
.auth-legal a { color: var(--text-muted); text-decoration: underline; }

/* --------------------------------------------------- tag index & reviews */

/* /tags and /reviews put content straight under the page head. On the listing
   page the filter bar supplies this gap instead. */
.page-head + .server-grid, .page-head + .card { margin-top: 24px; }

.tag-tile h2 { font-size: 17px; }
.tag-tile:hover { background: var(--surface-2); border-color: var(--border-strong); color: inherit; }

/* -------------------------------------------------------------- account */

.account-server {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}
.account-server-body { min-width: 0; display: grid; gap: 5px; }
.account-server-body p { font-size: 13.5px; }
.account-server-actions { display: flex; align-items: center; gap: 12px; }
/* A listing that is live reads as the same green as an online server. */
.badge-live { background: rgba(34, 197, 94, .15); color: var(--green); }

@media (max-width: 700px) {
  .account-server { grid-template-columns: 48px minmax(0, 1fr); padding: 14px; }
  .account-server-actions { grid-column: 1 / -1; justify-content: space-between; }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .hero-grid, .home-grid { grid-template-columns: minmax(0, 1fr) 400px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .server-hero { grid-template-columns: 360px minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .hero-grid, .home-grid, .detail-grid, .server-hero { grid-template-columns: minmax(0, 1fr); }
  .home-side { position: static; }
  .hero { padding: 30px 0 32px; }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: 40px; }
  .featured { max-width: 560px; }
  .server-hero-banner { max-width: 560px; }
}

@media (max-width: 700px) {
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-sub br { display: none; }
  .hero-search { flex-wrap: wrap; padding: 10px; gap: 8px; }
  .hero-search-icon { display: none; }
  .hero-search-input { flex: 1 1 100%; padding: 0 12px; background: var(--surface-2); border-radius: 6px; }
  .hero-search-version { flex: 1 1 auto; }
  .server-row {
    grid-template-columns: 30px 92px minmax(0, 1fr);
    gap: 12px; padding: 14px;
  }
  .server-icon { width: 48px; height: 48px; }
  .server-thumb { width: 92px; height: 46px; }
  .server-row-meta {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-items: start; justify-content: space-between;
    gap: 12px; height: auto; width: 100%;
    padding-top: 4px;
  }
  .form-row { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 25px; }
  .server-hero-title h1 { font-size: 26px; }
  .result-count { margin-left: 0; flex-basis: 100%; }
  .reviews-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

/* ------------------------------------------------ documents & knowledge base */

.doc-page { max-width: 760px; margin-inline: auto; }
.doc-page .card { margin-top: 24px; }
.doc-page .prose > :first-child { margin-top: 0; }
.doc-page .prose > :last-child { margin-bottom: 0; }
.doc-page .prose .btn { text-decoration: none; color: #fff; }

.wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.wiki-card { display: grid; gap: 10px; align-content: start; }
.wiki-card h2 { font-size: 17px; }
.wiki-card p { font-size: 14.5px; line-height: 1.55; color: var(--text-muted); }
.wiki-card .card-link { display: inline-flex; align-items: center; gap: 5px; justify-self: start; }
.wiki-card .card-link .icon { width: 15px; height: 15px; }

/* Native file inputs need their own metrics; .input is sized for a text row. */
.input[type="file"] { height: auto; padding: 8px 10px; font-size: 14px; }
.input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.input[type="file"]::file-selector-button:hover { background: var(--border-strong); }

/* --- admin --- */
/* The admin area replaces the public chrome with a persistent sidebar. The
   header and footer are still rendered by layout.php and hidden here, which
   keeps every page on one shell. */

body.admin .site-header,
body.admin .site-footer { display: none; }

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

.admin-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 18px 14px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.admin-brand { margin: 6px 8px 0; gap: 10px; }
.admin-brand img { width: 36px; height: 36px; border-radius: 8px; }
.admin-brand .brand-name { font-size: 19px; }

.admin-nav-groups { display: grid; gap: 6px; }
.admin-nav-label {
  padding: 14px 12px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-dim);
}
.admin-nav { display: grid; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 500;
  color: var(--text-muted);
  transition: background-color .12s, color .12s;
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.is-active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.admin-nav a.is-active .icon { color: var(--accent-text); }
.admin-nav .icon { width: 18px; height: 18px; }

.admin-user {
  margin-top: auto;
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 11px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.admin-user:hover { background: var(--surface-2); color: inherit; }
.admin-user-avatar { width: 34px; height: 34px; border-radius: 7px; }
.admin-user-id { display: grid; min-width: 0; }
.admin-user-name { font-size: 14px; font-weight: 600; }
.admin-user-mail { font-size: 12px; color: var(--text-dim); }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 18px 26px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.admin-topbar h1 { font-size: 24px; margin-right: auto; }
.admin-body { padding: 22px 26px 56px; display: grid; gap: 20px; align-content: start; }

/* stat cards */

.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; padding: 18px 20px; overflow: hidden; }
.stat-card h2 { font-size: 13.5px; font-weight: 500; color: var(--text-muted); }
.stat-card-value { margin-top: 8px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.admin-delta { margin-top: 10px; font-size: 12.5px; color: var(--green); }
.admin-delta.is-down { color: var(--accent-text); }
.stat-card-icon { position: absolute; right: 18px; bottom: 34px; color: var(--surface-3); }
.stat-card-icon .icon { width: 34px; height: 34px; }

/* card grids */

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.admin-grid-chart { grid-template-columns: minmax(0, 1fr) 340px; }
.admin-grid-edit { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }

.admin-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 16px 20px;
}
.admin-card-head h2 { font-size: 17px; }
.admin-card-body { padding: 0 20px 18px; }
.admin-note { font-size: 13px; line-height: 1.55; margin-top: 12px; }
.admin-side-stack { display: grid; gap: 20px; }

.admin-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-filters .input, .admin-filters .select { width: auto; height: 36px; font-size: 14px; }
.admin-range { display: flex; }
.admin-range .select { width: auto; height: 34px; font-size: 13.5px; padding-right: 34px; }

/* players chart */

.admin-chart { width: 100%; height: auto; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-tick { fill: var(--text-dim); font-size: 11px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.chart-stop-top { stop-color: var(--accent); stop-opacity: .40; }
.chart-stop-bottom { stop-color: var(--accent); stop-opacity: .02; }

/* ranked lists */

.admin-rank { display: grid; }
.admin-rank-row {
  display: grid; grid-template-columns: 18px 32px minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.admin-rank-wide .admin-rank-row { grid-template-columns: 18px 32px minmax(0, 1fr) auto 64px; }
.admin-rank-wide .admin-rank-row b { text-align: right; }
.admin-rank-row:last-child { border-bottom: 0; }
.admin-rank-row .server-icon { width: 32px; height: 32px; border-radius: 5px; }
.admin-rank-n { font-size: 13.5px; font-weight: 700; color: var(--text-dim); text-align: center; }
.admin-rank-row:nth-child(1) .admin-rank-n { color: #f0a13a; }
.admin-rank-row:nth-child(2) .admin-rank-n { color: #c3c8d2; }
.admin-rank-row:nth-child(3) .admin-rank-n { color: #d08a52; }
.admin-rank-note { font-size: 12.5px; white-space: nowrap; }

/* dashboard reviews and server rows */

.admin-review {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.admin-review:last-child { border-bottom: 0; }
.admin-review .avatar { width: 34px; height: 34px; border-radius: 7px; }
.admin-review-body { min-width: 0; display: grid; gap: 3px; }
.admin-review-head { display: flex; align-items: center; gap: 10px; }
.admin-review-author { font-size: 14.5px; font-weight: 600; }
.admin-review-head .stars { margin-right: auto; }
.admin-review-head .stars .star, .admin-review-head .stars .star svg { width: 14px; height: 14px; }
.admin-review-head time { font-size: 12.5px; white-space: nowrap; }
.admin-review-server { font-size: 13px; color: var(--text-muted); }
.admin-review-text { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }

.admin-srv-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.admin-srv-row:last-child { border-bottom: 0; }
.admin-srv-row .server-icon { width: 38px; height: 38px; }
.admin-srv-id { min-width: 0; display: grid; }
.admin-srv-name { font-size: 14.5px; font-weight: 600; }
.admin-srv-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.admin-srv-host { font-size: 12.5px; color: var(--text-dim); }
.admin-srv-players { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); font-weight: 600; }
.admin-srv-players.is-online { color: var(--green); }

/* reports */

.admin-report {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 13px;
  padding: 15px 0; border-bottom: 1px solid var(--border);
}
.admin-report:last-child { border-bottom: 0; }
.admin-report-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 7px;
  background: var(--accent); color: #fff;
}
.admin-report-icon .icon { width: 17px; height: 17px; }
.admin-report-body { min-width: 0; }
.admin-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-report-title { font-size: 14.5px; font-weight: 600; }
.admin-report-sub { margin-top: 3px; font-size: 13px; color: var(--text-muted); }
.admin-report-detail { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.admin-report-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 8px; font-size: 13px; color: var(--text-dim);
}

/* key/value diagnostics lists */

.admin-kv { display: grid; margin: 0; }
.admin-kv > div {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.admin-kv > div:last-child { border-bottom: 0; }
.admin-kv dt { color: var(--text-muted); flex: none; }
.admin-kv dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; }

/* tables */

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  padding: 0 14px 10px;
  text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim);
}
.admin-table td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-table .badge + .badge { margin-left: 6px; }
.admin-cell-server { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-cell-server .server-icon { width: 34px; height: 34px; border-radius: 5px; }
.admin-cell-body { max-width: 320px; font-size: 13.5px; color: var(--text-muted); }
.admin-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.admin-table td:last-child, .admin-table .player-count { white-space: nowrap; }
.admin-actions.is-left { justify-content: flex-start; flex-wrap: wrap; margin-top: 10px; }

.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; font-weight: 600; border-radius: 5px; }
.btn-xs .icon { width: 14px; height: 14px; }

.badge-ok { background: rgba(34, 197, 94, .15); color: #4ade80; }
.badge-danger { background: rgba(248, 113, 113, .15); color: #fca5a5; }

/* forms and logs */

.admin-form { display: grid; gap: 18px; align-content: start; }
.admin-form hr { margin: 2px 0; }

.admin-log {
  margin: 12px 0 0;
  padding: 14px 16px;
  max-height: 520px; overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 1240px) {
  .admin-grid-chart, .admin-grid-edit { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1040px) {
  .admin-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side {
    position: static; height: auto;
    flex-direction: row; align-items: center; gap: 14px;
    padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .admin-brand { margin: 0; }
  .admin-brand .brand-name { display: none; }
  .admin-nav-groups { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
  .admin-nav-label { display: none; }
  .admin-nav { grid-auto-flow: column; }
  .admin-nav a { white-space: nowrap; }
  .admin-user { margin: 0 0 0 auto; grid-template-columns: 34px; }
  .admin-user-id { display: none; }
  .admin-topbar { padding: 14px 18px; }
  .admin-topbar h1 { font-size: 20px; }
  .admin-body { padding: 18px 18px 40px; }
}

@media (max-width: 560px) {
  .admin-stats { grid-template-columns: minmax(0, 1fr); }
}

/* not found */

/* Whole-page empty state. The CSP has no 'unsafe-inline' in style-src, so the
   taller padding a full-page 404 wants cannot ride on a style attribute. */
.empty-page { padding: 120px 24px; }

/* ------------------------------------------------ hints outside a field */

/* site.css only styles .hint as a child of .field, but forms also put one next
   to the submit button and inside a <label>, where it was rendering as ordinary
   16px body text. Same declarations, so the .field rule still wins where it
   applies and nothing inside a field changes. */
.hint { font-size: 13px; color: var(--text-dim); }
