/* ==========================================================================
   SmartApti — shared component layer
   Stat cards, data tables, status badges, stepper, timer, palette, drawer,
   modal chrome, toasts, empty state, skeleton. Reused by every page.
   ========================================================================== */

/* Brand -------------------------------------------------------------------- */
.sa-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 10px;
  color: hsl(var(--foreground));
}

.sa-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 10px;
  background-image: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-deep)) 100%);
  box-shadow: var(--shadow-glow);
  color: #fff;
  flex-shrink: 0;
}

.sa-brand__mark svg {
  width: 16px;
  height: 16px;
}

.sa-brand__mark.is-lg {
  height: 2.75rem;
  width: 2.75rem;
  border-radius: 13px;
}

.sa-brand__mark.is-sm {
  height: 2rem;
  width: 2rem;
  border-radius: 9px;
}

.sa-brand__word {
  font-size: var(--fs-15);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

/* Surfaces & gradients ----------------------------------------------------- */
.sa-gradient {
  background-image: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-deep)) 100%);
}

.sa-glass {
  border: 1px solid rgb(0 0 0 / 0.05);
  background-color: rgb(255 255 255 / 0.7);
  backdrop-filter: blur(20px);
}

[data-bs-theme="dark"] .sa-glass {
  border-color: rgb(255 255 255 / 0.1);
  background-color: rgb(11 11 20 / 0.7);
}

.sa-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.sa-card--lift {
  transition: transform var(--dur-base) ease-out, border-color var(--dur-base) ease-out,
    box-shadow var(--dur-base) ease-out;
}

.sa-card--lift:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: var(--shadow-lift);
}

.sa-card__head {
  padding: 1.25rem 1.25rem 0.75rem;
}

.sa-card__title {
  font-size: var(--fs-15);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.sa-card__desc {
  font-size: var(--fs-13);
  line-height: 1.65;
  color: hsl(var(--muted-foreground));
  margin: 0.25rem 0 0;
}

.sa-card__body {
  padding: 0 1.25rem 1.25rem;
}

.sa-card__foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid hsl(var(--border));
  padding: 0.75rem 1.25rem;
}

/* Badges (soft tint + darker text, never a solid block) --------------------- */
.sa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 999px;
  padding: 3px 0.625rem;
  font-size: var(--fs-11);
  font-weight: 500;
  line-height: 1.375rem;
  box-shadow: inset 0 0 0 1px currentColor;
  white-space: nowrap;
}

.sa-badge__dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 999px;
  background-color: currentColor;
  flex-shrink: 0;
}

.sa-badge--neutral {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.sa-badge--primary {
  background-color: hsl(262 100% 97%);
  color: hsl(262 74% 45%);
  box-shadow: inset 0 0 0 1px hsl(262 60% 80% / 0.5);
}

.sa-badge--success {
  background-color: hsl(152 76% 96%);
  color: hsl(160 84% 27%);
  box-shadow: inset 0 0 0 1px hsl(160 60% 70% / 0.55);
}

.sa-badge--warning {
  background-color: hsl(48 100% 96%);
  color: hsl(30 92% 32%);
  box-shadow: inset 0 0 0 1px hsl(38 92% 60% / 0.5);
}

.sa-badge--danger {
  background-color: hsl(356 100% 97%);
  color: hsl(347 77% 40%);
  box-shadow: inset 0 0 0 1px hsl(347 77% 70% / 0.5);
}

.sa-badge--info {
  background-color: hsl(204 94% 96%);
  color: hsl(201 90% 30%);
  box-shadow: inset 0 0 0 1px hsl(199 89% 60% / 0.5);
}

.sa-badge--accent {
  background-color: hsl(183 100% 96%);
  color: hsl(189 94% 27%);
  box-shadow: inset 0 0 0 1px hsl(189 94% 55% / 0.5);
}

[data-bs-theme="dark"] .sa-badge--primary {
  background-color: hsl(262 83% 64% / 0.12);
  color: hsl(262 100% 86%);
  box-shadow: inset 0 0 0 1px hsl(262 83% 64% / 0.28);
}

[data-bs-theme="dark"] .sa-badge--success {
  background-color: hsl(158 64% 52% / 0.12);
  color: hsl(158 64% 72%);
  box-shadow: inset 0 0 0 1px hsl(158 64% 52% / 0.28);
}

[data-bs-theme="dark"] .sa-badge--warning {
  background-color: hsl(43 96% 56% / 0.12);
  color: hsl(43 96% 74%);
  box-shadow: inset 0 0 0 1px hsl(43 96% 56% / 0.28);
}

[data-bs-theme="dark"] .sa-badge--danger {
  background-color: hsl(350 89% 62% / 0.12);
  color: hsl(350 89% 80%);
  box-shadow: inset 0 0 0 1px hsl(350 89% 62% / 0.28);
}

[data-bs-theme="dark"] .sa-badge--info {
  background-color: hsl(199 95% 62% / 0.12);
  color: hsl(199 95% 78%);
  box-shadow: inset 0 0 0 1px hsl(199 95% 62% / 0.28);
}

[data-bs-theme="dark"] .sa-badge--accent {
  background-color: hsl(189 94% 55% / 0.12);
  color: hsl(189 94% 76%);
  box-shadow: inset 0 0 0 1px hsl(189 94% 55% / 0.28);
}

/* Icon buttons ------------------------------------------------------------- */
.sa-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 10px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  transition: color var(--dur-base), background-color var(--dur-base), border-color var(--dur-base);
}

