/* Shell-only layout (auth screens, facts list). Tokens only. */

.sh-auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--avb-safe-top) + var(--avb-space-3)) calc(var(--avb-gutter) + var(--avb-safe-right)) calc(var(--avb-safe-bottom) + var(--avb-space-4))
    calc(var(--avb-gutter) + var(--avb-safe-left));
}

.sh-auth__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--avb-space-3);
  width: 100%;
  max-width: var(--avb-content-max);
  margin: 0 auto;
}

.sh-auth__tools {
  display: flex;
  gap: var(--avb-space-2);
}

.sh-auth__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--avb-space-4);
  padding: var(--avb-space-6) 0;
  outline: none;
}

.sh-auth__card {
  width: 100%;
  max-width: 440px;
}

.sh-auth__subtitle {
  margin-top: var(--avb-space-1h);
  margin-bottom: var(--avb-space-5);
  color: var(--avb-text-muted);
}

.sh-auth__footer {
  color: var(--avb-text-2);
  font-size: var(--avb-text-nav);
  text-align: center;
}

.sh-auth__footer a,
.sh-form__aside a {
  font-weight: var(--avb-weight-bold);
}

.sh-auth__legal {
  text-align: center;
}

.sh-form {
  --avb-stack-gap: var(--avb-space-4);
}

.sh-form__aside {
  display: flex;
  justify-content: flex-end;
  margin-top: calc(-1 * var(--avb-space-2));
  font-size: var(--avb-text-nav);
}

.sh-fieldset {
  display: flex;
  flex-direction: column;
  gap: var(--avb-space-4);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sh-legend {
  margin-bottom: var(--avb-space-1);
  padding: 0;
  color: var(--avb-text-muted);
  font-size: var(--avb-text-xs);
  font-weight: var(--avb-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sh-ref {
  display: block;
  margin-top: var(--avb-space-1);
  font-family: var(--avb-font-mono);
  font-size: 11.5px;
  opacity: 0.8;
}

.sh-facts {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: var(--avb-space-2h) var(--avb-space-3);
  margin: 0;
  font-size: var(--avb-text-nav);
}

.sh-facts dt {
  color: var(--avb-text-muted);
}

.sh-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sh-center {
  display: grid;
  place-items: center;
  padding: var(--avb-space-6);
}

.sh-narrow {
  width: 100%;
  max-width: 460px;
}

.sh-search {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--avb-space-2h);
}

.sh-grow {
  flex: 1;
  min-width: min(100%, 240px);
}

/* Import Center (web/shell/screens/imports.js). Tokens only. */

.im-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--avb-space-2h);
  padding: var(--avb-space-6) var(--avb-space-4);
  border: 2px dashed var(--avb-border-strong);
  border-radius: var(--avb-radius-panel);
  background: var(--avb-surface-2);
  text-align: center;
  transition: border-color var(--avb-duration-fast) var(--avb-ease-standard), background var(--avb-duration-fast) var(--avb-ease-standard);
}

.im-drop.is-drag {
  border-color: var(--avb-accent);
  background: var(--avb-accent-soft);
}

.im-drop__icon {
  display: grid;
  place-items: center;
  width: var(--avb-control-lg);
  height: var(--avb-control-lg);
  border-radius: var(--avb-radius-round);
  background: var(--avb-accent-soft);
  color: var(--avb-accent-text);
}

.im-steps {
  display: flex;
  gap: var(--avb-space-2);
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.im-steps li {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  gap: var(--avb-space-2);
  padding: var(--avb-space-2) var(--avb-space-3);
  border-radius: var(--avb-radius-pill);
  background: var(--avb-surface-2);
  color: var(--avb-text-muted);
  font-size: var(--avb-text-sm);
  font-weight: var(--avb-weight-label);
  white-space: nowrap;
}

.im-steps li.is-current {
  background: var(--avb-accent-soft);
  color: var(--avb-accent-text);
}

.im-steps li.is-done {
  color: var(--avb-success);
}

.im-steps__dot {
  display: grid;
  place-items: center;
  width: var(--avb-space-5);
  height: var(--avb-space-5);
  border-radius: var(--avb-radius-round);
  background: var(--avb-surface);
  font-size: var(--avb-text-xs);
}

@media (max-width: 719px) {
  .im-steps li:not(.is-current) .im-steps__label {
    display: none;
  }
}

.im-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--avb-space-3);
}

.im-map__row {
  display: flex;
  flex-direction: column;
  gap: var(--avb-space-1h);
  min-width: 0;
}

.im-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--avb-space-1h);
}

.im-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: var(--avb-space-2);
}

.im-check {
  display: flex;
  align-items: center;
  gap: var(--avb-space-2);
  min-height: var(--avb-control-sm);
  padding: 0 var(--avb-space-3);
  border: 1px solid var(--avb-border);
  border-radius: var(--avb-radius-control);
  background: var(--avb-field);
  cursor: pointer;
}

.im-check input {
  width: var(--avb-space-4);
  height: var(--avb-space-4);
  accent-color: var(--avb-accent);
}

