/* ============================================================
   NWCB Layout — Two-panel list + detail
   ============================================================ */

/* ---- Page wrapper (below navbar + controls) ---- */
.page-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 105px);   /* navbar ~50px + controls ~55px */
  overflow: hidden;
}

/* ---- Left panel: scrollable item list ---- */
.list-panel {
  overflow-y: auto;
  border-right: 1px solid var(--border-default);
  background: var(--bg-surface);
}

.list-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.9rem;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.list-item:hover {
  background: var(--bg-hover);
}
.list-item.selected {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
}
.list-item .item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.list-count {
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ---- Right panel: detail view ---- */
.detail-panel {
  overflow-y: auto;
  padding: 1.25rem max(1.5rem, calc((100% - 720px) / 2));
}

/* ---- Custom Scrollbars ---- */
.list-panel::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar {
  width: 8px;
}
.list-panel::-webkit-scrollbar-track,
.detail-panel::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
.list-panel::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}
.list-panel::-webkit-scrollbar-thumb:hover,
.detail-panel::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox scrollbar */
.list-panel,
.detail-panel {
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) var(--bg-primary);
}

/* ---- Responsive: mobile stacked layout ---- */
@media (max-width: 768px) {
  .page-body {
    grid-template-columns: 1fr;
    height: auto;
  }

  .list-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-default);
    max-height: 45vh;
    overflow-y: auto;
  }

  .detail-panel {
    min-height: 50vh;
  }

  .controls-bar {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .navbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .navbar-brand {
    width: 100%;
  }

  .landing-grid {
    padding: 1.5rem 1rem;
  }
}
