/* ==========================================================================
   Sample Dashboard v2 — shell layout.
   Sidebar (.sb-), topbar (.tb-), and the main content column. Tokens and
   primitives come from base.css; this file owns structure and responsive
   collapse only.
   ========================================================================== */

.v2-shell {
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100vh;
  align-items: start;
}
.v2-shell > * {
  /* Grid items default to min-width:auto; without this an item's intrinsic
     width props the 1fr track open and the page overflows on small screens. */
  min-width: 0;
}

.main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-140%);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
}

.sample-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px clamp(20px, 3vw, 36px);
  border-bottom: 1px solid rgba(231, 161, 132, 0.22);
  background: rgba(204, 128, 102, 0.12);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.sample-banner__tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid rgba(231, 161, 132, 0.36);
  border-radius: var(--r-pill);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Sidebar ---------- */
.sb-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 20px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.sb-logo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px 8px 6px;
}
.sb-logo__word {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.sb-logo__accent {
  color: var(--accent-bright);
}
.sb-logo__tag {
  margin: 0;
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.nav__icon {
  flex: none;
  width: 18px;
  height: 18px;
}
.nav__link:hover {
  color: var(--ink);
  background: var(--panel-2);
}
.nav__link[aria-current="page"] {
  color: var(--accent-bright);
  background: var(--accent-soft);
}
.nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: var(--r-pill);
  background: var(--accent-bright);
}

.sb-spacer {
  flex: 1;
}

/* ---------- Sidebar cards ---------- */
.sb-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
}
.sb-card--retest .sb-card__big {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sb-card__icon {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--accent-bright);
}
.sb-card__cta {
  margin-top: 4px;
  width: 100%;
}

.sb-card--profile {
  grid-template-columns: 40px 1fr;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
}
.sb-profile__avatar {
  grid-row: 1 / span 4;
  width: 40px;
  height: 40px;
}
.sb-profile__info {
  display: grid;
  gap: 1px;
}
.sb-profile__name {
  margin: 0 0 2px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.sb-profile__info p {
  margin: 0;
  line-height: 1.4;
}

/* ---------- Topbar ---------- */
.tb-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 3vw, 36px);
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.tb-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.tb-title {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.tb-meta {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* ---------- Main content ---------- */
.content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .v2-shell {
    grid-template-columns: 204px 1fr;
  }
}

@media (max-width: 880px) {
  .v2-shell {
    grid-template-columns: 1fr;
  }
  .sb-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sb-logo {
    padding: 0;
    flex: none;
  }
  .sb-logo__tag {
    display: none;
  }
  .sb-nav {
    flex-direction: row;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sb-nav::-webkit-scrollbar {
    display: none;
  }
  .nav__link {
    flex: none;
    white-space: nowrap;
  }
  .nav__link[aria-current="page"]::before {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: -2px;
    width: auto;
    height: 3px;
  }
  .sb-spacer,
  .sb-card--retest,
  .sb-card--profile {
    display: none;
  }
  .tb-topbar {
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-soft);
  }
}

@media (max-width: 640px) {
  .tb-topbar {
    flex-wrap: wrap;
  }
  .tb-actions {
    width: 100%;
    justify-content: space-between;
    /* Three items here (two chips + share) vs the client dashboards' two —
       without wrapping the row overflows a 375px viewport by ~13px. */
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .tb-share__label {
    display: none;
  }
  #share-report {
    padding: 9px 11px;
  }
}
