/* Tombol mode terang dan gelap. Bentuknya mengikuti tombol navigasi sidebar
   supaya ikonnya sejajar dengan ikon menu saat sidebar menyempit. */
.theme-toggle{
  position:relative;z-index:1;flex:none;display:flex;align-items:center;gap:12px;
  width:100%;height:48px;margin:auto 0 6px;padding:0;border:0;border-radius:13px;
  background:transparent;color:#254966;font-weight:700;font-size:13px;text-align:left;
  cursor:pointer;transition:background .2s,color .2s;
}
.theme-toggle + .sidebar-foot{margin-top:0}
.theme-toggle:hover{background:rgba(35,103,188,.11);color:#073576}
.theme-toggle-icon{position:relative;flex:none;display:grid;place-items:center;width:36px;height:36px;margin-left:8px}
.theme-icon{
  position:absolute;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;transition:opacity .25s ease,transform .35s cubic-bezier(.2,.8,.2,1);
}
.theme-icon-moon{opacity:0;transform:rotate(-70deg) scale(.5)}
html[data-theme="dark"] .theme-icon-sun{opacity:0;transform:rotate(70deg) scale(.5)}
html[data-theme="dark"] .theme-icon-moon{opacity:1;transform:none}
.theme-toggle-text{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:1;min-width:0;padding-right:10px;white-space:nowrap}
.theme-toggle-text b{font-weight:700}
.theme-toggle-switch{position:relative;flex:none;width:34px;height:20px;border-radius:99px;background:#c5d3e2;transition:background .25s}
.theme-toggle-switch i{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(9,30,66,.35);transition:transform .25s cubic-bezier(.2,.8,.2,1)}
html[data-theme="dark"] .theme-toggle-switch{background:#4f8ff7}
html[data-theme="dark"] .theme-toggle-switch i{transform:translateX(14px)}

/* Sidebar menyempit: hanya ikon. Teks muncul saat sidebar melebar. */
@media (min-width:621px){
  .app-shell:not(.landing-mode) .sidebar .theme-toggle-text{opacity:0;visibility:hidden;transition:opacity .16s ease,visibility .16s}
  .app-shell:not(.landing-mode) .sidebar:hover .theme-toggle-text,
  .app-shell:not(.landing-mode):not(.sidebar-collapsed) .sidebar .theme-toggle-text{opacity:1;visibility:visible;transition-delay:.08s}
}

/* Tombol ringkas di navigasi landing. */
.theme-toggle--landing{width:38px;height:38px;margin:0;border-radius:11px;justify-content:center;color:#fff;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.08)}
.theme-toggle--landing .theme-toggle-icon{margin:0}
.theme-toggle--landing:hover{background:rgba(255,255,255,.18);color:#fff}

/* Ponsel: sidebar menjadi bilah bawah, tombol tema duduk di ujung kanannya. */
@media (max-width:620px){
  .app-shell:not(.landing-mode) .sidebar{display:flex;flex-direction:row;align-items:flex-start;gap:2px}
  .app-shell:not(.landing-mode) .sidebar #mainNav{flex:1;min-width:0;width:auto}
  .sidebar > .theme-toggle{flex:0 0 46px;width:46px;height:54px;margin:0;justify-content:center;border-radius:9px;color:#c6dcff}
  .sidebar > .theme-toggle:hover{background:rgba(255,255,255,.1);color:#fff}
  .sidebar > .theme-toggle .theme-toggle-icon{margin:0}
  .sidebar > .theme-toggle .theme-toggle-text{display:none}
}

/* Peralihan warna yang halus hanya selama tema diganti. */
html.theme-switching,html.theme-switching *,html.theme-switching *::before,html.theme-switching *::after{
  transition:background-color .28s ease,color .28s ease,border-color .28s ease,fill .28s ease,stroke .28s ease,box-shadow .28s ease !important;
}
