/* 4ever - design tokens from neuform-staff-featured-2026-05-22 */
:root {
  --primary: #B7EC4B;
  --secondary: #FFFFFF;
  --accent: #34C759;
  --bg: #FFFFFF;
  --surface: #8E8E93;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --border: #8E8E93;
  --line: #E5E7EB;
  --radius-card: 8px;
  --radius-control: 8px;
  --radius-pill: 9999px;
  --font-ios: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gap: 16px;
  --pad-card: 24px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-ios);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.display-lg {
  font-family: var(--font-ios);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
}
.label-md {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.muted { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.only-sm { display: none; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 16px 96px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--text-primary);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.brand-mark svg { width: 20px; height: 20px; }
.topbar-spacer { flex: 1; }
.search-wrap { display: none; flex: 1; max-width: 320px; }
.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-family: var(--font-ios);
  font-size: 14px;
  background: #F9FAFB;
}
.search:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--secondary);
  color: var(--text-primary);
  border-radius: var(--radius-control);
  padding: 10px 16px;
  font-family: var(--font-ios);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-pill { border-radius: var(--radius-pill); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.card {
  background: var(--secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  padding: var(--pad-card);
}
.card-tight { padding: 16px; }

.hero {
  margin: 20px 0 var(--gap);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #F7FFE9 0%, #FFFFFF 60%);
  padding: var(--pad-card);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 236, 75, 0.55), rgba(183, 236, 75, 0));
  pointer-events: none;
}
.hero p { max-width: 520px; color: var(--text-secondary); margin: 8px 0 0; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: var(--gap); }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  background: var(--secondary);
}
.stat b { display: block; font-family: var(--font-mono); font-size: 20px; font-weight: 700; }
.stat span { font-size: 12px; color: var(--text-secondary); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: var(--gap); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--secondary);
  white-space: nowrap;
}
.chip.is-active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.layout { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.col-side { display: none; }
/* halaman yang sidebarnya justru berisi kontrol utama (admin) tetap tampil di mobile */
.layout-side .col-side { display: block; }

.feed { display: grid; gap: 12px; }
.thread {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--secondary);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.thread:hover { border-color: var(--surface); transform: translateY(-1px); }
.thread-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.thread h3 { margin: 10px 0 6px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.thread .userline { margin-bottom: 0; }
.thread-excerpt { margin: 0; color: var(--text-secondary); font-size: 14px; }
.thread-foot {
  display: flex; align-items: center; gap: 14px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-secondary);
}
.thread-foot .spacer { flex: 1; }

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  border: 1px solid var(--line);
  color: var(--text-secondary);
  background: #F9FAFB;
}
.badge-board { background: var(--primary); border-color: var(--primary); color: var(--text-primary); }
.badge-pin { background: var(--text-primary); border-color: var(--text-primary); color: #fff; }
.badge-lock { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
.badge-tag { background: #EFF6FF; border-color: #DBEAFE; color: #1D4ED8; }
.badge-admin { background: var(--text-primary); border-color: var(--text-primary); color: var(--primary); }

.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--text-primary);
  flex: 0 0 auto;
}
.avatar-lg { width: 40px; height: 40px; font-size: 13px; }
.userline { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.userline b { font-weight: 600; }
.userline .handle { color: var(--text-secondary); font-family: var(--font-mono); font-size: 11px; }

.post { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; background: var(--secondary); }
.post + .post { margin-top: 10px; }
.post-subject { margin: 10px 0 0; font-size: 28px; font-weight: 700; line-height: 1.25; }
.post-body { margin: 10px 0 0; white-space: pre-wrap; word-wrap: break-word; }
.post-media { margin: 12px 0 0; }
.post-media a { display: block; }
.post-image { display: block; width: 100%; max-height: 520px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-card); background: #F9FAFB; }
.thread .post-image { margin-top: 8px; height: 200px; object-fit: cover; }
.post-thumb { display: block; width: 160px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-card); background: #F9FAFB; }
.checkline { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; color: var(--text-secondary); }
.post-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.like-btn {
  border: 1px solid var(--line); background: var(--secondary);
  border-radius: var(--radius-pill); padding: 4px 12px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--text-secondary); cursor: pointer;
}
.like-btn.is-liked { background: var(--primary); border-color: var(--primary); color: var(--text-primary); }

.replies { display: grid; gap: 10px; }
.reply { position: relative; }
.reply-context {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 4px 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-secondary); text-decoration: none;
}
.reply-context:hover { color: var(--text-primary); }
.reply-context .reply-line {
  width: 12px; height: 10px; margin-bottom: 6px;
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line);
  border-bottom-left-radius: 8px;
}
.reply-context-avatar {
  width: 18px; height: 18px; flex: 0 0 auto;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 8px; font-weight: 700;
  color: var(--text-primary);
}
.reply-branch {
  display: grid; gap: 10px;
  margin: 10px 0 0 14px; padding-left: 14px;
  border-left: 2px solid var(--line);
}
.reply-branch > .reply::before {
  content: ""; position: absolute; left: -14px; top: 20px;
  width: 14px; height: 2px; background: var(--line);
}
.reply-branch.is-flat { margin-left: 0; padding-left: 0; border-left: 0; }
.reply-branch.is-flat > .reply::before { display: none; }

