/* Sidebar bisa dilipat, transisi antarmenu, pencarian global (4 Des) */

/* ---------- tombol lipat ---------- */
.nav-tog {
  position: relative; width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border: 0; border-radius: 14px; background: none; cursor: pointer;
  font: 500 14px/1.2 var(--body); color: var(--ink-3); text-align: left;
  transition: background .25s var(--soft), color .2s;
}
.nav-tog:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.nav-tog .ic { width: 19px; height: 19px; flex: none; }
.nav-tog .tog-chev { transition: transform .5s cubic-bezier(.32,.72,0,1); transform-origin: 14.5px 12px; }
.nav a span, .nav-tog span { white-space: nowrap; transition: opacity .2s ease .12s; }

@media (min-width: 700px) {
  :root { --nav-mini: 79px; }
  .shell { transition: grid-template-columns .5s cubic-bezier(.32,.72,0,1); }
  .nav { min-width: 0; overflow-x: hidden; }
  .nav ul { grid-template-columns: minmax(0, 1fr); }
  .nav a, .nav-tog { min-width: 0; }
  .nav a span, .nav-tog span { min-width: 0; overflow: hidden; }
  .nav-tag, .nav-g, .nav-foot, .nav-brand { overflow: hidden; flex-shrink: 0; }
  .nav-brand { position: relative; display: block; height: 50px; }
  .nav-brand img { transition: opacity .28s ease, transform .5s cubic-bezier(.32,.72,0,1); }
  .nav-brand .nb-mark { display: block; position: absolute; left: 10px; top: 7px; opacity: 0; transform: scale(.85); }
  .nav-tag, .nav-g { white-space: nowrap; transition: opacity .2s ease .1s; }
  .nav-foot { min-width: 200px; transition: opacity .2s ease .1s; }

  html.nav-mini { --nav-w: var(--nav-mini); }
  html.nav-mini .nav-brand .nb-full { opacity: 0; transform: translateX(-6px); }
  html.nav-mini .nav-brand .nb-mark { opacity: 1; transform: none; }
  html.nav-mini .nav a span, html.nav-mini .nav-tog span, html.nav-mini .nav-tag, html.nav-mini .nav-foot { opacity: 0; transition-delay: 0s; transition-duration: .12s; }
  html.nav-mini .nav-g { color: transparent; transition-delay: 0s; position: relative; }
  html.nav-mini .nav-g::after { content: ""; position: absolute; left: 0; width: 22px; top: 50%; height: 1px; background: rgba(16,32,52,.14); }
  html.nav-mini .nav-tog .tog-chev { transform: scaleX(-1); }
  /* label melayang saat dilipat */
  html.nav-mini .nav a::after, html.nav-mini .nav-tog::after {
    content: attr(title); position: absolute; left: calc(100% + 14px); top: 50%; transform: translate(-4px, -50%);
    padding: 6px 10px; border-radius: 9px; background: var(--navy-ink); color: #fff; font: 500 13px/1.2 var(--body); white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 60;
    box-shadow: 0 8px 20px -8px rgba(10,37,64,.5);
  }
  html.nav-mini .nav a:hover::after, html.nav-mini .nav a:focus-visible::after, html.nav-mini .nav-tog:hover::after { opacity: 1; transform: translate(0, -50%); }
  html.nav-mini .nav { overflow: visible; }
  html.nav-mini .nav > nav { overflow: visible; }
}
@media (min-width: 700px) and (max-width: 1179px) {
  :root { --nav-mini: 71px; }
  .nav-tog { padding: 8px 10px; font-size: 13.5px; }
  .nav-brand .nb-mark { left: 8px; }
}
@media (max-width: 699px) { .nav-tog { display: none; } }
/* tanpa animasi saat halaman pertama dibuka */
html.no-anim .shell, html.no-anim .nav * { transition: none !important; }