.sa-icon-btn:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted));
}

.sa-icon-btn svg {
  width: 16px;
  height: 16px;
}

.sa-icon-btn--plain {
  border-color: transparent;
  background-color: transparent;
  height: 2rem;
  width: 2rem;
  border-radius: 8px;
}

.sa-icon-btn--plain svg {
  width: 14px;
  height: 14px;
}

.sa-icon-btn--plain:hover {
  background-color: hsl(var(--muted));
}

/* Avatar ------------------------------------------------------------------- */
.sa-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  width: 2rem;
  border-radius: 999px;
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.sa-avatar.is-md {
  height: 2.25rem;
  width: 2.25rem;
  font-size: var(--fs-12);
}

.sa-avatar.is-lg {
  height: 3rem;
  width: 3rem;
  font-size: var(--fs-14);
}

.sa-avatar__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 999px;
  background-color: hsl(var(--success));
  box-shadow: 0 0 0 2px hsl(var(--card));
}

/* Stat card ---------------------------------------------------------------- */
.sa-stat {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) ease-out, border-color var(--dur-base) ease-out,
    box-shadow var(--dur-base) ease-out;
}

.sa-stat:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--primary) / 0.25);
  box-shadow: var(--shadow-lift);
}

.sa-stat__label {
  font-size: var(--fs-13);
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.sa-stat__value {
  margin: 0.375rem 0 0;
  font-size: var(--fs-28);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}

.sa-stat__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.sa-stat__chip svg {
  width: 18px;
  height: 18px;
}

.sa-stat__chip--primary { background-color: hsl(262 83% 58% / 0.1); color: hsl(262 83% 52%); }
.sa-stat__chip--info { background-color: hsl(199 89% 48% / 0.1); color: hsl(199 89% 42%); }
.sa-stat__chip--success { background-color: hsl(160 84% 39% / 0.1); color: hsl(160 84% 32%); }
.sa-stat__chip--warning { background-color: hsl(38 92% 50% / 0.1); color: hsl(32 92% 40%); }
.sa-stat__chip--danger { background-color: hsl(347 77% 50% / 0.1); color: hsl(347 77% 46%); }

[data-bs-theme="dark"] .sa-stat__chip--primary { color: hsl(262 100% 82%); }
[data-bs-theme="dark"] .sa-stat__chip--info { color: hsl(199 95% 78%); }
[data-bs-theme="dark"] .sa-stat__chip--success { color: hsl(158 64% 72%); }
[data-bs-theme="dark"] .sa-stat__chip--warning { color: hsl(43 96% 74%); }
[data-bs-theme="dark"] .sa-stat__chip--danger { color: hsl(350 89% 80%); }

.sa-stat__foot {
  margin-top: 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.sa-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  border-radius: 999px;
  padding: 2px 0.375rem;
  font-size: var(--fs-11);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sa-delta--up {
  background-color: hsl(160 84% 39% / 0.1);
  color: hsl(160 84% 30%);
}

.sa-delta--down {
  background-color: hsl(347 77% 50% / 0.1);
  color: hsl(347 77% 46%);
}

[data-bs-theme="dark"] .sa-delta--up { color: hsl(158 64% 72%); }
[data-bs-theme="dark"] .sa-delta--down { color: hsl(350 89% 80%); }

.sa-delta svg {
  width: 12px;
  height: 12px;
}

.sa-sparkline {
  display: block;
  width: 96px;
  height: 34px;
  flex-shrink: 0;
}

/* Page header -------------------------------------------------------------- */
.sa-pagehead {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .sa-pagehead {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.sa-pagehead__title {
  font-size: var(--fs-24);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin: 0;
}

.sa-pagehead__desc {
  margin: 0.25rem 0 0;
  max-width: 42rem;
  font-size: var(--fs-13);
  line-height: 1.65;
  color: hsl(var(--muted-foreground));
}

.sa-pagehead__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Data table --------------------------------------------------------------- */
.sa-table-card {
  border-radius: var(--radius-card);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.sa-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  padding: 0.75rem 1rem;
}

.sa-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sa-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 640px) {
  .sa-search {
    max-width: 20rem;
    flex: 0 1 20rem;
  }
}

.sa-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.sa-search input {
  height: 2.25rem;
  width: 100%;
  border-radius: 9px;
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--card));
  padding: 0 2rem 0 2.25rem;
  font-size: var(--fs-13);
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}

.sa-search input:focus {
  border-color: hsl(var(--primary) / 0.7);
  outline: none;
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.15);
}

