/**
 * FGD — Forum Group Discussion
 * Stylesheet Utama (Ekstrak Desain Acuan)
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/PlusJakartaSans-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-page: #F3F6FB;
  --text-main: #132240;
  --text-muted: #4A5877;
  --primary: #1D4FC4;
  --primary-hover: #163E9E;
  --primary-light: #D4E4FF;
  --primary-subtle: #EBF3FF;
  --border: #DAE2EE;
  --card-bg: #FFFFFF;
  --card-border: #E8EEF7;
  --card-hover-border: #9DBDF5;
  --badge-orange-bg: #FFB423;
  --badge-orange-text: #3A2600;
  --badge-green-bg: #D1F2DC;
  --badge-green-text: #0E5E2B;
  --badge-red-bg: #FEE2E2;
  --badge-red-text: #991B1B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --border-strong: #D0D9E8;
  --text-subtle: #5A6684;
  --danger: #B42318;
  --danger-hover: #8F1D14;
  --focus-ring: 0 0 0 3px rgba(29, 79, 196, 0.28);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--primary-hover);
}

/* Layout Wrapper */
.app-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  gap: 32px;
  background-color: var(--bg-page);
}

.main-content {
  flex: 999 1 560px;
  max-width: 760px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(96px + var(--safe-bottom)); /* ruang untuk bottom nav */
}

/* Header Halaman */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 8px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 0;
  background: #FFFFFF;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(19, 34, 64, 0.05);
}

.icon-btn:hover {
  background: #F8FAFC;
}

/* Sidebar Desktop */
.sidebar-desktop {
  display: none;
  width: 240px;
  min-height: 100vh;
  flex-direction: column;
  gap: 24px;
  padding: 28px 0 28px 20px;
  background: var(--bg-page);
  color: var(--text-main);
}

.sidebar-desktop.sidebar-moderator {
  width: 256px;
  background: var(--primary);
  color: #FFFFFF;
  padding: 24px 16px;
}

.sidebar-desktop.sidebar-superadmin {
  width: 256px;
  background: var(--text-main);
  color: #FFFFFF;
  padding: 24px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s ease;
}

.sidebar-moderator .sidebar-link,
.sidebar-superadmin .sidebar-link {
  color: #FFFFFF;
}

.sidebar-link:hover {
  background: rgba(212, 228, 255, 0.5);
}

.sidebar-moderator .sidebar-link:hover,
.sidebar-superadmin .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-link.active {
  background: var(--primary-light);
  color: var(--text-main);
  font-weight: 700;
}

.sidebar-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--badge-orange-bg);
  color: var(--badge-orange-text);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tombol Aksi */
.btn-primary {
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  padding: 0 20px;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #FFFFFF;
}

/* Bottom Nav Mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(72px + var(--safe-bottom));
  padding: 0 8px var(--safe-bottom);
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.bottom-nav-link {
  width: 60px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
}

.bottom-nav-link.active {
  color: var(--primary);
}

.bottom-nav-fab {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(29, 79, 196, 0.35);
  margin-top: -12px;
}

/* Card & Komponen */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--card-hover-border);
  box-shadow: 0 4px 14px rgba(19, 34, 64, 0.04);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: var(--badge-green-bg);
  color: var(--badge-green-text);
}

.badge-warning {
  background: var(--badge-orange-bg);
  color: var(--badge-orange-text);
}

.badge-danger {
  background: var(--badge-red-bg);
  color: var(--badge-red-text);
}

/* Alert Flash */
.flash-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 16px;
}

.flash-message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flash-success {
  background: var(--badge-green-bg);
  color: var(--badge-green-text);
  border: 1px solid #A3E6B7;
}

.flash-error {
  background: var(--badge-red-bg);
  color: var(--badge-red-text);
  border: 1px solid #FCA5A5;
}

/* Responsif */
@media (min-width: 900px) {
  .sidebar-desktop {
    display: flex;
  }
  .bottom-nav {
    display: none;
  }
  .mob-only {
    display: none !important;
  }
  .main-content {
    padding-bottom: 40px;
  }
}

/* ============================================================
   Design System Utilities (Ekstrak 1:1 Desain Acuan)
   ============================================================ */

