:root {
  --bg-darkest: #0f1115;
  --bg-dark: #151a20;
  --bg-medium: #1a2028;
  --bg-card: #1d242d;
  --text-primary: #d5dae2;
  --text-white: #f6f8fb;
  --text-muted: #9099a4;
  --accent: #4b8dff;
  --accent-dark: #3a74d9;
  --discord: #5865f2;
  --danger: #dc5a67;
  --border-color: rgba(255, 255, 255, 0.1);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --font: "Montserrat", "Inter", "Segoe UI", sans-serif;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --transition: 0.18s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at 50% -20%, #1f2d3f 0%, var(--bg-darkest) 40%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

body[data-page="home"] {
  background: #06090d;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  display: block;
}

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

.wrap {
  width: min(1240px, 96vw);
  margin: 0 auto;
  padding: 14px 0 44px;
}

body[data-page="home"] .home-main .wrap {
  padding-top: 22px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(96, 145, 227, 0.36);
  border-radius: var(--radius-lg);
  background: rgba(16, 21, 28, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(75, 141, 255, 0.08) inset;
}

.brand h1 {
  margin: 0;
  color: var(--text-white);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.52rem 0.9rem;
  color: #d9dee5;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.chip:hover,
.chip.active {
  background: rgba(75, 141, 255, 0.2);
  border-color: rgba(75, 141, 255, 0.5);
  color: #eef5ff;
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.56rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.btn.primary,
.btn.success {
  background: var(--accent);
  border-color: var(--accent);
  color: #f2f7ff;
}

.btn.primary:hover,
.btn.success:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-discord {
  background: var(--discord);
  border-color: var(--discord);
  color: #fff;
}

.btn-discord:hover {
  background: #4752c4;
  border-color: #4752c4;
}

.btn.danger {
  background: rgba(220, 90, 103, 0.14);
  border-color: rgba(220, 90, 103, 0.45);
  color: #ffb1b9;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.hero,
.section,
.panel {
  margin-top: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-dark);
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(1.35rem, 2.4vw, 2.1rem);
  overflow: hidden;
  position: relative;
}

.hero-banner {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("/assets/hero-background.png") center center / cover no-repeat;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.22) 0%, rgba(8, 12, 18, 0.52) 50%, rgba(5, 8, 12, 0.84) 100%),
    radial-gradient(circle at 50% 28%, rgba(76, 133, 219, 0.2), rgba(8, 12, 18, 0.02) 60%);
  pointer-events: none;
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(140px, 22vh, 240px);
  z-index: 4;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0) 0%, rgba(8, 12, 18, 0.78) 66%, #0b0f14 100%);
  pointer-events: none;
}

.hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 8;
  padding: 16px 0;
}

body[data-page="home"] .hero-nav .topbar {
  width: min(1240px, 94vw);
  margin: 0 auto;
  position: relative;
  top: 0;
  z-index: 1;
  border: 1px solid rgba(105, 157, 238, 0.44);
  border-radius: 16px;
  background: rgba(11, 15, 22, 0.52);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.hero-content-wrap {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(112px, 14vh, 156px) 1rem clamp(112px, 16vh, 180px);
}

.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}

.hero-logo {
  width: min(210px, 52vw);
  margin: 0 auto 1.2rem;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.hero-title {
  margin: 0;
  color: var(--text-white);
  font-size: clamp(2rem, 5.8vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.58);
}

.hero-subtitle {
  margin: 0.8rem auto 0;
  max-width: 820px;
  color: rgba(243, 247, 253, 0.92);
  font-size: clamp(1.02rem, 2.2vw, 1.24rem);
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.42);
}

.hero-actions {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.server-info-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.56rem 1rem;
  color: #eef2f6;
  font-size: 0.84rem;
  font-weight: 600;
}

.server-info-bar .sep {
  color: rgba(255, 255, 255, 0.35);
}

