html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Akt, Arial, sans-serif;
  font-size: 0.89rem;
}

#app {
  min-height: 100vh;
}

.app-shell {
  --sidebar-width: 240px;
  --sidebar-icon-slot: 36px;
  --sidebar-gutter: 19px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.app-shell.is-sidebar-collapsed {
  --sidebar-width: 82px;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  overflow: visible;
  box-sizing: border-box;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 10;
  transition: width 180ms ease;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 73px;
  padding: 0 var(--sidebar-gutter);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.shell-brand__mark {
  display: block;
  flex: 0 0 var(--sidebar-icon-slot);
  width: var(--sidebar-icon-slot);
  height: var(--sidebar-icon-slot);
  background: currentColor;
  mask: url('../assets/brand/boyshop-mark.svg') center / contain no-repeat;
  -webkit-mask: url('../assets/brand/boyshop-mark.svg') center / contain no-repeat;
}

.shell-brand__wordmark {
  display: block;
  width: 151px;
  height: 36px;
  background: currentColor;
  mask: url('../assets/brand/boyshop-logo.svg') left center / contain no-repeat;
  -webkit-mask: url('../assets/brand/boyshop-logo.svg') left center / contain no-repeat;
  overflow: hidden;
  white-space: nowrap;
}

.shell-nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem 11px;
}

.shell-nav button,
.shell-utilities button {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: 36px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.shell-nav button {
  padding: 0 19px;
}

.shell-nav button svg,
.shell-utilities button svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[data-sidebar-toggle] svg {
  transition: transform 160ms ease;
}

.app-shell.is-sidebar-collapsed [data-sidebar-toggle] svg {
  transform: rotate(180deg);
}

.shell-nav button span,
.shell-utilities button span {
  overflow: hidden;
  transition: opacity 120ms ease;
  white-space: nowrap;
}

.shell-nav button:hover,
.shell-nav button:focus-visible,
.shell-nav button.is-active {
  border-color: var(--border);
  background: var(--accent);
  color: var(--on-accent);
}

.shell-utilities {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: auto;
  padding: 1rem 11px;
  border-top: 1px solid var(--border);
}

.shell-utilities button {
  padding: 0 19px;
  border-color: var(--border);
  color: var(--text);
}

.shell-user-menu {
  position: relative;
}

.shell-user-menu > button {
  width: 100%;
}

.shell-user-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + .5rem);
  z-index: 120;
  width: 220px;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 26px rgb(0 0 0 / .16);
}

.shell-user-summary,
.shell-user-popover button {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 44px;
  padding: 0 .7rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
}

.shell-user-summary {
  background: var(--surface-raised);
}

.shell-user-summary svg,
.shell-user-popover button svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.shell-user-summary span {
  display: grid;
  gap: .1rem;
  min-width: 0;
}

.shell-user-summary strong {
  font-size: .9rem;
}

.shell-user-summary small {
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 600;
}

.shell-user-popover button {
  margin-top: .35rem;
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.shell-user-popover button:hover,
.shell-user-popover button:focus-visible {
  border-color: var(--border);
  background: var(--surface-raised);
}

.shell-utilities button:hover,
.shell-utilities button:focus-visible {
  background: var(--surface-raised);
}

.app-shell.is-sidebar-collapsed .shell-brand,
.app-shell.is-sidebar-collapsed .shell-nav,
.app-shell.is-sidebar-collapsed .shell-utilities {
  padding-left: var(--sidebar-gutter);
  padding-right: var(--sidebar-gutter);
}

.app-shell.is-sidebar-collapsed .shell-brand {
  gap: 0;
}

.app-shell.is-sidebar-collapsed .shell-brand__wordmark {
  width: 0;
  opacity: 0;
}

.app-shell.is-sidebar-collapsed .shell-nav button,
.app-shell.is-sidebar-collapsed .shell-utilities button {
  flex: 0 0 var(--sidebar-icon-slot);
  gap: 0;
  justify-content: center;
  width: var(--sidebar-icon-slot);
  padding: 0;
}

.app-shell.is-sidebar-collapsed .shell-nav,
.app-shell.is-sidebar-collapsed .shell-utilities {
  align-items: flex-start;
}

.app-shell.is-sidebar-collapsed .shell-user-menu {
  width: var(--sidebar-icon-slot);
}

.app-shell.is-sidebar-collapsed .shell-user-popover {
  right: auto;
  bottom: 0;
  left: calc(100% + .5rem);
  z-index: 120;
}

.app-shell.is-sidebar-collapsed .shell-nav button span,
.app-shell.is-sidebar-collapsed .shell-utilities button span {
  width: 0;
  opacity: 0;
}


.app-viewport {
  min-width: 0;
  min-height: 100vh;
  box-sizing: border-box;
  background: var(--bg);
}

@media (max-width: 760px) {
  .app-shell,
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar {
    transition: none;
  }
}