/* ---------- transisi antarmenu (ala Apple: lembar lama memudar, lembar baru naik halus) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .stack { view-transition-name: page; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  ::view-transition-group(page) { animation-duration: .42s; animation-timing-function: cubic-bezier(.32,.72,0,1); }
  ::view-transition-old(page) { animation: vt-out .2s cubic-bezier(.4,0,1,1) both; }
  ::view-transition-new(page) { animation: vt-in .44s cubic-bezier(.16,1,.3,1) both; }
  @keyframes vt-out { to { opacity: 0; transform: scale(.988); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(12px) scale(.996); } }
  html.vt .sheet.enter { animation: none; }
}
@media (min-width: 700px) { html.nav-mini .nav { z-index: 40; } }

/* indikator simpan: saat semua tersimpan cukup titik kecil (teks muncul hanya saat menyimpan, offline, atau gagal) */
.sync-chip[data-state="idle"] span { display: none; }
.sync-chip[data-state="idle"] { width: 36px; padding: 0; justify-content: center; }
.sync-chip[data-state="idle"] i { width: 7px; height: 7px; background: #4FA77A; box-shadow: none; opacity: .8; }

/* ---------- pencarian global di bilah atas ---------- */
.top { position: sticky; }
.gs-btn {
  flex: 0 1 480px; margin: 0 auto; min-width: 0;
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 16px;
  border: 0; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: var(--glass-fx); backdrop-filter: var(--glass-fx);
  box-shadow: var(--glass-edge), var(--glass-drop); color: var(--ink-3); font: 500 14px/1 var(--body); cursor: pointer; text-align: left;
  transition: box-shadow .25s, background .25s;
}
.gs-btn:hover { background: rgba(255,255,255,.82); }
.gs-btn .ic { width: 18px; height: 18px; flex: none; color: #1A5DB4; }
.gs-ph { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-btn kbd { flex: none; padding: 4px 8px; border-radius: 8px; background: rgba(16,32,52,.06); font: 600 11.5px/1 var(--body); color: var(--ink-3); }
.top .tools { margin-left: 0; flex: none; }
@media (max-width: 899px) { .gs-btn { flex: 1 1 auto; margin: 0; } .gs-btn kbd { display: none; } }
@media (max-width: 699px) {
  .top { flex-wrap: nowrap; }
  .gs-btn { flex: none; width: 42px; height: 42px; margin-left: auto; padding: 0; justify-content: center; }
  .gs-btn .gs-ph { display: none; }
}

.gs { position: fixed; inset: 0; z-index: 200; display: grid; justify-items: center; align-items: start; padding: 11vh 16px 16px; }
.gs[hidden] { display: none; }
.gs-scrim { position: absolute; inset: 0; background: rgba(10,25,45,.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.gs-box { position: relative; width: min(720px, 100%); max-height: 76vh; display: flex; flex-direction: column; border-radius: 24px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: var(--glass-fx-lg); backdrop-filter: var(--glass-fx-lg); box-shadow: 0 0 0 .5px rgba(16,32,52,.1), 0 30px 80px -24px rgba(10,30,60,.45); overflow: hidden;
  opacity: 0; transform: translateY(-8px) scale(.985); transition: opacity .2s, transform .32s cubic-bezier(.16,1,.3,1); }
.gs.is-in .gs-scrim { opacity: 1; }
.gs.is-in .gs-box { opacity: 1; transform: none; }
.gs-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid rgba(16,32,52,.08); }
.gs-in > .ic { width: 22px; height: 22px; color: #1A5DB4; flex: none; }
.gs-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 19px/1.3 var(--body); color: var(--ink); -webkit-appearance: none; appearance: none; }
.gs-in input::-webkit-search-cancel-button { display: none; }
.gs-esc { flex: none; padding: 5px 9px; border: 0; border-radius: 8px; background: rgba(16,32,52,.06); font: 600 12px/1 var(--body); color: var(--ink-3); cursor: pointer; }
.gs-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 18px 4px; }
.gs-chips:empty { display: none; }
.gs-lbl { width: 100%; margin: 2px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.gs-lbl:not(:first-child) { margin-top: 8px; }
.gs-chips button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #D3E3F6; border-radius: 999px; background: #F3F8FE; font: 600 13px/1 var(--body); color: #1A5DB4; cursor: pointer; transition: background .2s, color .2s; }
.gs-chips button:hover { background: #1A5DB4; color: #fff; }
.gs-chips button .ic { width: 14px; height: 14px; }
.gs-res { overflow-y: auto; padding: 6px 10px 14px; overscroll-behavior: contain; }
.gs-res section + section { margin-top: 6px; }
.gs-res h3 { display: flex; align-items: center; gap: 8px; margin: 10px 8px 6px; font: 700 12px/1 var(--body); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.gs-res h3 .ic { width: 15px; height: 15px; color: #1A5DB4; }
.gs-res h3 em { font-style: normal; margin-left: auto; padding: 3px 8px; border-radius: 8px; background: rgba(16,32,52,.06); }
.gs-r { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; color: var(--ink); }
.gs-r.is-sel, .gs-r:hover { background: #EAF1F9; }
.gs-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.gs-ic .ic { width: 18px; height: 18px; }
.gs-t b { display: block; font: 600 14.5px/1.3 var(--body); color: var(--navy-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-t small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-src { font-size: 11.5px; font-weight: 700; color: var(--ink-3); padding: 3px 8px; border-radius: 7px; background: rgba(16,32,52,.05); }
.gs-hint, .gs-nil { margin: 8px; font-size: 13.5px; color: var(--ink-3); }
.gs-more { display: inline-flex; align-items: center; gap: 6px; margin: 6px 10px 0; font-size: 13.5px; font-weight: 600; color: #1A5DB4; }
.gs-more .ic { width: 15px; height: 15px; }
html.gs-open { overflow: hidden; }
@media (max-width: 699px) {
  .gs { padding: 10px 8px; }
  .gs-box { max-height: calc(100dvh - 20px); border-radius: 20px; }
  .gs-in input { font-size: 17px; }
  .gs-src { display: none; }
}
@media (prefers-reduced-motion: reduce) { .gs-box, .gs-scrim { transition: none; } }

/* ---------- layar masuk: peta titik Indonesia ---------- */
.signin { background: radial-gradient(120% 90% at 30% 110%, #1A5DB4 0%, #0D3D82 38%, #071F45 72%, #04142E 100%); }
.si-map { position: fixed; inset: 0; z-index: 0; opacity: 0; transition: opacity 1.4s cubic-bezier(.16,1,.3,1); pointer-events: none; }
.si-ready .si-map { opacity: 1; }
.si-shade { background: linear-gradient(180deg, rgba(4,20,46,.55) 0%, rgba(4,20,46,0) 32%, rgba(4,20,46,0) 78%, rgba(4,20,46,.5) 100%) !important; }
.si-copy { text-shadow: none; }
.si-road span { color: #9CC8FF; }
.si-count { margin: 22px 0 0; display: inline-flex; align-items: baseline; gap: 8px; font: 500 14px/1.3 var(--body); color: rgba(220,234,255,.8); }
.si-count b { font: 700 22px/1 var(--head); color: #fff; letter-spacing: -.01em; }
@media (min-width: 900px) { .si-head { margin-top: 0; padding-top: clamp(24px, 7vh, 80px); } .si-count { margin-top: auto; } }
@media (max-width: 899px) { .si-count { margin-top: auto; } }
.si-card { background: rgba(255,255,255,.9); }
@media (max-width: 899px) { .si-head { margin-top: clamp(20px, 5vh, 48px); } }

/* panah lipat di tengah tepi sidebar (menggantikan tombol "Lipat menu" di bawah) */
.nav-handle { display: none; }
@media (min-width: 700px) {
  .nav-handle {
    display: grid; place-items: center; position: fixed; z-index: 45; top: 50%; left: var(--nav-w);
    width: 22px; height: 46px; margin: 0; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
    transform: translate(-50%, -50%); color: var(--ink-3);
    background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(12px) saturate(170%); backdrop-filter: blur(12px) saturate(170%);
    box-shadow: 0 0 0 .5px rgba(16,32,52,.12), 0 6px 16px -6px rgba(16,32,52,.35);
    transition: left .5s cubic-bezier(.32,.72,0,1), color .2s, background .2s, width .25s cubic-bezier(.32,.72,0,1);
  }
  .nav-handle::before { content: ""; position: absolute; inset: -8px -12px; } /* area sentuh lebih lebar untuk iPad */
  .nav-handle svg { width: 15px; height: 15px; }
  .nav-handle .nh-chev { transition: transform .5s cubic-bezier(.32,.72,0,1); transform-origin: 12px 12px; }
  .nav-handle:hover, .nav-handle:focus-visible { color: #fff; background: var(--navy-ink); width: 26px; }
  html.nav-mini .nav-handle .nh-chev { transform: scaleX(-1); }
  /* logo di tengah saat dilipat */
  html.nav-mini .nav-brand .nb-mark { left: 50%; transform: translateX(-50%); }
  .nav-end:empty { display: none; }
}
html.no-anim .nav-handle, html.no-anim .nav-handle * { transition: none !important; }
