:root {
  --bg: #0a0e12;
  --bg-elevated: #10161c;
  --bg-card: #131a21;
  --border: #223037;
  --text: #e8f0f2;
  --text-muted: #8ba1a9;
  --accent: #14e0a4;
  --accent-dim: #0f9d76;
  --accent-soft: rgba(20, 224, 164, 0.12);
  --danger: #ff6b6b;
  --warning: #f5b942;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 18, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--bg-elevated);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}
#nav-check { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s, background .15s, border-color .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #05231a; }
.btn-primary:hover { background: #2af0b8; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #2a0808; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

/* Hero */
.hero {
  padding: 90px 0 70px;
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% -10%, var(--accent-soft), transparent 70%);
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 64px 0; }
.section-title {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.section-sub { color: var(--text-muted); margin: 0 0 32px; }

/* Cards / grids */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.stat-card { text-align: left; }
.stat-card .label { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 6px; }
.stat-card .value { font-size: 1.7rem; font-weight: 700; }
.stat-card .value.accent { color: var(--accent); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}
th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { border: none; }
.table-wrap .card { border: none; }
tr:last-child td { border-bottom: none; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.rank-badge.top { background: var(--accent-soft); color: var(--accent); }

/* Forms */
.form-page {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.form-card h1 { font-size: 1.4rem; margin: 0 0 6px; }
.form-card .sub { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.form-footer { margin-top: 18px; text-align: center; font-size: 0.88rem; color: var(--text-muted); }
.form-footer a { color: var(--accent); font-weight: 600; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.alert-error { background: rgba(255,107,107,0.12); color: #ff9d9d; border: 1px solid rgba(255,107,107,0.3); }
.alert-success { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(20,224,164,0.3); }

/* Dashboard layout */
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 32px 0; align-items: start; }
@media (max-width: 800px) { .dash-layout { grid-template-columns: 1fr; } }
.dash-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  position: sticky;
  top: 84px;
}
.dash-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.dash-sidebar a:hover, .dash-sidebar a.active { background: var(--accent-soft); color: var(--accent); }
.dash-main h1 { font-size: 1.5rem; margin: 0 0 20px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge-pending { background: rgba(245,185,66,0.15); color: var(--warning); }
.badge-approved { background: var(--accent-soft); color: var(--accent); }
.badge-rejected { background: rgba(255,107,107,0.15); color: var(--danger); }
.badge-sent { background: rgba(20,224,164,0.2); color: var(--accent); }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--accent); }

.news-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-item h3 { margin: 0 0 6px; font-size: 1.1rem; }
.news-item .date { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 8px; }
.news-body { color: var(--text-muted); }

.prose h1 { font-size: 1.7rem; }
.prose h2 { font-size: 1.3rem; margin-top: 28px; }
.prose p { color: var(--text-muted); }

@media (max-width: 700px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    display: none;
  }
  .nav-links a { padding: 12px 14px; }
  #nav-check:checked ~ .nav-links { display: flex; }
}

/* HashBX original-flavour home sections */
:root { --accent-blue: #10b5e9; }
.accent-blue { color: var(--accent-blue); }
.hero-hbx {
  background:
    radial-gradient(700px 340px at 30% -10%, rgba(16,181,233,0.14), transparent 70%),
    radial-gradient(600px 300px at 75% 0%, var(--accent-soft), transparent 70%);
}
.hero-tagline {
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  font-weight: 800;
  letter-spacing: .04em;
  margin: 6px 0 16px;
}
.hero-note { color: var(--text); font-weight: 600; margin-bottom: 26px; }

.collage-strip {
  height: 220px;
  background-size: auto 220px !important;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  opacity: .9;
}
@media (max-width: 700px) { .collage-strip { height: 140px; background-size: auto 140px !important; } }

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 700px) { .video-grid { grid-template-columns: 1fr; } }
.video-embed {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, transform .15s;
}
.partner:hover { border-color: var(--accent-blue); transform: translateY(-2px); }
.partner img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
}
.partner-fallback {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-blue);
  font-weight: 800;
  font-size: .7rem;
  text-transform: uppercase;
  text-align: center;
}
.partner-label { color: var(--text-muted); font-size: .78rem; word-break: break-all; text-align: center; }

/* Announcement */
.announce-banner {
  background: rgba(245, 185, 66, 0.08);
  border: 1px solid rgba(245, 185, 66, 0.35);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.announce-banner .announce-title {
  color: var(--warning);
  font-weight: 700;
  margin-bottom: 8px;
}
.announce-banner p { color: var(--text-muted); margin: 0 0 14px; }
.announce-full { line-height: 1.7; color: var(--text-muted); }

/* Explorer donut chart */
.donut-card {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.donut-svg { width: 220px; height: 220px; flex: 0 0 auto; }
.donut-svg path { stroke: var(--bg-card); stroke-width: 1; }
.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 260px;
  min-width: 0;
}
.donut-legend li { display: flex; align-items: center; gap: 9px; font-size: 0.82rem; }
.donut-legend .swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.donut-legend .legend-text {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .donut-card { flex-direction: column; align-items: center; }
  .donut-legend { width: 100%; }
}

/* Google sign-in */
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-weight: 600;
}
.btn-google:hover { background: #f1f3f4; }
.btn-google svg { flex: 0 0 auto; }
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Admin */
.nav-admin {
  color: var(--warning) !important;
  font-weight: 700 !important;
}
.nav-admin.active { background: rgba(245,185,66,0.15); }
.nav-admin:hover { color: #ffd166 !important; }
.admin-search {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-search input {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}
.filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.action-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