.card { background: #FFFFFF; border-radius: 20px; }
.btn { height: 48px; padding: 0 18px; border-radius: 12px; border: 0; font: inherit; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-p { background: var(--primary); color: #FFFFFF; } .btn-p:hover { background: var(--primary-hover); color: #FFFFFF; }
.btn-o { background: #FFFFFF; color: var(--text-main); border: 1.5px solid var(--border-strong); }
.btn-l { background: var(--primary-light); color: var(--text-main); }
.btn-d { background: var(--danger); color: #FFFFFF; }
.btn-g { background: transparent; color: var(--primary); padding: 0 10px; }
.btn-s { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.inp { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--border-strong); border-radius: 12px; background: #FFFFFF; font: inherit; font-size: 15px; color: var(--text-main); }
.inp:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.inp::placeholder { color: #6B7792; opacity: 1; }
textarea.inp { height: auto; padding: 12px 14px; line-height: 1.6; resize: vertical; }
select.inp { appearance: auto; }
.inp-err { border: 2px solid var(--danger); }
.fld { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 14px; font-weight: 700; }
.req { color: var(--danger); }
.hint { font-size: 13px; color: var(--text-subtle); line-height: 1.5; }
.err { font-size: 13px; font-weight: 600; color: var(--danger); display: flex; gap: 6px; align-items: center; }
.mut { color: var(--text-muted); }
.bdg { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.b-cat { background: #EAF1FF; color: #1C3A80; }
.b-ok { background: #E3F1E6; color: #1B6B3E; }
.b-warn { background: #FFF1D6; color: #7A4B00; }
.b-neu { background: #EDF1F7; color: #3C4966; }
.b-lock { background: #E8E6E1; color: #3A3A36; }
.b-info { background: #DCE9F7; color: #1D4F86; }
.b-err { background: #FDECEA; color: #8F1D14; }
.b-navy { background: var(--text-main); color: #FFFFFF; }
.pill { border-radius: 999px; }
.av { width: 36px; height: 36px; border-radius: 18px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--text-main); }
.ib { width: 40px; height: 40px; border: 1.5px solid var(--border); border-radius: 10px; background: #FFFFFF; color: #3C4966; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.ib-d { color: var(--danger); }
.icn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #FFFFFF; color: var(--text-main); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.tbw { overflow-x: auto; }
.tb { width: 100%; border-collapse: collapse; }
.tb th { padding: 12px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); background: #F7F9FC; white-space: nowrap; }
.tb td { padding: 14px 12px; border-top: 1px solid #E8EDF5; vertical-align: middle; font-size: 14px; }
.sec-t { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.a-info { background: #EAF1FF; color: #1C3A80; }
.a-err { background: #FDECEA; color: #8F1D14; font-weight: 600; }
.a-ok { background: #E3F1E6; color: #145232; font-weight: 600; }
.a-warn { background: #FFF1D6; color: #6B4200; font-weight: 600; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #E4EAF4; border-radius: 14px; overflow-x: auto; }
.tab { flex: 1 0 auto; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.tab-on { background: #FFFFFF; color: var(--text-main); font-weight: 700; box-shadow: 0 1px 2px rgba(19,34,64,0.08); }
.chip { flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 18px; border: 1.5px solid var(--border-strong); background: #FFFFFF; color: var(--text-main); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.chip-on { background: var(--primary); border-color: var(--primary); color: #FFFFFF; font-weight: 700; }
.sx { overflow-x: auto; scrollbar-width: none; } .sx::-webkit-scrollbar { display: none; }
.auth-m { width: 112px; height: 112px; }
@media (min-width: 900px) {
  .auth-b { min-height: 100vh; padding: 64px !important; justify-content: center !important; }
  .auth-m { width: 200px; height: 200px; }
  .auth-t { font-size: 40px !important; }
}


/* ============================================================
   Polish: permukaan browser, fokus, keadaan interaksi
   ============================================================ */

html { -webkit-text-size-adjust: 100%; }
body { accent-color: var(--primary); caret-color: var(--primary); -webkit-tap-highlight-color: transparent; }
::selection { background: var(--primary-light); color: var(--text-main); }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
img { max-width: 100%; }

/* Fokus keyboard yang selalu terlihat (sebelumnya hanya default browser / dihapus di .inp) */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .btn-primary:focus-visible, .chip:focus-visible, .tab:focus-visible,
.icn:focus-visible, .ib:focus-visible, .icon-btn:focus-visible, .sidebar-link:focus-visible { outline-offset: 2px; border-radius: 12px; }
.inp:focus-visible { outline: none; }
.sidebar-moderator :focus-visible, .sidebar-superadmin :focus-visible { outline-color: #FFFFFF; }

/* Keadaan tombol yang sebelumnya belum ada */
.btn, .chip, .tab, .ib, .icn, .icon-btn, .bottom-nav-link, .bottom-nav-fab {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.btn-o:hover { background: #F4F7FC; border-color: #B8C6DC; color: var(--text-main); }
.btn-l:hover { background: #C3D8FB; color: var(--text-main); }
.btn-g:hover { background: var(--primary-subtle); }
.btn-d:hover { background: var(--danger-hover); color: #FFFFFF; }
.chip:hover { border-color: var(--card-hover-border); }
.chip-on:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.tab:hover { color: var(--text-main); }
.ib:hover, .icn:hover { background: #F4F7FC; }
.btn:active, .chip:active, .ib:active, .icn:active, .icon-btn:active, .bottom-nav-fab:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.bottom-nav-link:active { color: var(--primary); }

/* Header beranda: subjudul turun ke baris penuh di layar sempit */
.home-greet { font-size: 13px; line-height: 1.5; color: var(--text-muted); padding: 0 16px; margin: -2px 0 10px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; background: var(--primary-light); object-fit: contain; }
.sidebar-brand-icon.brand-mark { width: 44px; height: 44px; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn:active, .chip:active, .ib:active, .icn:active, .icon-btn:active, .bottom-nav-fab:active { transform: none; }
}

/* ============================================================
   Gerbang instalasi PWA (assets/js/pwa-gate.js)
   ============================================================ */

html.pwa-locked, html.pwa-locked body { overflow: hidden; height: 100%; }
html.pwa-locked body > :not(.pwa-gate):not(script) { pointer-events: none; user-select: none; }

.pwa-gate {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: auto;
}
.pwa-gate:not([open]) { display: none; }
.pwa-gate::backdrop { background: rgba(19, 34, 64, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* Fallback bila <dialog> tidak didukung */
html.pwa-locked .pwa-gate[open]:not(:modal) { background: rgba(19, 34, 64, 0.55); }

.pwa-sheet {
  width: 100%;
  max-width: 460px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  padding: 28px 22px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  box-shadow: 0 -8px 32px rgba(19, 34, 64, 0.18);
  animation: pwa-rise .32s cubic-bezier(.16, 1, .3, 1) both;
}
@media (min-width: 520px) {
  .pwa-gate { align-items: center; padding: 24px; }
  .pwa-sheet { border-radius: 28px; padding-bottom: 28px; }
}
@keyframes pwa-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pwa-sheet { animation: none; } }

.pwa-mark { position: relative; width: 72px; height: 72px; }
.pwa-mark img { width: 72px; height: 72px; border-radius: 20px; display: block; box-shadow: 0 4px 14px rgba(29, 79, 196, 0.22); }
.pwa-badge { position: absolute; right: -6px; bottom: -6px; width: 30px; height: 30px; border-radius: 15px; background: #1B6B3E; color: #FFFFFF; display: flex; align-items: center; justify-content: center; border: 3px solid #FFFFFF; }
.pwa-badge[hidden] { display: none; }
.pwa-badge svg { width: 16px; height: 16px; }

.pwa-title { font-size: 22px; font-weight: 800; line-height: 1.25; color: var(--text-main); margin-top: 4px; }
.pwa-body { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.pwa-lead { font-size: 15px; line-height: 1.55; color: var(--text-muted); }
.pwa-lead b, .pwa-steps b, .pwa-foot b { color: var(--text-main); font-weight: 700; }

.pwa-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; text-align: left; background: var(--bg-page); border-radius: 16px; padding: 14px; }
.pwa-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--text-main); }
.pwa-step-n { flex: 0 0 26px; height: 26px; border-radius: 13px; background: var(--primary); color: #FFFFFF; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: -1px; }

.pwa-ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.22em; color: var(--primary); margin: 0 1px; }

.pwa-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.pwa-actions[hidden] { display: none; }
.pwa-cta { width: 100%; height: 52px; font-size: 16px; border-radius: 14px; }
.pwa-foot { font-size: 13px; line-height: 1.5; color: var(--text-subtle); }
.pwa-live { font-size: 13px; font-weight: 700; color: #1B6B3E; min-height: 1px; }
.pwa-live:empty { display: none; }

.pwa-gate[data-state="installing"] .pwa-mark img { animation: pwa-pulse 1.2s ease-in-out infinite; }
@keyframes pwa-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .pwa-gate[data-state="installing"] .pwa-mark img { animation: none; } }

/* Tombol ghost/kecil yang dipakai tanpa kelas .btn (aksi komentar, Laporkan):
   sebelumnya tampil dengan gaya bawaan browser. */
:where(.btn-g, .btn-s):not(.btn) {
  height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
:where(.btn-g, .btn-s):not(.btn):hover { background: var(--primary-subtle); }
:where(.btn-g, .btn-s):not(.btn):disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   Navigasi moderator & superadmin di HP
   Sebelumnya sidebar disembunyikan < 900px tanpa pengganti, sehingga
   di mode aplikasi (tanpa tombol back browser) panel tidak bisa dinavigasi.
   ============================================================ */
@media (max-width: 899px) {
  .app-container:has(> .sidebar-moderator, > .sidebar-superadmin) { flex-direction: column; justify-content: flex-start; gap: 0; }
  .sidebar-desktop.sidebar-moderator,
  .sidebar-desktop.sidebar-superadmin {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "brand foot" "nav nav";
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    min-height: 0;
    padding: 12px 12px 10px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(19, 34, 64, 0.12);
  }
  .sidebar-moderator .sidebar-brand, .sidebar-superadmin .sidebar-brand { grid-area: brand; gap: 8px; }
  .sidebar-moderator .sidebar-brand-icon, .sidebar-superadmin .sidebar-brand-icon { width: 36px; height: 36px; border-radius: 10px; }
  .sidebar-moderator .sidebar-foot, .sidebar-superadmin .sidebar-foot { grid-area: foot; margin: 0 !important; justify-self: end; }
  .sidebar-foot-note { display: none; }
  .sidebar-moderator .sidebar-foot > div, .sidebar-superadmin .sidebar-foot > div { padding: 6px 6px 6px 12px !important; gap: 12px !important; }
  .sidebar-moderator .sidebar-foot a, .sidebar-superadmin .sidebar-foot a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 8px; }
  .sidebar-moderator .sidebar-nav, .sidebar-superadmin .sidebar-nav {
    grid-area: nav;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -12px;
    padding: 0 12px;
    scroll-padding-inline: 12px;
  }
  .sidebar-moderator .sidebar-nav::-webkit-scrollbar, .sidebar-superadmin .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-moderator .sidebar-link, .sidebar-superadmin .sidebar-link { flex: 0 0 auto; height: 40px; font-size: 14px; gap: 8px; padding: 0 12px; }
  .sidebar-moderator .sidebar-link svg, .sidebar-superadmin .sidebar-link svg { width: 18px; height: 18px; }
  .sidebar-moderator .sidebar-link .bdg { margin-left: 2px !important; }
}

/* ============================================================
   Kartu topik: seluruh kartu bisa diketuk, efek tekan, status loading
   ============================================================ */
.tc-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tc-who { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.tc-name { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-time { font-size: 12px; line-height: 1.3; color: var(--text-subtle); white-space: nowrap; }
.tc-cat { flex: 0 1 auto; max-width: 48%; overflow: hidden; text-overflow: ellipsis; }

.topic-card { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .18s cubic-bezier(.2, 0, 0, 1), box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
.topic-card .tc-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.topic-card .tc-link:focus-visible { outline: none; }
.topic-card:has(.tc-link:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) {
  .topic-card:hover, .card-press:hover { border-color: var(--card-hover-border) !important; box-shadow: 0 6px 18px rgba(19, 34, 64, 0.07) !important; }
}
.card-press { position: relative; transition: transform .18s cubic-bezier(.2, 0, 0, 1), box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
.topic-card.is-pressed, .card-press.is-pressed {
  transform: scale(.975); background-color: #F7FAFF; border-color: var(--card-hover-border) !important;
  box-shadow: 0 1px 2px rgba(19, 34, 64, 0.06) !important; transition-duration: .08s;
}
.topic-card.is-loading, .card-press.is-loading { transform: scale(.985); border-color: var(--primary) !important; }
.tc-spin { position: absolute; right: 16px; bottom: 16px; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--primary-light); border-top-color: var(--primary); animation: tc-spin .7s linear infinite; z-index: 2; }
@keyframes tc-spin { to { transform: rotate(360deg); } }

/* Bilah loading di atas layar saat berpindah halaman */
#nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2147483000; pointer-events: none;
  background: linear-gradient(90deg, var(--primary), #5B8DEF); box-shadow: 0 0 8px rgba(29, 79, 196, .45); border-radius: 0 3px 3px 0;
  opacity: 0; transition: width 2.2s cubic-bezier(.1, .7, .2, 1), opacity .2s ease; }
#nav-progress.on { opacity: 1; width: 82%; }
#nav-progress.done { width: 100%; transition: width .2s ease, opacity .3s ease .15s; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .topic-card.is-pressed, .card-press.is-pressed, .topic-card.is-loading, .card-press.is-loading { transform: none; }
  .tc-spin { animation-duration: 1.6s; }
}
