.app-shell { min-height: 100vh; }
.sidebar { width: var(--sidebar-width); position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; padding: 22px 14px 16px; background: var(--bg-2); border-right: 1px solid var(--border); overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; }
.brand-mark { width: 60px; height: 60px; object-fit: contain; }
.brand-copy { display: grid; line-height: 1.1; letter-spacing: .12em; }
.brand-copy strong { font-size: .85rem; letter-spacing: .14em; }
.brand-copy small { font-size: .59rem; margin-top: 5px; letter-spacing: .24em; }
.sidebar-label { color: var(--subtle); font-size: .64rem; letter-spacing: .15em; font-weight: 800; padding: 10px 12px; }
.nav-list { display: grid; gap: 4px; align-content: start; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.nav-list a, .sidebar-bottom > a { min-height: 42px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; color: var(--muted); border-radius: 9px; transition: background .15s ease, color .15s ease; }
.nav-list a:hover, .sidebar-bottom > a:hover { background: var(--surface); color: var(--text); }
.nav-list a.active, .sidebar-bottom > a.active { background: linear-gradient(90deg, rgba(220,229,240,.12), rgba(220,229,240,.035)); color: var(--text); box-shadow: inset 2px 0 var(--silver); }
.nav-icon { width: 18px; text-align: center; font-size: 1.12rem; color: var(--silver); }
.sidebar-bottom { margin-top: auto; flex: 0 0 auto; }
.sidebar-status { display: flex; align-items: center; gap: 8px; padding: 16px 10px 0; color: var(--muted); font-size: .72rem; }
.status-dot, .connection-pill i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--yellow); }
.status-demo { margin-left: auto; font-size: .62rem; letter-spacing: .08em; color: var(--yellow); }
.main-area { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 76px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); position: sticky; top: 0; z-index: 20; }
.topbar-title { display: grid; gap: 2px; }
.topbar-title strong { font-size: 1rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.page-content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 28px 30px 40px; flex: 1; min-width: 0; }
.app-footer { padding: 18px 30px; display: flex; gap: 18px; justify-content: space-between; color: var(--subtle); border-top: 1px solid var(--border); font-size: .7rem; }
.mobile-only { display: none !important; }

/* Status sistem sidebar mengikuti status koneksi aplikasi */
.sidebar-status.is-live .status-dot {
  background: var(--green, #4ade80);
}
.sidebar-status.is-live .status-demo {
  color: var(--green, #4ade80);
}
.sidebar-status.is-demo .status-dot {
  background: var(--yellow);
}
.sidebar-status.is-demo .status-demo {
  color: var(--yellow);
}
.sidebar-status.is-offline .status-dot {
  background: var(--red, #f87171);
}
.sidebar-status.is-offline .status-demo {
  color: var(--red, #f87171);
}


/* Logo header transparan pada tema terang */
:root[data-theme="light"] .brand-mark {
  filter: invert(1);
}

/* Layar pendek: sidebar dipadatkan agar menu dan Settings tetap terlihat tanpa scroll */
@media (max-height: 900px) {
  .sidebar { padding-top: 14px; padding-bottom: 12px; }
  .brand { padding-bottom: 12px; }
  .brand-mark { width: 46px; height: 46px; }
  .sidebar-label { padding-top: 6px; padding-bottom: 6px; }
  .nav-list { gap: 2px; }
  .nav-list a, .sidebar-bottom > a { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .sidebar-status { padding-top: 10px; }
}
