/* Winstore Insight — Premium Shell CSS (sidebar kiri)
   Palet mengikuti styles.css Winstore: --bg #07111f, accent #22d3ee/#38bdf8.
   Aktif HANYA saat body.ws-premium (dipasang premium-shell.js).
   login.html tidak memuat shell → tidak terpengaruh. */

/* ── Anti-FOUC: sembunyikan body sampai shell selesai wrap ──────────
   Class ws-boot dipasang inline script di <head>; premium-shell.js
   menghapusnya di akhir buildShell. Tanpa ini tiap pindah halaman
   terlihat layout lama dulu baru lompat ke layout sidebar. */
html.ws-boot body { visibility: hidden; }

/* ── Layout shell ─────────────────────────────────────────── */
body.ws-premium .ws-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}
body.ws-premium .ws-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.ws-premium .ws-content {
  flex: 1;
  min-width: 0;
  padding: 20px 28px 48px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Konten existing Winstore memakai .container/.page-header selebar 1280px
   dengan margin auto — di dalam shell lebar kolom lebih sempit, jadi
   paksa full-width relatif ke .ws-content agar tidak overflow. */
body.ws-premium .ws-content > .container,
body.ws-premium .ws-content > .page-header {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
body.ws-premium .ws-content .table-wrap {
  max-width: 100%;
}
body.ws-premium .ws-content table {
  max-width: 100%;
}
body.ws-premium .ws-content img,
body.ws-premium .ws-content canvas {
  max-width: 100%;
}

/* Legacy top-nav disembunyikan — node TETAP ada (kompatibilitas nav.js). */
body.ws-premium #si-nav {
  display: none !important;
}

/* ── Sidebar ──────────────────────────────────────────────── */
body.ws-premium .ws-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0a1322 0%, #0a1020 55%, #0c1428 100%);
  border-right: 1px solid var(--border);
  z-index: 60;
}
body.ws-premium .ws-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
}
body.ws-premium .ws-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #082f49;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
body.ws-premium .ws-brand-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}
body.ws-premium .ws-brand-sub {
  font-size: 11px;
  color: var(--muted);
}
body.ws-premium .ws-nav {
  flex: 1;
  padding: 12px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.ws-premium .ws-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 10px 5px;
}
body.ws-premium .ws-section-label:first-child {
  padding-top: 4px;
}
body.ws-premium .ws-link {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  line-height: 1.4;
}
body.ws-premium .ws-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}
body.ws-premium .ws-link.active {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
  font-weight: 600;
}
body.ws-premium .ws-foot {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.ws-premium .ws-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.ws-premium .ws-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.15);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}
body.ws-premium .ws-user-meta {
  min-width: 0;
}
body.ws-premium .ws-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.ws-premium .ws-user-role {
  font-size: 11px;
  color: var(--muted);
}
body.ws-premium .ws-logout {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
body.ws-premium .ws-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ── Topbar ───────────────────────────────────────────────── */
body.ws-premium .ws-topbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 28px 6px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}
body.ws-premium .ws-topbar-text {
  min-width: 0;
}
body.ws-premium .ws-eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
body.ws-premium .ws-topbar-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}
body.ws-premium .ws-topbar-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 860px;
}
body.ws-premium .ws-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
body.ws-premium .ws-sidebar-backdrop {
  display: none;
}

/* Blok judul dalam .page-header (eyebrow + h1 + subtitle) disembunyikan —
   topbar shell sudah menampilkan judul yang sama dari META. Blok filter
   (.header-actions) dibiarkan tampil sebagai strip filter halaman.
   Node tetap di DOM: ai-chat.js getPageText() dan hints.js tetap baca h1. */
body.ws-premium .ws-content .page-header {
  padding: 6px 0 14px;
}
body.ws-premium .ws-content .page-header > div:not(.header-actions) {
  display: none;
}

/* ── ai-chat.js harus tetap di atas sidebar ────────────────── */
body.ws-premium .ai-chat-root {
  z-index: 1000 !important;
}

/* ── Responsif mobile ─────────────────────────────────────── */
@media (max-width: 900px) {
  body.ws-premium .ws-shell {
    grid-template-columns: 1fr;
  }
  body.ws-premium .ws-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 84vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    height: 100dvh;
  }
  body.ws-premium .ws-sidebar.open {
    transform: translateX(0);
  }
  body.ws-premium .ws-menu-btn {
    display: inline-block;
  }
  body.ws-premium .ws-sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 55;
  }
  body.ws-premium .ws-content {
    padding: 14px 14px 40px;
  }
  body.ws-premium .ws-topbar {
    padding: 16px 14px 4px;
  }
  body.ws-premium .ws-topbar-title {
    font-size: 19px;
  }
}