.im-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.im-progress progress {
  width: 100%;
  height: var(--avb-space-2);
  accent-color: var(--avb-accent);
}

.im-anchor {
  scroll-margin-top: calc(var(--avb-safe-top) + var(--avb-nav-bar-height) + var(--avb-space-3));
}

.im-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--avb-space-3);
}

@media (min-width: 720px) {
  .im-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Shared barcodes (web/shell/screens/barcodes.js). Tokens only. */

.bc-scanline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--avb-space-2h);
}

.bc-scanline > .avb-field {
  flex: 1 1 220px;
  min-width: 0;
}

.bc-qty {
  display: inline-flex;
  align-items: center;
  gap: var(--avb-space-1h);
}

.bc-qty__n {
  min-width: var(--avb-space-5);
  font-weight: var(--avb-weight-bold);
  text-align: center;
}

.bc-total {
  display: flex;
  justify-content: space-between;
  gap: var(--avb-space-3);
  margin-top: var(--avb-space-3);
  padding: var(--avb-space-3) var(--avb-space-4);
  border-radius: var(--avb-radius-control);
  background: var(--avb-accent-soft);
  color: var(--avb-accent-text);
  font-size: var(--avb-text-lg);
}

.bc-receive {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--avb-space-3);
  padding: var(--avb-space-3);
  border-radius: var(--avb-radius-control);
  background: var(--avb-surface-2);
}

.bc-receive > .avb-field {
  flex: 0 1 140px;
}

.bc-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--avb-space-4);
}

.bc-preview .avb-label {
  border: 1px solid var(--avb-border-strong);
  border-radius: var(--avb-radius-xs);
  box-shadow: var(--avb-shadow-1);
}

/* ---------------------------------------------------------------- header profile button, status line (ADR-0021) */
.sh-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--avb-radius-round);
  background: var(--avb-accent-soft);
  color: var(--avb-accent-text);
  font: inherit;
  font-size: var(--avb-text-sm);
  font-weight: var(--avb-weight-heavy);
  cursor: pointer;
}

.sh-avatar[aria-current='page'] {
  background: var(--avb-nav-active);
  color: var(--avb-nav-active-text);
}

.sh-status-item {
  display: inline-flex;
  align-items: center;
  gap: var(--avb-space-1h);
}

/* phones: connectivity shows as the offline banner, the language lives in Settings — the header keeps room for
   the business switcher */
.sh-wide-only {
  display: contents;
}

@media (max-width: 719.98px) {
  .sh-wide-only {
    display: none;
  }
}

/* ---- sync indicator (architecture 10 §5.3): every width; the text hides on narrow phones, the dot stays */
.sh-sync {
  display: inline-flex;
  align-items: center;
  gap: var(--avb-space-1h);
  min-height: 40px;
  max-width: 220px;
  padding: 0 var(--avb-space-3);
  border: 0;
  border-radius: var(--avb-radius-pill);
  font: inherit;
  font-size: var(--avb-text-xs);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.sh-sync__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sh-sync__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--avb-radius-round);
  background: currentColor;
}

.sh-sync--success {
  background: var(--avb-success-soft);
  color: var(--avb-success);
}

.sh-sync--warning {
  background: var(--avb-warning-soft);
  color: var(--avb-warning);
}

.sh-sync--danger {
  background: var(--avb-danger-soft);
  color: var(--avb-danger);
}

.sh-sync--info {
  background: var(--avb-info-soft);
  color: var(--avb-info);
}

.sh-sync:focus-visible {
  outline: 2px solid var(--avb-focus-ring);
  outline-offset: 2px;
}

.sh-sync__short {
  display: none;
  font-variant-numeric: tabular-nums;
}

/* phones: a dot (and the count when something waits) — the header keeps room for the business switcher */
@media (max-width: 719.98px) {
  .sh-sync {
    min-width: 40px;
    justify-content: center;
    padding: 0 var(--avb-space-2);
  }

  .sh-sync__text {
    display: none;
  }

  .sh-sync__short {
    display: inline;
  }
}

.sh-sync-h {
  margin: var(--avb-space-2) 0 0;
  font-size: var(--avb-text-md);
}

.sh-sync-rejected {
  display: grid;
  gap: var(--avb-space-2);
  padding: var(--avb-space-3);
  border: 1px solid var(--avb-border);
  border-radius: var(--avb-radius-md);
}

.sh-sync-rejected__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--avb-space-2);
}

/* scale-label settings (architecture 17 §9) */
.sh-scale-layout {
  min-width: 0;
  margin: 0;
  padding: var(--avb-space-3);
  border: 1px solid var(--avb-border);
  border-radius: var(--avb-radius-card);
}

.sh-scale-layout legend {
  padding: 0 var(--avb-space-1h);
  font-weight: var(--avb-weight-bold);
}

.sh-scale-layout__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--avb-space-2) var(--avb-space-3);
}

.sh-scale-layout__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--avb-space-2);
  margin-top: var(--avb-space-2);
  overflow-wrap: anywhere;
}

.sh-scale-items__title {
  margin: var(--avb-space-2) 0 0;
  font-size: var(--avb-text-md);
}