.sa-search input::-webkit-search-cancel-button {
  appearance: none;
}

.sa-search__clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 2px;
  border-radius: 4px;
  line-height: 0;
}

.sa-search__clear:hover {
  color: hsl(var(--foreground));
}

.sa-search__clear svg {
  position: static;
  transform: none;
  width: 14px;
  height: 14px;
  pointer-events: auto;
}

.sa-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font-size: var(--fs-12);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
}

.sa-chip:hover {
  border-color: hsl(var(--primary) / 0.25);
  color: hsl(var(--foreground));
}

.sa-chip.is-active {
  border-color: hsl(var(--primary) / 0.3);
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.sa-chip svg {
  width: 14px;
  height: 14px;
}

.sa-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.sa-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--primary) / 0.06);
  padding: 0.5rem 1rem;
}

.sa-bulkbar p {
  margin: 0;
  font-size: var(--fs-12);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}

.sa-table-scroll {
  overflow-x: auto;
}

.sa-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--fs-13);
}

.sa-table th {
  position: relative;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted) / 0.4);
  padding: 0.625rem 1rem;
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.sa-table th.is-right,
.sa-table td.is-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sa-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border) / 0.6);
}

.sa-table tbody tr {
  transition: background-color var(--dur-fast);
}

.sa-table tbody tr:hover {
  background-color: hsl(var(--muted) / 0.6);
}

.sa-table tbody tr:last-child td {
  border-bottom: 0;
}

.sa-table tbody tr.is-selected {
  background-color: hsl(var(--primary) / 0.04);
}

.sa-table tbody tr.is-clickable {
  cursor: pointer;
}

