.sg-page {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 56px);
}

.sg-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 56px);
  padding: 1.25rem;
  background: #ffffff;
  border-right: 1px solid var(--alter-border);
  overflow-y: auto;
}

.sg-sidebar-title {
  margin-bottom: 0.875rem;
  color: var(--alter-text);
  font-weight: 700;
}

.sg-sidebar-nav {
  display: grid;
  gap: 0.125rem;
}

.sg-sidebar-nav a {
  padding: 0.45rem 0.625rem;
  color: var(--alter-muted);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8125rem;
}

.sg-sidebar-nav a:hover {
  color: var(--alter-text);
  background: #f4f6fb;
}

.sg-content {
  padding: 2rem;
  max-width: 1180px;
}

.sg-header {
  margin-bottom: 1.5rem;
}

.sg-kicker {
  margin-bottom: 0.35rem;
  color: var(--alter-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sg-lede {
  max-width: 720px;
  color: var(--alter-muted);
  font-size: 0.95rem;
}

.sg-section {
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid var(--alter-border);
}

.sg-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sg-section-heading h2 {
  margin-bottom: 0;
}

.sg-example {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--alter-border);
  border-radius: 8px;
}

.sg-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sg-primary-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem;
  background: var(--alter-dark);
  border-radius: 8px;
}

.sg-primary-nav-link {
  padding: 1.1rem 0.875rem;
  color: rgba(255, 255, 255, 0.68);
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.sg-primary-nav-link:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.sg-primary-nav-link.active {
  color: #ffffff;
  border-bottom-color: var(--alter-nav-active-stroke);
  box-shadow: 0 1px 0 var(--alter-nav-active-glow);
}

.sg-secondary-nav {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--alter-border);
}

.sg-primary-nav + .sg-secondary-nav {
  margin-top: 0.875rem;
}

.sg-secondary-nav-link {
  padding: 0.6rem 0.8rem;
  color: var(--alter-muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
}

.sg-secondary-nav-link:hover,
.sg-secondary-nav-link.active {
  color: var(--alter-dark);
  border-bottom-color: var(--alter-dark);
}

.sg-button-icon {
  display: inline-flex;
  margin-right: 0.4rem;
}

.sg-form-demo {
  max-width: 540px;
}

.sg-form-panel,
.sg-info-panel {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--alter-border);
  border-radius: 8px;
}

.sg-info-panel {
  display: grid;
  gap: 1rem;
}

.sg-detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.sg-detail-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--alter-border);
}

