/* ══════════════════════════════════════════════════════════════════════════════
   ShiftHR — Layout
   ──────────────────────────────────────────────────────────────────────────────
   App shell structure: sidebar, main content area, page headers, and nav-level UI
   (lock icons, etc.). Not feature-specific. (Home's local-Development banner is the
   kit's Banner since #1038.)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── App Shell Layout (Pass B kit-shells — standard density, #634) ─────────── */
/* The shell paints the page's background itself (Feature GS, #1364, need 14: the Dashboard's dark background stopped
   part-way down): the shell carries the theme, so its own background follows it to the foot of every page. */
.app-shell { display: flex; min-height: 100vh; background: var(--color-neutral-50); }

.app-sidebar {
    width: var(--sidebar-width); flex-shrink: 0;
    background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    border-right: 1px solid var(--sidebar-border);
    transition: background var(--duration-normal) var(--ease-standard);
}
/* A dialog opened from the sidebar (the Onboarding block's skip, FWD-4, #1240): position: sticky makes the sidebar its
   own stacking layer, so the kit Modal's 1000 counted only inside it and the page's positioned cards, the scrim and
   the spotlight painted over the open dialog. The sidebar rises to the Modal's layer while it holds one open. */
.app-sidebar:has(.shui-modal-overlay) { z-index: 1000; }
.sidebar-brand { display: flex; flex-direction: column; gap: 4px; padding: var(--space-5) var(--space-4) var(--space-4); border-bottom: 1px solid var(--sidebar-border); }
.sidebar-brand > a { display: inline-flex; align-items: center; }
/* The workspace switcher under the mark (MW2-A (a), #1143): the kit's NativePopover button, and in its panel the
   workspace the connection holds, marked and never a link (the other entries are the kit's own items). */
.sidebar-workspace-switch { align-self: flex-start; margin-top: var(--space-2); }
.workspace-switch-current { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 0; padding: 7px 10px; font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--color-neutral-900); overflow-wrap: anywhere; }
.workspace-switch-current-tag { font-size: var(--text-xs); font-weight: var(--font-normal); color: var(--color-neutral-600); }

.sidebar-nav { flex: 1; padding: var(--space-3) var(--space-2); display: flex; flex-direction: column; gap: 2px; }
/* The row's look whatever element wears it: the page's font and line height, which a button does not inherit (OB4-Q2 (a)). */
.sidebar-nav a, .shui-nav-item { display: flex; align-items: center; gap: var(--space-3); padding: 9px 10px; border-radius: var(--radius-sm); font-family: inherit; font-size: var(--text-base); font-weight: var(--font-medium); line-height: inherit; color: var(--sidebar-text-muted); transition: background var(--duration-fast), color var(--duration-fast); cursor: pointer; }
.sidebar-nav a:hover, .shui-nav-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text); }
.sidebar-nav a.active, .shui-nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: var(--font-semibold); }
/* A locked row with no destination: the kit's still inert control wearing the row's look, so it draws like its
   neighbours (B5, 3 November 2026); the kit keeps its dim, its cursor and its padlock. */
.sidebar-nav .shui-locked-still > .shui-nav-item { flex: 1 1 auto; width: 100%; background: none; border: 0; text-align: left; }
/* A row's icon: the kit's Icon at the side menu's 18px (IconSize.Md), slightly dimmed beside its label. */
.nav-icon { opacity: .85; }
.nav-section-label { font-size: var(--text-xs); font-weight: var(--font-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--sidebar-text-subtle); padding: var(--space-4) 10px var(--space-1); }

.sidebar-user { padding: var(--space-3) var(--space-3); border-top: 1px solid var(--sidebar-border); display: flex; flex-direction: column; gap: var(--space-2); }
.user-name { font-size: var(--text-sm); color: var(--sidebar-text-muted); font-weight: var(--font-medium); }
/* The Guide (the tour's part 2, DP-8 (a)): its button above the member's name in every sidebar mode,
   and the one line saying what it does on this page. */
.sidebar-guide { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); padding-bottom: var(--space-2); border-bottom: 1px solid var(--sidebar-border); }
.sidebar-guide-line { font-size: var(--text-xs); color: var(--sidebar-text-muted); }

.app-main { flex: 1; background: var(--color-neutral-50); overflow-y: auto; }
.app-content { max-width: var(--content-max-width); margin: 0 auto; padding: var(--content-padding); }

/* ── The shell under 768px (#1303; the owner, 15 November 2026) ───────────────
   The kit's SideMenu puts the side menu away behind its bar, so the page has the whole width: the shell stacks
   (the bar, then the page), the page's padding steps down, and the bar carries the mark the menu's own brand
   block would repeat (the block stays only for a business title or the workspace switcher). A focus move lands below the bar, and the page holds still behind an open menu. */
@media (max-width: 767.98px) {
    html:has(.app-shell) { scroll-padding-top: 56px; }
    html:has(.shui-sidemenu.is-open) { overflow: hidden; }
    .app-shell { display: block; }
    .sidebar-brand > a { display: none; }
    .sidebar-brand:not(:has(> :not(a))) { display: none; }
    /* Nothing pushes the page sideways (need 11 and 14): a wide part scrolls inside itself (the kit's DataGrid), so the
       bar stays in reach and the background fills the width. clip, never hidden: no scroll box, so the bar stays sticky. */
    .app-main { overflow-y: visible; overflow-x: clip; }
    .app-content { padding: var(--space-5) var(--space-4); overflow-wrap: break-word; }
}

/* ── Page Headers ──────────────────────────────────────────────────────────── */
.page-header { margin-bottom: var(--space-7); }
/* Explicit theme-aware text colour — defect #411 (dark-mode invisibility on
   "My Settings" title); kit type scale. */
.page-header h1 { font-size: var(--text-3xl); font-weight: var(--font-semibold); letter-spacing: var(--tracking-tight); color: var(--color-neutral-900); }
.page-sub { color: var(--color-neutral-500); font-size: var(--text-md); margin-top: var(--space-1); }

/* ── Error Page ────────────────────────────────────────────────────────────── */
.error-details { margin-top: 16px; }
.error-details summary { cursor: pointer; color: var(--color-neutral-500, #888); font-size: .85rem; }
.error-details pre {
    margin-top: 8px; padding: 12px; background: var(--color-surface-sunken, #f5f5f5);
    border-radius: 6px; font-size: .8rem; overflow-x: auto; white-space: pre-wrap;
    max-height: 400px; overflow-y: auto;
}