.sa-table.is-compact td {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.sa-table th.sa-col-check,
.sa-table td.sa-col-check {
  width: 2.5rem;
  padding-right: 0.25rem;
}

.sa-table th.sa-col-actions,
.sa-table td.sa-col-actions {
  width: 3rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  text-align: right;
}

.sa-table .is-sticky-right {
  position: sticky;
  z-index: 2;
  background-color: hsl(var(--card));
}

.sa-table tbody tr:hover .is-sticky-right {
  background-color: hsl(var(--muted));
}

.sa-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.sa-sort:hover {
  color: hsl(var(--foreground));
}

.sa-sort.is-sorted {
  color: hsl(var(--foreground));
}

.sa-sort svg {
  width: 12px;
  height: 12px;
  opacity: 0.4;
}

.sa-sort.is-sorted svg {
  opacity: 1;
}

.sa-table__rowmenu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  width: 1.75rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.sa-table__rowmenu:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.sa-table__rowmenu svg {
  width: 16px;
  height: 16px;
}

.sa-skeleton {
  display: block;
  border-radius: 6px;
  background-color: hsl(var(--muted));
  background-image: linear-gradient(
    90deg,
    hsl(var(--muted)) 0%,
    hsl(var(--muted-foreground) / 0.12) 50%,
    hsl(var(--muted)) 100%
  );
  background-size: 200% 100%;
  animation: sa-shimmer 1.6s linear infinite;
}

.sa-skeleton--line {
  height: 0.75rem;
  width: 100%;
}

.sa-skeleton--short {
  width: 60%;
}

@keyframes sa-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pagination (custom, tokenised) ------------------------------------------- */
.sa-paginate {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  padding: 0.75rem 1rem;
}

@media (min-width: 640px) {
  .sa-paginate {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.sa-paginate__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-13);
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

.sa-paginate__rows {
  height: 2rem;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: var(--fs-13);
  padding: 0 0.5rem;
}

.sa-paginate__pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sa-paginate__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font-size: var(--fs-13);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sa-paginate__btn:hover:not(:disabled) {
  color: hsl(var(--foreground));
}

.sa-paginate__btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.sa-paginate__btn.is-current {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-glow);
}

.sa-paginate__gap {
  padding: 0 0.25rem;
  font-size: var(--fs-13);
  color: hsl(var(--muted-foreground));
}

/* Empty state -------------------------------------------------------------- */
.sa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.sa-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  width: 3rem;
  border-radius: 14px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.sa-empty__icon svg {
  width: 20px;
  height: 20px;
}

.sa-empty h3 {
  font-size: var(--fs-15);
  font-weight: 600;
  margin: 0;
}

.sa-empty p {
  margin: 0.375rem 0 0;
  max-width: 24rem;
  font-size: var(--fs-13);
  line-height: 1.65;
  color: hsl(var(--muted-foreground));
}

.sa-empty__action {
  margin-top: 1.25rem;
}

/* Drawer (right side offcanvas, used for previews and reports) ------------- */
.sa-drawer {
  --bs-offcanvas-width: 460px;
}

.sa-drawer .offcanvas-header {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.sa-drawer .offcanvas-body {
  padding: 1.25rem;
}

.sa-drawer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

@media (max-width: 575.98px) {
  .sa-drawer {
    --bs-offcanvas-width: 100vw;
  }
}

/* Toast stack (top-right, never covers drawers) ---------------------------- */
.sa-toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.sa-toasts .toast {
  pointer-events: auto;
  width: 100%;
}

.sa-toast__body {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
}

.sa-toast__icon {
  display: inline-flex;
  height: 1.125rem;
  width: 1.125rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.sa-toast__icon svg {
  height: 1.125rem;
  width: 1.125rem;
}

.sa-toast--success .sa-toast__icon { color: hsl(var(--success)); }
.sa-toast--error .sa-toast__icon { color: hsl(var(--danger)); }
.sa-toast--info .sa-toast__icon { color: hsl(var(--info)); }

.sa-toast__title {
  font-size: var(--fs-13);
  font-weight: 500;
  color: hsl(var(--foreground));
  margin: 0;
}

.sa-toast__desc {
  margin: 0.125rem 0 0;
  font-size: var(--fs-12);
  color: hsl(var(--muted-foreground));
}

/* Stepper ------------------------------------------------------------------ */
.sa-stepper {
  display: flex;
  align-items: flex-start;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sa-stepper li {
  display: flex;
  align-items: flex-start;
  flex: 1;
}

.sa-stepper li:last-child {
  flex: 0 0 auto;
}

.sa-stepper__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  width: 2rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: var(--fs-12);
  font-weight: 600;
  flex-shrink: 0;
}

.sa-stepper__dot svg {
  width: 16px;
  height: 16px;
}

.sa-stepper__label {
  max-width: 92px;
  margin-top: 0.375rem;
  font-size: var(--fs-11);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.sa-stepper__line {
  height: 1px;
  flex: 1;
  margin: 1rem 0.5rem 0;
  background-color: hsl(var(--border));
}

.sa-stepper li.is-current .sa-stepper__label,
.sa-stepper li.is-done .sa-stepper__label {
  color: hsl(var(--foreground));
}

/* Progress bar (token) ----------------------------------------------------- */
.sa-progress {
  height: 4px;
  width: 100%;
  background-color: hsl(var(--muted));
  overflow: hidden;
}

.sa-progress__bar {
  height: 100%;
  background-color: hsl(var(--primary));
  transition: width 300ms var(--ease-smooth);
}

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

/* Timeline / list rows ----------------------------------------------------- */
.sa-divide > * + * {
  border-top: 1px solid hsl(var(--border));
}

.sa-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  font-size: var(--fs-13);
}

.sa-kv dt {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
  margin: 0;
}

.sa-kv dd {
  margin: 0;
  font-weight: 500;
  color: hsl(var(--foreground));
  text-align: right;
}

/* Code / chip -------------------------------------------------------------- */
.sa-code {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 6px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  padding: 1px 0.375rem;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: hsl(var(--foreground));
}

.sa-code--button {
  cursor: pointer;
}

.sa-code--button:hover {
  border-color: hsl(var(--primary) / 0.4);
  color: hsl(var(--primary));
}

/* Keyboard hint ------------------------------------------------------------ */
.sa-kbd {
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  padding: 1px 0.375rem;
  font-size: var(--fs-10);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--muted-foreground));
}

/* Visually hidden ---------------------------------------------------------- */
.sa-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus ring helper -------------------------------------------------------- */
.sa-focus:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}