/* Crickstore layout: stationary shell, sidebar, header, and mobile drawer. */
html,
body {
  height: 100%;
  overflow: hidden;
}

body.login-page {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
}

.shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  height: 100%;
  padding: var(--space-7) var(--space-5) var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--pitch);
  color: var(--cream);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.05em;
}

.brand:hover {
  color: var(--cream);
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: inset 0 0 0 2px var(--pitch-deep);
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 14px;
  width: 2px;
  height: 24px;
  border-radius: 2px;
  background: var(--pitch-deep);
  transform: rotate(24deg);
}

.brand-dot {
  color: var(--lime);
}

.workspace {
  margin: var(--space-8) var(--space-3) var(--space-4);
  color: #a7bcb4;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.desktop-navigation {
  flex: 1 0 auto;
}

.workspace-navigation {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group {
  margin: 0;
  padding: 0;
}

.nav-group + .nav-group {
  margin-top: var(--space-2);
}

.nav-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: 6px;
  color: #a7bcb4;
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.13em;
  list-style: none;
  text-transform: uppercase;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: rotate(-45deg);
  transition: transform var(--ease);
}

.nav-group[open] > summary::after {
  transform: rotate(45deg);
}

.nav-group > summary:hover {
  color: var(--cream);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 7px;
  color: #d3dfda;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  transition: background var(--ease), color var(--ease);
}

.nav-item:hover {
  background: rgb(255 255 255 / 8%);
  color: var(--cream);
}

.nav-item[aria-current="page"],
.nav-item.selected {
  background: var(--lime);
  color: var(--pitch);
  font-weight: 650;
}

.nav-label {
  margin: var(--space-5) var(--space-3) var(--space-2);
  color: #a7bcb4;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: var(--space-7);
  padding: var(--space-4) var(--space-3) 0;
  border-top: 1px solid rgb(255 255 255 / 14%);
  color: #c4d3cd;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.sidebar-footer small {
  display: block;
  margin-top: 4px;
  color: #8da79d;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--lime);
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 72px;
  padding: 12px clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-context {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.header-context > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
}

.breadcrumb a {
  color: var(--turf);
}

.breadcrumb a:hover {
  color: var(--pitch);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.mobile-menu-button {
  display: none;
}

.jump-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper-raised);
  color: var(--muted);
  font-size: var(--text-sm);
}

.jump-trigger:hover {
  border-color: var(--turf);
  color: var(--pitch);
}

.jump-trigger kbd {
  padding: 1px 6px;
  font-size: 0.7rem;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: 1.3;
}

.account small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.account-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--pitch);
  color: var(--lime);
  font-family: var(--font-display);
  font-weight: 700;
}

.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(24px, 3vw, 40px);
}

.page-footer {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(24px, 3vw, 40px) var(--space-7);
  color: var(--muted);
  font-size: var(--text-xs);
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgb(8 43 33 / 52%);
}

.mobile-drawer.is-open {
  display: block;
}

.drawer-panel {
  display: flex;
  flex-direction: column;
  width: min(340px, 88vw);
  height: 100%;
  padding: var(--space-6) var(--space-5);
  overflow-y: auto;
  background: var(--pitch);
  color: var(--cream);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--cream);
}

.drawer-close:hover {
  background: rgb(255 255 255 / 10%);
}

.drawer-panel .workspace-navigation {
  flex: 1 0 auto;
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 248px;
  }

  .sidebar {
    padding-inline: var(--space-4);
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: hidden;
  }

  .shell {
    flex-direction: column;
  }

  .sidebar {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--paper-raised);
    color: var(--pitch);
  }

  .main {
    flex: 1;
    height: auto;
  }

  .header {
    min-height: 64px;
    padding: 10px 16px;
  }

  .header-context > span:first-child {
    display: none;
  }

  .account-name,
  .account form {
    display: none;
  }

  .jump-trigger {
    padding: 6px;
  }

  .jump-trigger span {
    display: none;
  }

  .content {
    padding: 20px 16px 28px;
  }

  .page-footer {
    padding: 0 16px 24px;
  }
}

@media (max-width: 420px) {
  .content {
    padding-inline: 12px;
  }

  .header {
    gap: 8px;
  }

  .header-actions {
    gap: 8px;
  }
}
