/* Kerangka halaman: sidebar (laci di HP), topbar, area konten, header halaman. Mobile-first. */
.shell { min-height: 100vh; min-height: 100dvh; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: min(17rem, 86vw);
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--line);
    padding: var(--sp-5) var(--sp-3) var(--sp-4);
    transform: translateX(-100%); visibility: hidden; overscroll-behavior: contain; overflow-y: auto;
    transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.sidebar[data-open] { transform: none; visibility: visible; transition-delay: 0s; box-shadow: var(--shadow-pop); }
.scrim { position: fixed; inset: 0; z-index: 30; background: var(--overlay); }

.brand { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-2) var(--sp-6); }
.brand__mark { flex: none; width: 1.75rem; height: 1.75rem; color: var(--accent); }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__text strong { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.brand__text small { white-space: nowrap; font-size: var(--fs-xs); color: var(--muted); }
.sidebar__close { margin-left: auto; }

/*
 * Navigasi sebagai jalur rute: tiap halaman adalah satu pemberhentian pada satu garis.
 * Halaman aktif = titik terisi; halaman yang belum ada = titik putus-putus.
 */
.nav { position: relative; display: flex; flex-direction: column; }
.nav::before {
    content: ""; position: absolute; left: calc(var(--sp-2) + .4375rem); width: 2px;
    top: calc(var(--nav-row) + var(--nav-row) / 2); bottom: calc(var(--nav-row) / 2);
    background: var(--line-strong);
}
.nav__label { height: var(--nav-row); display: flex; align-items: center; padding: 0 var(--sp-2); font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.nav__link {
    position: relative; display: flex; align-items: center;
    min-height: var(--nav-row); padding: 0 var(--sp-2) 0 calc(var(--sp-2) + 1.75rem);
    border-radius: var(--r-md); color: var(--muted); text-decoration: none; font-weight: 500;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__link::before {
    content: ""; position: absolute; left: calc(var(--sp-2) + .0625rem); top: 50%; transform: translateY(-50%);
    width: .8125rem; height: .8125rem; border-radius: 50%;
    border: 2px solid var(--line-strong); background: var(--surface);
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav__link:hover, .nav__link:active { background: var(--subtle); color: var(--ink); }
.nav__link:hover::before { border-color: var(--muted); }
.nav__link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav__link[aria-current="page"]::before { border-color: var(--accent); background: var(--accent); }
.nav__link--soon { font-weight: 400; }
.nav__link--soon::before { border-style: dashed; }
.nav__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.nav__soon { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.nav__link i { display: none; }

.sidebar__foot {
    margin-top: auto; display: flex; align-items: center; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-2) 0; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-base);
}
.sidebar__foot a { margin-left: auto; color: var(--muted); font-size: 1.1rem; }
.sidebar__foot a:hover { color: var(--ink); }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: var(--sp-2);
    height: var(--topbar-h); padding: 0 var(--sp-4);
    background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar__title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); }

.theme-toggle .bi-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .bi-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }

/* Popover (lonceng pemberitahuan) */
.popover-host { position: relative; }
.popover {
    position: fixed; z-index: 35; top: calc(var(--topbar-h) + var(--sp-1)); left: var(--sp-3); right: var(--sp-3);
    max-height: calc(100dvh - var(--topbar-h) - var(--sp-6)); overflow: auto; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
}

/* ---------- Konten ---------- */
.content { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-8); }
.footer { padding: var(--sp-4); text-align: center; color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Header halaman + filter ---------- */
.page-head { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.eyebrow { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.page-title { font-size: var(--fs-xl); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -.02em; margin-top: var(--sp-1); text-wrap: balance; }
.page-title__tag {
    display: inline-block; vertical-align: .2em; margin-left: var(--sp-2); padding: .1rem .45rem;
    border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent);
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0;
}
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.filters .field:first-child { grid-column: 1 / -1; }

@media (min-width: 48em) {
    .content { padding: var(--sp-8) var(--sp-6) var(--sp-10); }
    .filters { display: flex; gap: var(--sp-3); }
    .filters .field, .filters .field:first-child { flex: 1 1 0; max-width: 14rem; }
    .popover { position: absolute; top: calc(100% + var(--sp-2)); left: auto; right: 0; width: 26rem; max-height: 70vh; }
}

/* Desktop: sidebar tetap di kiri, tombol menu disembunyikan */
@media (min-width: 64em) {
    .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .sidebar {
        position: sticky; top: 0; height: 100vh; height: 100dvh; width: auto;
        transform: none; visibility: visible; box-shadow: none; transition: none;
        background: transparent;
    }
    .nav__link::before { background: var(--bg); }
    .sidebar__close, .topbar__menu, .scrim { display: none !important; }
    .topbar { padding: 0 var(--sp-8); }
    .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
    .filters .field, .filters .field:first-child { flex: none; width: 10.5rem; }
    .filters .field:first-child { width: 9.5rem; }
}