.reply-to {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: var(--radius-control); background: #F9FAFB;
  font-size: 12px; color: var(--text-secondary);
}
.reply-to[hidden] { display: none; }
.reply-to-label b { color: var(--text-primary); }
.reply-to-cancel {
  margin-left: auto; border: 0; background: none; padding: 0;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--text-secondary); cursor: pointer; text-decoration: underline;
}
#reply-form.is-targeting { border-color: var(--primary); }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  font-family: var(--font-ios);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--secondary);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field input[type="file"] {
  padding: 8px 10px; font-size: 13px; color: var(--text-secondary);
  background: #F9FAFB; border-style: dashed;
}
.field input[type="file"]::file-selector-button {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  margin-right: 10px; padding: 6px 12px; cursor: pointer;
  color: var(--text-primary); background: var(--secondary);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
}
.field input[type="file"]::file-selector-button:hover { border-color: var(--primary); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary);
}
.error { color: #B91C1C; font-size: 13px; margin: 6px 0 0; }
.flash {
  border: 1px solid var(--accent);
  background: #F0FDF4;
  color: #166534;
  border-radius: var(--radius-card);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: var(--gap);
}

.panel { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; background: var(--secondary); }
.panel + .panel { margin-top: 12px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.panel-list a { display: block; font-size: 14px; font-weight: 500; }
.panel-list .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.board-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count-pill { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-secondary); }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 6px 10px; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.pager .is-current { background: var(--primary); border-color: var(--primary); }
.pager .is-disabled { color: #D1D5DB; }

/* --- profil, admin, dan elemen pendukung --- */
.link { color: var(--text-primary); text-decoration: underline; font-weight: 500; }
.avatar-btn { border: 1px solid var(--line); }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }
.post-actions .spacer, .thread-foot .spacer { flex: 1; }
.stack { display: grid; gap: var(--gap); }

.page-head { margin: 20px 0 var(--gap); }
.page-head h1 { margin: 6px 0 4px; }
.page-head p { margin: 0; max-width: 620px; }

.auth-wrap { max-width: 440px; margin: 32px auto; }

.flash-error { border-color: #FCA5A5; background: #FEF2F2; color: #991B1B; }
.flash-error ul { margin: 6px 0 0; padding-left: 20px; }

.sitefoot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 96px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}
.sitefoot .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: var(--gap); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--secondary);
}
.tabs a.is-active { background: var(--primary); border-color: var(--primary); color: var(--text-primary); }

.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: var(--gap); }
.filterbar .search { max-width: 260px; flex: 1 1 180px; }
.filterbar select, .table select {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 7px 10px;
  font-family: var(--font-ios);
  font-size: 13px;
  background: var(--secondary);
  color: var(--text-primary);
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 500; }
.table .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.row-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.row-form:last-of-type { border-bottom: 0; }
.row-form input[type="text"], .row-form input:not([type]) {
  flex: 1 1 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 7px 10px;
  font-family: var(--font-ios);
  font-size: 13px;
}
.row-form input[name="tagline"] { flex: 1 1 200px; }
.row-form .row-slug { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.row-form input[type="color"], .field input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--secondary);
}

.btn-danger { border-color: #FCA5A5; background: #FEF2F2; color: #991B1B; }
.btn-danger:hover { background: #FEE2E2; }

.stats-4 { grid-template-columns: repeat(4, 1fr); }

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0 var(--gap);
}
.profile-head-main { flex: 1 1 240px; }
.profile-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-head .handle { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.profile-head p { margin: 6px 0 0; }

.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-control);
}
.bottomnav a.is-active { color: var(--text-primary); background: rgba(183, 236, 75, 0.35); }
.bottomnav svg { width: 20px; height: 20px; }
.bottomnav .fab svg { background: var(--primary); border-radius: var(--radius-pill); padding: 4px; width: 28px; height: 28px; }

@media (min-width: 900px) {
  .statusbar { display: none; }
  .search-wrap { display: block; }
  .shell { padding-bottom: 48px; }
  .display-lg { font-size: 56px; }
  .page-head h1 { font-size: 44px; }
  .layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .col-side { display: block; position: sticky; top: 76px; }
  .bottomnav { display: none; }
  .hero { padding: 40px; }
  .topbar-inner { padding: 12px 16px; }
  .sitefoot { padding-bottom: 32px; }
  .row-form input[name="name"] { flex: 0 1 160px; }
}

/* --- topbar: label tombol jangan membungkus, aksi ganda disembunyikan di layar kecil --- */
.topbar .btn, .topbar .avatar { white-space: nowrap; flex: 0 0 auto; }

@media (max-width: 899px) {
  .topbar-cta, .topbar-admin { display: none; }

  /* semua ringkasan tetap satu baris: kartu rapat, sisanya digeser ke samping */
  .card { padding: 14px; }
  .stats, .stats-4 {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .stats::-webkit-scrollbar { display: none; }
  .stats .stat { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
  .stats .stat b { font-size: 17px; }
  .stats .stat span { font-size: 11px; line-height: 1.25; }

  .filterbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filterbar::-webkit-scrollbar { display: none; }
  .filterbar .search { max-width: none; flex: 1 0 160px; }
  .filterbar select, .filterbar .btn { flex: 0 0 auto; }

  /* tabel tetap sebaris: kolom jangan turun, geser ke samping bila tidak muat */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px; white-space: nowrap; }

  /* kolom utama boleh membungkus; kolom detail yang berulang disembunyikan supaya tabel muat */
  .table .wrap-sm { white-space: normal; }
  .table .hide-sm { display: none; }
  .only-sm { display: block; }

  .reply-branch { margin-left: 8px; padding-left: 8px; }
  .reply-branch > .reply::before { left: -8px; width: 8px; }
}