.hero-inline {
  margin: 1rem 0 0;
  color: rgba(224, 234, 246, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.home-main {
  position: relative;
  background: #0b0f14;
}

.page-hero {
  text-align: center;
  background:
    linear-gradient(rgba(15, 20, 27, 0.86), rgba(15, 20, 27, 0.96)),
    url("/assets/page-bg-v2.png") center center / cover no-repeat;
}

.kicker {
  margin: 0 0 0.3rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.section {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.page-section {
  padding: clamp(1.1rem, 2.3vw, 1.8rem);
}

.section-head {
  margin-bottom: 1rem;
}

.section-head.compact {
  margin-bottom: 0.75rem;
}

.section-title {
  margin: 0;
  color: var(--text-white);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
}

.section-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.space {
  justify-content: space-between;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e6ed;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.34rem 0.72rem;
}

.status-pill {
  margin-top: 0.8rem;
  background: rgba(17, 26, 37, 0.68);
  border-color: rgba(255, 255, 255, 0.24);
}

.split {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
}

body[data-page="home"] .split.highlights {
  grid-template-columns: 1fr 1fr;
}

.highlights .card {
  min-height: 280px;
}

.posts-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.page-section .card-featured {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 340px;
}

.page-section .card-featured .thumb {
  grid-row: 1 / 3;
  height: auto;
  min-height: 340px;
  border-bottom: 0;
  border-right: 1px solid var(--border-color);
}

.page-section .card-featured .card-body {
  padding: 1.15rem;
}

.page-section .card-featured .footer {
  grid-column: 2;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.about-card,
.request-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1rem;
}

.about-card h3 {
  margin: 0;
  color: var(--text-white);
}

.about-card p {
  margin: 0.8rem 0 0;
  font-size: 0.92rem;
}

.about-points {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.about-pill {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.3rem 0.66rem;
  font-size: 0.72rem;
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

.catalog-controls {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px);
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(75, 141, 255, 0.5);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.thumb {
  height: 185px;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, #223046, #17202b);
}

.map-thumb {
  background-size: cover;
  background-position: center;
}

.badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.08);
  color: #f2f5f9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.66rem;
  font-weight: 700;
}

.badge.green,
.badge.purple {
  background: rgba(75, 141, 255, 0.22);
  border-color: rgba(75, 141, 255, 0.5);
}

.card-body {
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  flex: 1;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.card h4 {
  margin: 0;
  color: var(--text-white);
  font-size: 1rem;
  line-height: 1.35;
}

.card .meta {
  color: var(--text-primary);
  font-size: 0.86rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.18rem 0.56rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.footer {
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.72rem;
}

.form .full {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 0.34rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  padding: 0.58rem 0.7rem;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(75, 141, 255, 0.72);
  background: rgba(75, 141, 255, 0.08);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.files-scroll {
  max-height: 540px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.74rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.86rem;
  vertical-align: top;
}

th {
  background: var(--bg-medium);
  color: var(--text-white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.analytics-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 0.9rem;
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.38rem;
  height: 185px;
}

.mini-bar-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
}

.mini-bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  min-height: 3px;
  background: linear-gradient(180deg, rgba(75, 141, 255, 0.95), rgba(52, 108, 204, 0.88));
}

.mini-count {
  font-size: 0.65rem;
  color: #cfd6de;
}

.mini-label {
  width: 100%;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message {
  font-size: 0.82rem;
  min-height: 1.2rem;
  color: var(--text-muted);
}

.message.error {
  color: #ff9aa6;
}

.message.success {
  color: #8fc3ff;
}

body[data-page="admin"] .section,
body[data-page="admin-logs"] .section,
body[data-page="admin-requests"] .section {
  background: var(--bg-dark);
}

body[data-page="admin"] #users,
body[data-page="admin"] #content,
body[data-page="admin"] #bestanden {
  border-left: 3px solid rgba(75, 141, 255, 0.68);
}

body[data-page="admin-login"] .auth-wrap {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 1rem 1.2rem 1.2rem;
}

body[data-page="admin-login"] .auth-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-dark);
  box-shadow: var(--shadow);
}

body[data-page="admin-login"] .auth-panel {
  padding: clamp(1.2rem, 3vw, 2.2rem);
  background: linear-gradient(135deg, #23334a, #17222f);
}

body[data-page="admin-login"] .auth-card {
  padding: clamp(1.2rem, 3vw, 2.2rem);
}

body[data-page="admin-login"] .auth-card .form {
  grid-template-columns: 1fr;
}

footer {
  margin-top: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-dark);
  padding: 1rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 0.95rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-legal {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
}

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

.text-sm {
  font-size: 0.82rem;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 1rem;
}

.popup-card {
  width: min(520px, 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-dark);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 0.62rem;
}

.popup-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
}

.popup-icon.error,
.popup-icon.success,
.popup-icon.warning {
  background: rgba(75, 141, 255, 0.22);
  border-color: rgba(75, 141, 255, 0.6);
  color: #d6e7ff;
}

.popup-title {
  margin: 0;
  color: var(--text-white);
  font-size: 1rem;
}

.popup-message {
  margin: 0.75rem 0 0;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.popup-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.popup-btn {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
  padding: 0.48rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.popup-btn.primary,
.popup-btn.danger {
  background: var(--accent);
  border-color: var(--accent);
  color: #f2f7ff;
}

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

  body[data-page="home"] .split.highlights {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 0.55rem;
  }

  .nav {
    width: 100%;
  }

  .actions {
    width: 100%;
    justify-content: center;
  }

  .catalog-controls {
    grid-template-columns: 1fr;
  }

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

  .page-section .card-featured {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .page-section .card-featured .thumb {
    grid-row: auto;
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .page-section .card-featured .footer {
    grid-column: auto;
  }

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

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

  body[data-page="admin"] .analytics-grid {
    grid-template-columns: 1fr 1fr;
  }

  body[data-page="admin-login"] .auth-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .wrap {
    width: min(1240px, 94vw);
  }

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

  body[data-page="home"] .split.highlights,
  body[data-page="admin"] .analytics-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-banner {
    min-height: 100vh;
  }

  .server-info-bar {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .btn {
    width: 100%;
  }
}