.sg-detail-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.sg-detail-row dt {
  color: var(--alter-muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.sg-detail-row dd {
  margin-bottom: 0;
  color: var(--alter-text);
  font-weight: 600;
}

.sg-list-section {
  display: grid;
  gap: 0.5rem;
}

.sg-list-section-title {
  margin-bottom: 0;
  color: var(--alter-text);
  font-size: 0.875rem;
  font-weight: 700;
}

.sg-list {
  display: grid;
  gap: 0.5rem;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.sg-list-item,
.sg-list-empty {
  padding: 0.625rem 0.75rem;
  background: #f7f8fb;
  border: 1px solid #e5e9f0;
  border-radius: 6px;
}

.sg-list-item-title {
  display: block;
  color: var(--alter-text);
  font-weight: 600;
}

.sg-list-item-meta,
.sg-list-empty {
  color: #5d6678;
  font-size: 0.8125rem;
}

.sg-form-panel .form-label,
.sg-form-panel .form-check-label {
  color: var(--alter-text);
  font-weight: 600;
}

.sg-form-panel .form-text {
  color: #5d6678;
}

.sg-check-list {
  display: grid;
  gap: 0.35rem;
  padding: 0.625rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--alter-border);
  border-radius: 6px;
}

.sg-check-list label,
.sg-check-list-option {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin-bottom: 0;
  color: var(--alter-text);
  font-size: 0.875rem;
  line-height: 1.35;
}

.sg-check-list .form-check-input,
.sg-check-list input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
}

.sg-form-actions,
.sg-search {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sg-search .form-control {
  max-width: 340px;
}

.sg-search-result {
  margin-top: 0.75rem;
  padding: 0.75rem;
  color: var(--alter-muted);
  background: #f7f8fb;
  border: 1px dashed var(--alter-border);
  border-radius: 6px;
}

.sg-alert-stack,
.sg-toast-stack {
  display: grid;
  gap: 0.75rem;
}

.sg-alert {
  margin-bottom: 0;
}

.sg-alert-title {
  font-weight: 700;
}

.sg-alert-body {
  margin-top: 0.2rem;
}

.sg-feedback-link {
  color: inherit;
  font-weight: 700;
}

.sg-feedback-link:hover {
  color: inherit;
}

.sg-toast-stack .toast {
  display: block;
  max-width: 420px;
  opacity: 1;
}

.sg-toast-indicator {
  display: inline-flex;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.55rem;
  border-radius: 999px;
}

.sg-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.875rem;
  background: #ffffff;
  border: 1px solid var(--alter-border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.sg-pagination-summary {
  color: var(--alter-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.sg-pagination-bar .pagination {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sg-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.sg-card {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--alter-border);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sg-card-eyebrow {
  margin-bottom: 0.4rem;
  color: var(--alter-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sg-card-title {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.sg-card-body {
  min-height: 3rem;
  margin-bottom: 0.75rem;
  color: var(--alter-muted);
}

.sg-card-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--alter-border);
  color: var(--alter-text);
  font-weight: 600;
}

.sg-variant {
  margin-top: 1rem;
}

.sg-variant-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sg-variant-heading h3 {
  margin-bottom: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.sg-metric-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.sg-metric-card {
  position: relative;
  min-height: 92px;
  padding: 1.125rem 1.25rem;
  overflow: visible;
  background: #ffffff;
  border: 1px solid var(--alter-border);
  border-top: 3px solid var(--alter-info);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sg-metric-card-critical {
  border-top-color: var(--alter-danger);
}

.sg-metric-card-action {
  display: block;
  width: 100%;
  height: 100%;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sg-metric-card-action:hover,
.sg-metric-card-action:focus {
  border-color: #c0c9dc;
  box-shadow: 0 0 0 3px rgba(21, 101, 164, 0.11), 0 1px 4px rgba(0, 0, 0, 0.06);
  outline: none;
}

.sg-metric-card-action:hover {
  transform: translateY(-1px);
}

.sg-metric-card-action.active {
  border-color: var(--alter-info);
  box-shadow: 0 0 0 3px rgba(21, 101, 164, 0.16), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sg-metric-card-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.sg-metric-card-label {
  margin-bottom: 0;
  color: var(--alter-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sg-info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  color: var(--alter-muted);
  background: #f7f8fb;
  border: 1px solid #c0c9dc;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
  cursor: help;
}

.sg-info-tooltip::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 20;
  width: max-content;
  max-width: min(20rem, calc(100vw - 3rem));
  padding: 0.55rem 0.65rem;
  color: #ffffff;
  background: var(--alter-text);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(15, 30, 60, 0.2);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  pointer-events: none;
}

.sg-info-tooltip::before {
  content: '';
  display: none;
  position: absolute;
  right: 0.28rem;
  bottom: calc(100% + 0.18rem);
  z-index: 21;
  border-right: 0.3rem solid transparent;
  border-left: 0.3rem solid transparent;
  border-top: 0.3rem solid var(--alter-text);
  pointer-events: none;
}

.sg-info-tooltip:hover::after,
.sg-info-tooltip:hover::before,
.sg-metric-card-action:focus .sg-info-tooltip::after,
.sg-metric-card-action:focus .sg-info-tooltip::before {
  display: block;
}

.sg-metric-card-value {
  color: var(--alter-text);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
}

.sg-type-scale {
  display: grid;
  gap: 0.75rem;
}

.sg-type-scale span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--alter-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sg-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.875rem;
}

.sg-color-swatch {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--alter-border);
  border-radius: 8px;
}

.sg-color-chip {
  width: 56px;
  height: 56px;
  border: 1px solid var(--alter-border);
  border-radius: 6px;
}

.sg-color-name {
  font-weight: 700;
}

.sg-color-value {
  margin-top: 0.25rem;
  color: var(--alter-muted);
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .sg-page {
    grid-template-columns: 1fr;
  }

  .sg-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--alter-border);
  }

  .sg-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sg-content {
    padding: 1rem;
  }

  .sg-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .sg-card-grid,
  .sg-metric-card-grid,
  .sg-color-grid {
    grid-template-columns: 1fr;
  }

  .sg-pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}
