/* Shell: demo banner, shell bar, side navigation, page header (Fiori dynamic page header). */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 999; background: var(--c-brand); color: #fff; padding: var(--sp-2) var(--sp-4); }
.skip-link:focus { left: var(--sp-2); }

.demo-banner { display: flex; align-items: center; gap: var(--sp-2); background: var(--kz-navy); color: #fff; font-size: var(--fs-xs); padding: 0.3rem var(--page-gutter); line-height: var(--lh-snug); }
.demo-banner svg { width: 0.9rem; height: 0.9rem; }
.demo-banner .grow { flex: 1 1 auto; min-width: 0; }
.demo-banner a { color: #b9dcff; font-weight: var(--fw-semibold); white-space: nowrap; }
@media (max-width: 599.98px) { .demo-banner .hide-s { display: none; } }

/* ── Shell bar */
.shellbar { position: sticky; top: 0; z-index: var(--z-shell); height: var(--shell-h); display: flex; align-items: center; gap: var(--sp-2); padding-inline: var(--sp-2) var(--sp-4); background: var(--c-bg); border-bottom: 1px solid var(--c-border-strong); box-shadow: var(--sh-header); }
.shellbar-brand { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--c-text); min-width: 0; }
.shellbar-brand:hover { text-decoration: none; }
.shellbar-logo { height: 1.6rem; width: auto; }
.shellbar-title { font-weight: var(--fw-bold); font-size: var(--fs-md); white-space: nowrap; }
.shellbar-co { display: inline-flex; align-items: center; gap: var(--sp-2); margin-inline-start: var(--sp-2); padding: 0.3rem 0.6rem 0.3rem 0.75rem; border: 1px solid var(--c-border-button); border-radius: var(--r-button); background: var(--c-bg); color: var(--c-text); max-width: 20rem; min-width: 0; }
.shellbar-co:hover { background: var(--c-hover); }
.shellbar-co .co-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--co-color, var(--c-brand)); flex: none; }
.shellbar-co .co-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: var(--fw-semibold); }
.shellbar-co svg { width: 0.9rem; height: 0.9rem; color: var(--c-icon-muted); }
.shellbar-spacer { flex: 1 1 auto; }
.shellbar-search { position: relative; width: min(24rem, 30vw); }
.shellbar-search > svg { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--c-icon-muted); pointer-events: none; }
.shellbar-search input { width: 100%; height: 2.25rem; padding: 0 0.75rem 0 2.1rem; border: 1px solid var(--c-border-button); border-radius: var(--r-button); background: var(--c-bg-subtle); }
.shellbar-search input:focus { background: var(--c-bg); border-color: var(--c-brand); outline: none; box-shadow: 0 0 0 1px var(--c-brand); }
.search-pop { position: absolute; top: calc(100% + 0.35rem); left: 0; right: 0; min-width: 24rem; background: var(--c-surface); box-shadow: var(--sh-2); border-radius: var(--r-popover); padding: var(--sp-1); max-height: 70vh; overflow-y: auto; z-index: var(--z-popover); }
.search-group-label { font-size: var(--fs-2xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--c-text-label); padding: var(--sp-2) var(--sp-3) var(--sp-1); }
.search-item { display: flex; align-items: center; gap: var(--sp-3); padding: 0.45rem var(--sp-3); border-radius: var(--r-field); color: var(--c-text); }
.search-item:hover, .search-item.is-active { background: var(--c-hover); text-decoration: none; }
.search-item svg { width: 1rem; height: 1rem; color: var(--c-icon-muted); }
.search-item .si-sub { color: var(--c-text-label); font-size: var(--fs-xs); margin-inline-start: auto; white-space: nowrap; }
.shell-btn { position: relative; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: var(--r-button); background: transparent; color: var(--c-icon); }
.shell-btn:hover { background: var(--c-hover); }
.shell-btn svg { width: 1.15rem; height: 1.15rem; }
.shell-btn .badge { position: absolute; top: 0.05rem; right: 0; min-width: 1.05rem; height: 1.05rem; font-size: 0.625rem; padding: 0 0.25rem; }
.shell-ai { display: inline-flex; align-items: center; gap: var(--sp-2); height: 2.25rem; padding: 0 0.8rem; border: 0; border-radius: var(--r-pill); background: linear-gradient(135deg, #5d36ff, #0070f2); color: #fff; font-weight: var(--fw-bold); }
.shell-ai svg { width: 1rem; height: 1rem; }
.shell-ai:hover { filter: brightness(1.08); }
.shellbar-avatar { border: 0; background: none; padding: 0.15rem; border-radius: 50%; margin-inline-start: var(--sp-1); }
.shellbar-avatar:hover .avatar { box-shadow: 0 0 0 2px var(--c-brand); }
.shell-burger { display: none; }
@media (max-width: 1023.98px) { .hide-burger { display: none !important; } }
@media (max-width: 1023.98px) {
  .shell-burger { display: inline-grid; }
  .shellbar-search { width: 2.25rem; }
  .shellbar-search input { width: 2.25rem; padding: 0; color: transparent; cursor: pointer; background: transparent; border-color: transparent; }
  .shellbar-search.is-open { position: absolute; left: var(--sp-2); right: var(--sp-2); width: auto; top: 0.5rem; z-index: 5; }
  .shellbar-search.is-open input { width: 100%; padding: 0 0.75rem 0 2.1rem; color: inherit; background: var(--c-bg); border-color: var(--c-brand); cursor: text; }
  .shell-ai span { display: none; }
  .shell-ai { width: 2.25rem; padding: 0; justify-content: center; }
}
@media (max-width: 599.98px) {
  .shellbar { padding-inline: var(--sp-1) var(--sp-2); gap: 0.15rem; }
  .shellbar-title, .shellbar-help { display: none; }
  .shellbar-co { max-width: 9.5rem; margin-inline-start: var(--sp-1); padding-inline: 0.5rem; }
  .shellbar-logo { height: 1.3rem; }
  .search-pop { min-width: 0; }
}

/* ── Workbench grid */
.wb { flex: 1 1 auto; display: grid; grid-template-columns: var(--sidenav-w) minmax(0, 1fr); min-height: calc(100dvh - var(--shell-h)); }
.wb.is-collapsed { grid-template-columns: var(--sidenav-w-collapsed) minmax(0, 1fr); }
.wb-plain { grid-template-columns: minmax(0, 1fr); }
.sidenav { position: sticky; top: var(--shell-h); height: calc(100dvh - var(--shell-h)); overflow-y: auto; border-right: 1px solid var(--c-border-strong); background: var(--c-bg); padding: var(--sp-3) var(--sp-2) 4rem; display: flex; flex-direction: column; gap: var(--sp-1); }
.nav-group { display: flex; flex-direction: column; }
.nav-group + .nav-group { margin-top: var(--sp-1); }
.nav-group-head { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 2.5rem; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-button); background: none; color: var(--c-text); text-align: left; font-weight: var(--fw-semibold); }
.nav-group-head:hover { background: var(--c-hover); }
.nav-group-head > svg:first-child { width: 1.2rem; height: 1.2rem; }
.nav-group-head .chev { margin-left: auto; width: 0.9rem; height: 0.9rem; color: var(--c-icon-muted); transition: transform var(--dur) var(--ease); }
.nav-group.is-open .nav-group-head .chev { transform: rotate(90deg); }
.nav-group.has-active > .nav-group-head { color: var(--c-selected); }
.nav-group.has-active > .nav-group-head > svg:first-child { color: var(--c-selected); }
.nav-sub { list-style: none; margin: 0; padding: 0 0 var(--sp-1); display: none; flex-direction: column; gap: 1px; }
.nav-group.is-open .nav-sub { display: flex; }
.nav-item { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-3) 0 2.85rem; min-height: 2.1rem; border-radius: var(--r-button); color: var(--c-text); font-size: var(--fs-sm); }
.nav-item:hover { background: var(--c-hover); text-decoration: none; }
.nav-item.is-active { background: var(--c-selected-bg); color: var(--c-selected); font-weight: var(--fw-bold); }
.nav-item.is-active::before { content: ''; position: absolute; left: -0.5rem; top: 0.35rem; bottom: 0.35rem; width: 3px; border-radius: 2px; background: var(--c-brand); }
.nav-item.is-top { padding-left: var(--sp-3); min-height: 2.5rem; font-weight: var(--fw-semibold); }
.nav-item.is-top svg { width: 1.2rem; height: 1.2rem; }
.nav-item.is-disabled { color: var(--c-text-disabled); }
.nav-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sep { height: 1px; background: var(--c-border); margin: var(--sp-2) var(--sp-3); }
.nav-caption { font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-text-label); padding: var(--sp-2) var(--sp-3) var(--sp-1); }
.nav-foot { margin-top: auto; padding: var(--sp-3); border-top: 1px solid var(--c-border); font-size: var(--fs-xs); color: var(--c-text-label); line-height: var(--lh-snug); }
.wb.is-collapsed .nav-label, .wb.is-collapsed .nav-foot, .wb.is-collapsed .nav-caption, .wb.is-collapsed .nav-sub, .wb.is-collapsed .nav-group-head .chev, .wb.is-collapsed .nav-group-head span { display: none; }
.wb.is-collapsed .nav-group-head, .wb.is-collapsed .nav-item.is-top { justify-content: center; padding: 0; }
.nav-scrim { display: none; }
.wb-main { min-width: 0; outline: none; display: flex; flex-direction: column; }
@media (max-width: 1023.98px) {
  .wb, .wb.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: fixed; z-index: var(--z-drawer); top: 0; bottom: 0; left: 0; height: 100dvh; width: min(18rem, 86vw); transform: translateX(-105%); transition: transform var(--dur) var(--ease); box-shadow: var(--sh-3); padding-top: var(--sp-4); }
  .wb.is-drawer-open .sidenav { transform: none; }
  .wb.is-drawer-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: rgba(19, 30, 41, 0.42); }
  .wb.is-collapsed .nav-label, .wb.is-collapsed .nav-foot, .wb.is-collapsed .nav-caption, .wb.is-collapsed .nav-group-head span { display: revert; }
  .wb.is-collapsed .nav-group.is-open .nav-sub { display: flex; }
}

