/* ─── App Shell Layout ───────────────────────────────────────────────────── */
/* Dùng chung cho mọi page: topbar + sidebar + main                           */

.app-topbar {
  background-color: var(--color-bg-surface);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--color-border);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 10px;
  justify-content: space-between;
}

.app-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: var(--topbar-height);
}

.app-sidebar {
  z-index: 1000;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  position: sticky;
  top: var(--topbar-height);
  background-color: var(--color-bg-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.app-main {
  background-color: var(--color-bg-surface);
  width: min(var(--main-max-width), calc(100vw - var(--sidebar-width)));
  padding: var(--spacing-xl);
  min-height: calc(100vh - var(--topbar-height));
}

.app-toggle-btn {
  position: fixed;
  right: 0;
  top: var(--topbar-height);
  border-bottom-left-radius: var(--radius-sm);
  display: none;
  background-color: var(--color-primary);
  color: white;
  padding: 10px;
  z-index: 1001;
  font-size: 16px;
}

@media (max-width: 816px) {
  .app-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    transform: translateX(-100%);
    border: 1px solid var(--color-border);
  }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { width: 100%; }
  .app-toggle-btn { display: inline-block; }
  .app-topbar-sub { display: none; }
}