/* ── Page header (Fiori dynamic page) */
.ph { background: var(--c-bg); border-bottom: 1px solid var(--c-border); padding: var(--sp-4) var(--page-gutter) 0; }
.ph-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: var(--fs-xs); color: var(--c-text-label); margin-bottom: var(--sp-2); }
.ph-crumbs a { color: var(--c-link); }
.ph-crumbs svg { width: 0.75rem; height: 0.75rem; color: var(--c-icon-muted); }
.ph-row { display: flex; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; padding-bottom: var(--sp-4); }
.ph-icon { flex: none; width: 3rem; height: 3rem; border-radius: var(--r-element); display: grid; place-items: center; background: var(--tone-bg, var(--c-selected-bg)); color: var(--tone-el, var(--c-brand)); }
.ph-icon svg { width: 1.5rem; height: 1.5rem; }
.ph-titles { flex: 1 1 22rem; min-width: 0; }
.ph-title { font-size: var(--fs-xl); font-weight: var(--fw-bold); display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.ph-sub { color: var(--c-text-label); margin-top: 0.25rem; }
.ph-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.ph-attrs { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-8); padding-bottom: var(--sp-4); }
.ph-attr { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.ph-attr-label { font-size: var(--fs-xs); color: var(--c-text-label); }
.ph-attr-value { font-weight: var(--fw-semibold); }
.ph-attr-value.big { font-size: var(--fs-lg); font-weight: var(--fw-regular); }
.ph-tabs { display: flex; gap: var(--sp-6); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--page-gutter) * -1); padding: 0 var(--page-gutter); }
.ph-tabs::-webkit-scrollbar { display: none; }
.ph-tab { position: relative; padding: var(--sp-3) 0; border: 0; background: none; color: var(--c-text); white-space: nowrap; font-weight: var(--fw-regular); }
.ph-tab:hover { color: var(--c-selected); text-decoration: none; }
.ph-tab.is-active { color: var(--c-selected); font-weight: var(--fw-bold); }
.ph-tab.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--c-brand); }
.ph-tab .count { color: var(--c-text-label); font-weight: var(--fw-regular); margin-left: 0.25rem; }
.page { padding: var(--sp-6) var(--page-gutter) var(--sp-16); width: 100%; max-width: var(--content-max); margin-inline: auto; min-width: 0; flex: 1 1 auto; }
.page-wide { max-width: none; }
.footer-bar { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-2) var(--page-gutter); background: var(--c-bg); border-top: 1px solid var(--c-border-strong); box-shadow: 0 -0.125rem 0.25rem rgba(34, 53, 72, 0.08); }
.footer-bar .grow { flex: 1 1 auto; display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }

@media print {
  .demo-banner, .shellbar, .sidenav, .footer-bar, .no-print, .toast-host { display: none !important; }
  .wb { display: block; }
  body { background: #fff; }
}
