html {
  font-size: 14px;
}

/* Equipment repair forms reuse the established mobile operation-form shrink
   contract and keep camera/file controls out of the layout flow. */
.repair-form,
.repair-action-form,
.repair-photo-capture,
.repair-photo-preview-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.repair-form {
  display: grid;
  gap: 1rem;
  max-width: 47.5rem;
}

.repair-form label,
.repair-photo-capture {
  display: grid;
  gap: .4rem;
  min-width: 0;
  font-weight: 600;
}

.repair-form :is(input:not([type="hidden"]), select, textarea),
.repair-action-form :is(input:not([type="hidden"]), select, textarea) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: .7rem;
  border: 1px solid #cbd5e1;
  border-radius: .5rem;
  font: inherit;
}

.repair-action-form {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1rem 0;
}

.repair-action-form > *,
.repair-photo-actions > * {
  min-width: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: .6rem 1rem;
}

.repair-photo-grid,
.repair-photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(7rem, 100%), 1fr));
  gap: .75rem;
}

.repair-photo-grid figure,
.repair-photo-preview-grid figure {
  position: relative;
  min-width: 0;
  margin: 0;
}

.repair-photo-grid img,
.repair-photo-preview-grid img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: .5rem;
}

.repair-photo-grid figcaption { margin-top: .25rem; font-size: .875rem; }
.repair-photo-heading,
.repair-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.repair-photo-heading { justify-content: space-between; }
.repair-photo-help { margin: 0; color: #64748b; font-size: .875rem; font-weight: 400; }
.repair-photo-error { margin: 0; color: #b42318; font-weight: 600; }
.repair-photo-preview-grid button { position: absolute; right: .25rem; bottom: .25rem; }
.repair-photo-submit-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.repair-photo-source { position: relative; overflow: hidden; }
.repair-photo-source-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.repair-photo-source:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }

@media (max-width: 991.98px) {
  .repair-form :is(input:not([type="hidden"]), select, textarea),
  .repair-action-form :is(input:not([type="hidden"]), select, textarea) {
    font-size: 16px;
  }
}

@media (max-width: 375px) {
  .repair-form,
  .repair-action-form,
  .repair-action-form > *,
  .repair-photo-actions,
  .repair-photo-actions > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid dt { font-weight: 700; }
  .repair-photo-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header h1 { font-size: 1.5rem; }
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f5f7fa;
  color: #172033;
}


.app-body {
  margin-bottom: 0;
}

.app-topbar {
  position: fixed;
  z-index: 1040;
  top: 0;
  right: 0;
  left: 15.5rem;
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid #dfe6ee;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 .2rem .8rem rgba(20, 37, 63, .04);
}

.app-brand {
  color: #172033;
  font-size: 1.15rem;
  font-weight: 750;
  text-decoration: none;
}

.app-brand:hover { color: #0d6efd; }

.app-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  overflow: hidden;
  border-radius: .25rem;
  background: #fff;
  text-decoration: none;
}

.app-logo-image,
.login-brand-logo {
  display: block;
  background-color: #fff;
  background-image: url("../images/branding/hongrun-scm-system-logo-temp.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% auto;
}

.app-logo-link-topbar,
.app-logo-link-public {
  width: 11rem;
  height: 2.75rem;
}

.app-logo-link-topbar .app-logo-image,
.app-logo-link-public .app-logo-image,
.app-logo-link-mobile .app-logo-image,
.app-logo-link-sidebar .app-logo-image {
  width: 100%;
  height: 100%;
}

.app-logo-link-mobile {
  width: 9.5rem;
  height: 2.5rem;
}

.app-brand-context {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .8rem;
}

.app-company-name {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-company-switcher-toggle {
  width: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-company-switcher-menu {
  min-width: 18rem;
}

.app-company-switch-form {
  margin: 0;
}

.app-user-actions {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.app-user-name {
  max-width: 14rem;
  overflow: hidden;
  color: #53657a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar {
  position: fixed;
  z-index: 1050;
  top: 0;
  bottom: 0;
  left: 0;
  width: 15.5rem;
  flex-direction: column;
  padding: 1.25rem 1rem 1rem;
  border-right: 1px solid #dfe6ee;
  background: #fff;
  box-shadow: .2rem 0 1rem rgba(20, 37, 63, .035);
}

.sidebar-brand {
  margin-bottom: 1.15rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid #edf1f5;
  color: #1b6ec2;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-align: center;
}

.app-logo-link-sidebar {
  width: 100%;
  height: 3.4rem;
  border-radius: 0;
}

.sidebar-navigation {
  display: grid;
  gap: .35rem;
  overflow-y: auto;
  padding-right: .15rem;
}

.sidebar-link,
.sidebar-group > summary {
  position: relative;
  display: flex;
  min-height: 2.6rem;
  align-items: center;
  border-radius: .55rem;
  color: #34465b;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-link {
  padding: .6rem .75rem .6rem 1rem;
}

.sidebar-link:hover,
.sidebar-group > summary:hover,
.sidebar-subgroup > summary:hover {
  background: #f1f6fc;
  color: #1b6ec2;
}

.sidebar-link.active {
  background: #1b6ec2;
  color: #fff;
  font-weight: 750;
  box-shadow: 0 .25rem .65rem rgba(27, 110, 194, .2);
}

.sidebar-link.active::before {
  position: absolute;
  top: .45rem;
  bottom: .45rem;
  left: .35rem;
  width: .18rem;
  border-radius: 1rem;
  background: #fff;
  content: "";
}

.sidebar-home { margin-bottom: .2rem; }

.sidebar-group {
  border-radius: .65rem;
}

.sidebar-group.active {
  background: #f4f8fd;
}

.sidebar-group > summary {
  cursor: pointer;
  list-style: none;
  padding: .6rem .75rem;
}

.sidebar-group > summary::-webkit-details-marker { display: none; }
.sidebar-group > summary::after {
  margin-left: auto;
  color: #8190a3;
  content: "›";
  font-size: 1.2rem;
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.sidebar-group[open] > summary::after { transform: rotate(-90deg); }
.sidebar-group.active > summary { color: #1b6ec2; font-weight: 750; }

.sidebar-submenu {
  display: grid;
  gap: .2rem;
  padding: 0 .35rem .45rem .7rem;
}

.sidebar-submenu .sidebar-link {
  min-height: 2.35rem;
  padding-top: .45rem;
  padding-bottom: .45rem;
  font-size: .92rem;
}

.sidebar-settings-menu {
  padding-left: .35rem;
}

.sidebar-subgroup {
  border-left: 1px solid #dce6f1;
}

.sidebar-subgroup > summary {
  display: flex;
  min-height: 2.25rem;
  align-items: center;
  padding: .45rem .55rem;
  border-radius: .45rem;
  color: #52677f;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 700;
  list-style: none;
}

.sidebar-subgroup > summary::-webkit-details-marker { display: none; }
.sidebar-subgroup > summary::after {
  margin-left: auto;
  color: #94a1b1;
  content: "›";
  font-size: 1rem;
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.sidebar-subgroup[open] > summary::after { transform: rotate(-90deg); }
.sidebar-subgroup.active > summary { color: #1b6ec2; }

.sidebar-third-level {
  display: grid;
  gap: .15rem;
  padding: 0 .2rem .35rem .45rem;
}

.sidebar-third-level .sidebar-link {
  min-height: 2.15rem;
  padding: .4rem .55rem .4rem .85rem;
  font-size: .86rem;
}

.sidebar-version {
  margin-top: auto;
  padding: 1rem .65rem .2rem;
  border-top: 1px solid #edf1f5;
  color: #7b8999;
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
}

.app-content {
  min-height: 100vh;
  margin-left: 15.5rem;
  padding-top: 4rem;
}

.app-content.app-content-compact { min-height: 0; }

.app-main {
  width: min(100%, 100rem);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  color: #708094;
  font-size: 1rem;
}

.page-breadcrumb strong { color: #25384f; }

.mobile-navigation { width: min(88vw, 20rem); }
.mobile-navigation .offcanvas-body { display: flex; flex-direction: column; padding-top: 0; }
.mobile-navigation .sidebar-navigation { overflow: visible; }

.public-header {
  padding: 1rem 0;
  border-bottom: 1px solid #dfe6ee;
  background: #fff;
}

.public-main { padding-top: 2rem; padding-bottom: 3rem; }
.login-version { color: #7b8999; font-size: .8rem; font-weight: 600; }

.login-brand-logo {
  width: min(100%, 32rem);
  height: 8rem;
  margin: 0 auto .75rem;
}

@media (max-width: 991.98px) {
  .app-topbar {
    left: 0;
    padding: 0 1rem;
  }

  .app-content { margin-left: 0; }
  .app-main { padding: 1rem 1rem 2rem; }
  .app-menu-button { padding: .35rem .55rem; font-size: 1.25rem; line-height: 1; }
  .app-user-name { display: none; }

  .app-brand-context {
    flex: 1 1 auto;
  }

  .app-logo-link-topbar {
    width: 8.5rem;
    height: 2.35rem;
  }

  .app-company-name {
    max-width: min(52vw, 24rem);
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.dashboard-hero {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid #dce5ef;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
}

.eyebrow {
  color: #1b6ec2;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.company-code {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: #e8eef6;
  color: #41536b;
  font-size: .8rem;
  font-weight: 600;
}

.metric-card,
.content-panel {
  border: 1px solid #e1e7ef;
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 .3rem 1.2rem rgba(20, 37, 63, .04);
}

.metric-card {
  display: flex;
  min-height: 7rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
}

.metric-card span {
  color: #66758a;
  font-size: .88rem;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.content-panel {
  padding: clamp(1rem, 3vw, 1.75rem);
  scroll-margin-top: 1rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-nav {
  display: flex;
  gap: .65rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.section-nav a {
  flex: 0 0 auto;
  padding: .55rem .85rem;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #fff;
  color: #26384d;
  text-decoration: none;
}

.section-nav a:hover {
  border-color: #1b6ec2;
  color: #1b6ec2;
}

.table > :not(caption) > * > * {
  padding: .75rem;
}

.table thead th {
  color: #66758a;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-active {
  background: #e7f7ef;
  color: #167548;
}

.status-inactive {
  background: #eef1f4;
  color: #697586;
}

.status-warning {
  background: #fff3cd;
  color: #8a5a00;
}

.status-danger {
  background: #fde8e8;
  color: #b42318;
}

.replenishment-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.replenishment-suggestion {
  color: #0d6efd;
  font-size: 1.15rem;
  font-weight: 700;
}

.replenishment-card {
  display: grid;
  gap: .8rem;
  min-width: 0;
}

.replenishment-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.replenishment-card-identity { min-width: 0; }
.replenishment-card-identity .item-code,
.replenishment-card-identity h3,
.replenishment-card-spec,
.replenishment-card-warehouse { overflow-wrap: anywhere; }
.replenishment-card-header .status-pill { flex: 0 0 auto; }

.replenishment-card-spec {
  color: var(--bs-secondary-color);
  font-size: .9rem;
}

.replenishment-card-warehouse {
  color: #42566f;
  font-weight: 600;
}

.replenishment-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem .9rem;
  margin: 0;
}

.replenishment-card-metrics > div { min-width: 0; }
.replenishment-card-metrics dt {
  color: var(--bs-secondary-color);
  font-size: .78rem;
  font-weight: 600;
}

.replenishment-card-metrics dd {
  margin: .12rem 0 0;
  color: #1c2c3a;
  font-size: 1.1rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.replenishment-card-suggestion dd { color: #0d6efd; }

.replenishment-stock-level { min-width: 0; }
.replenishment-stock-track {
  position: relative;
  height: .55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eeec;
}

.replenishment-stock-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--current-stock) * 1%);
  border-radius: inherit;
  background: var(--scm-teal);
}

.replenishment-stock-marker {
  position: absolute;
  top: -.15rem;
  bottom: -.15rem;
  width: .13rem;
  border-radius: 999px;
  background: #b7791f;
}

.replenishment-stock-marker-safety { left: calc(var(--safety-stock) * 1%); }
.replenishment-stock-marker-target { left: calc(var(--target-stock) * 1%); background: var(--scm-orange); }
.replenishment-stock-legend {
  position: relative;
  height: 1rem;
  margin-top: .3rem;
  color: var(--bs-secondary-color);
  font-size: .72rem;
}

.replenishment-stock-label {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

.replenishment-stock-label-current { left: 0; }
.replenishment-stock-label-safety {
  left: calc(var(--safety-stock) * 1%);
  transform: translateX(-50%);
}

.replenishment-stock-label-target {
  left: calc(var(--target-stock) * 1%);
  transform: translateX(-100%);
}

.replenishment-card-updated {
  color: var(--bs-secondary-color);
  font-size: .78rem;
}

.alert-metric { border-color: #f5c26b; }
.danger-metric { border-color: #f4a5a5; }
.warning-metric { border-color: #ffe08a; }

.empty-cell {
  padding: 2rem !important;
  color: #7a8798 !important;
  text-align: center;
}

.authorization-toolbar {
  display: grid;
  grid-template-columns: 11rem 8rem 11rem 12rem;
  gap: 1rem;
  max-width: none;
}

.authorization-toolbar > * { min-width: 0; }

.authorization-table-wrap {
  border: 1px solid #e5eaf0;
  border-radius: .65rem;
}

.authorization-table {
  min-width: 78rem;
}

.authorization-table > :not(caption) > * > * {
  vertical-align: top;
}

.authorization-table th:nth-child(1),
.authorization-table td:nth-child(1) {
  min-width: 9rem;
}

.authorization-table th:nth-child(2),
.authorization-table td:nth-child(2) {
  min-width: 8rem;
}

.authorization-table th:nth-child(3),
.authorization-table td:nth-child(3) {
  min-width: 17rem;
}

.authorization-table th:nth-child(4),
.authorization-table td:nth-child(4) {
  min-width: 24rem;
}

.authorization-table th:nth-child(5),
.authorization-table td:nth-child(5) {
  min-width: 7rem;
}

.authorization-table th:nth-child(6),
.authorization-table td:nth-child(6) {
  min-width: 6rem;
}

.employee-active-toggle + .form-check-label {
  white-space: nowrap;
}

.employee-code {
  color: #42566f;
  font-family: var(--bs-font-monospace);
  font-size: .86rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.authorization-options {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .8rem;
}

.authorization-option,
.warehouse-actions label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  white-space: nowrap;
}

.authorization-option .form-check-input,
.warehouse-actions .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.warehouse-options {
  display: grid;
  gap: .5rem;
}

.warehouse-option {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid #edf0f4;
}

.warehouse-option:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.warehouse-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .45rem;
}

.warehouse-label span:not(.status-pill) {
  color: #64748b;
}

.warehouse-actions {
  display: flex;
  gap: .75rem;
}

.permission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  min-width: 16rem;
}

.permission-chip {
  display: inline-block;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: #eef4fb;
  color: #34516f;
  font-size: .78rem;
}

.role-editor-form {
  display: grid;
  gap: 1rem;
}

.role-editor-section {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-sm);
  background: var(--scm-teal-faint);
}

.role-editor-section-header,
.role-permission-group-header,
.role-editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
}

.role-editor-section-header {
  margin-bottom: 1rem;
}

.role-editor-section-header h3,
.role-permission-group-header h4 {
  margin: 0;
  color: var(--scm-ink);
  font-weight: 750;
}

.role-editor-section-header h3 { font-size: 1.05rem; }
.role-permission-group-header h4 { font-size: .95rem; }

.role-editor-section-header p {
  margin: .25rem 0 0;
  color: var(--scm-muted);
  font-size: .84rem;
}

.role-basic-grid,
.role-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.role-basic-grid > div,
.role-permission-group,
.role-permission-option,
.role-permission-copy {
  min-width: 0;
}

.role-permission-count {
  flex: 0 0 auto;
  padding: .3rem .65rem;
  border-radius: 999px;
  color: var(--scm-teal);
  background: var(--scm-teal-soft);
  font-size: .8rem;
  font-weight: 750;
  white-space: nowrap;
}

.role-permission-groups {
  display: grid;
  gap: 1rem;
}

.role-permission-group {
  padding: 1rem;
  border: 1px solid #dfe8e5;
  border-radius: .75rem;
  background: #fff;
}

.role-permission-group-header {
  margin-bottom: .75rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid #edf1ef;
}

.role-permission-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .7rem;
  padding: .85rem;
  border: 1px solid var(--scm-border);
  border-radius: .65rem;
  background: #fff;
  cursor: pointer;
}

.role-permission-option:hover,
.role-permission-option:focus-within {
  border-color: #8bc5ba;
  background: var(--scm-teal-faint);
}

.role-permission-option .form-check-input {
  flex: 0 0 auto;
  margin: .2rem 0 0;
}

.role-permission-copy {
  display: grid;
  gap: .28rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.role-permission-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}

.role-permission-description,
.role-permission-menu {
  color: var(--scm-muted);
  font-size: .8rem;
  line-height: 1.45;
}

.role-permission-menu strong {
  color: #52615e;
  font-weight: 700;
}

.role-editor-actions {
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--scm-border);
}

@media (max-width: 991.98px) {
  .role-permission-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .authorization-toolbar {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-editor-section {
    padding: 1rem;
  }

  .role-basic-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  .role-editor-section-header,
  .role-permission-group-header {
    align-items: flex-start;
  }

  .role-permission-count {
    white-space: normal;
  }

  .role-editor-actions .btn {
    width: 100%;
  }
}

.compact-list {
  margin: 0;
  padding: 0;
  border: 1px solid #e5eaf0;
  border-radius: .65rem;
  list-style: none;
}

.compact-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .8rem;
  border-bottom: 1px solid #edf0f4;
}

.compact-list li:last-child {
  border-bottom: 0;
}

.compact-list span {
  color: #64748b;
}

.master-data-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.item-editor-heading,
.item-editor-form {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
}

.item-editor-form {
  gap: 1.15rem;
}

.item-editor-form,
.item-editor-form > *,
.item-editor-grid > *,
.item-identification-grid > * {
  min-width: 0;
}

.item-editor-section {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-sm);
  background: var(--scm-teal-faint);
}

.item-editor-section-heading {
  margin-bottom: 1rem;
}

.item-editor-section-heading h3 {
  margin: 0;
  color: var(--scm-ink);
  font-size: 1.05rem;
  font-weight: 750;
}

.item-editor-section-heading p {
  margin: .3rem 0 0;
  color: var(--scm-muted);
  font-size: .875rem;
}

.item-editor-grid,
.item-identification-grid {
  display: grid;
  gap: 1rem;
}

.item-editor-grid-primary {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.8fr);
}

.item-editor-grid-secondary {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.05fr) minmax(0, .7fr);
  margin-top: 1rem;
}

.item-identification-grid {
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 9rem);
  align-items: start;
}

.item-editor-field,
.item-editor-field :is(input, select, textarea) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.item-editor-field :is(input, select, textarea) {
  box-sizing: border-box;
}

.item-qr-preview {
  display: grid;
  justify-items: center;
  gap: .65rem;
}

.item-qr-frame {
  display: grid;
  width: 8rem;
  height: 8rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--scm-border);
  border-radius: .75rem;
  background: #fff;
}

.item-qr-image {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
}

.item-qr-placeholder {
  padding: .75rem;
  color: var(--scm-muted);
  font-size: .82rem;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}

.item-qr-preview figcaption {
  display: grid;
  max-width: 100%;
  gap: .15rem;
  color: var(--scm-muted);
  font-size: .78rem;
  text-align: center;
}

.item-qr-preview figcaption strong {
  max-width: 100%;
  color: var(--scm-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.item-business-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: .45rem;
  margin: 0;
}

.item-business-option .form-check-input {
  flex: 0 0 auto;
  margin-left: 0;
}

.item-business-option .form-check-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.item-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--scm-border);
}

@media (max-width: 1199.98px) {
  .item-editor-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .item-editor-form :is(input:not([type="hidden"]), select, textarea) {
    font-size: 16px;
  }
}

@media (max-width: 767.98px) {
  .item-editor-grid-primary,
  .item-editor-grid-secondary,
  .item-identification-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .item-editor-section {
    padding: 1rem;
  }

  .item-qr-preview {
    justify-items: start;
  }

  .item-qr-preview figcaption {
    text-align: left;
  }
}

@media (max-width: 575.98px) {
  .item-editor-actions .btn {
    width: 100%;
  }
}

.master-data-form .form-control[readonly],
.master-data-form .form-select:disabled {
  border-color: #cbd5e1;
  background-color: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
}

.directory-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: end;
}

.directory-toolbar > * {
  flex: 0 0 11rem;
  width: 11rem;
}

.directory-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.directory-table-wrap {
  max-height: 68vh;
}

/* The directory result table owns the remaining desktop viewport.  This keeps
   long directory data scrollable inside its card instead of leaving page canvas
   below a short result card. */
@media (min-width: 992px) {
  .app-content.app-content-directory-sync {
    display: flex;
    min-height: 100vh;
  }

  .app-content.app-content-directory-sync .app-main,
  .app-content.app-content-directory-sync #scm-page-content,
  .directory-sync-page {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
  }

  .directory-sync-results {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    margin-bottom: 0 !important;
  }

  .directory-sync-results .directory-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
  }
}

.directory-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.directory-sort-button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.directory-sort-button:hover,
.directory-sort-button:focus-visible {
  color: var(--bs-primary);
}

.directory-sort-indicator {
  min-width: .75rem;
  color: var(--bs-primary);
  font-size: .72em;
}

.directory-table td {
  min-width: 6rem;
}

.directory-table td:nth-child(3) {
  min-width: 12rem;
}

.directory-table .directory-account-column {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

.directory-table .directory-synced-at-column {
  width: 12rem;
  min-width: 12rem;
  white-space: nowrap;
}

.directory-pagination {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: 1rem;
}

.directory-page-range {
  color: var(--scm-muted);
  font-size: .86rem;
}

.directory-page-size {
  width: 7.5rem;
}

.directory-page-buttons {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.directory-page-buttons .btn {
  min-width: 2.2rem;
}

.directory-page-ellipsis {
  padding: 0 .25rem;
  color: var(--scm-muted);
}

.directory-row-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 14rem;
}

.directory-row-added > td {
  background-color: #edfbf2;
}

.directory-row-deleted > td {
  background-color: #fff0f1;
}

.directory-row-changed > td {
  background-color: #fff8df;
}

.difference-added {
  background: #d8f3e2;
  color: #17663a;
}

.difference-deleted {
  background: #fbdde0;
  color: #9b2632;
}

.difference-changed {
  background: #fff0b8;
  color: #735600;
}

.difference-abnormal {
  background: #e9e2ff;
  color: #59409a;
}

.difference-neutral {
  background: #e8eef6;
  color: #41536b;
}

@media (max-width: 991.98px) {
  .directory-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
  }

  .directory-toolbar > * {
    width: auto;
  }

  .directory-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575.98px) {
  .directory-toolbar {
    grid-template-columns: 1fr;
  }

  .directory-search {
    grid-column: auto;
  }

  .directory-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .directory-page-buttons {
    flex-wrap: wrap;
  }
}

.dashboard-eyebrow {
  font-size: 1rem;
}

.document-line-list {
  display: grid;
  gap: 1rem;
}

/* Desktop document rows form one contiguous table; cards retain their mobile gap. */
@media (min-width: 992px) {
  .document-lines-table .document-line-list {
    gap: 0;
    row-gap: 0;
  }

  .document-lines-table .document-line-cell { padding: .35rem .5rem; }
  .document-lines-table .document-line-number { padding-top: .85rem; }
}

.document-line-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #d8e1ec;
  border-radius: 0.85rem;
  background: #f8fafc;
}

.document-line-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.document-lines-table {
  overflow-x: auto;
  border: 1px solid #d8e1ec;
  border-radius: .75rem;
}

.entry-success-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.entry-success-actions { display: inline-flex; flex-wrap: wrap; gap: 1rem; font-weight: 700; }
.entry-success-actions a { color: var(--scm-teal-dark); }
.entry-success-actions a:hover,
.entry-success-actions a:focus-visible { color: var(--scm-teal); }

.document-line-table-head,
.document-line-card {
  display: grid;
  grid-template-columns: 3rem minmax(13rem, 2.1fr) minmax(7rem, 1fr) minmax(5rem, .65fr) minmax(9rem, 1.15fr) minmax(9rem, 1.15fr) minmax(7rem, .75fr) minmax(9rem, 1fr) 4rem;
  min-width: 67rem;
  align-items: start;
}

.issue-document-lines .document-line-table-head,
.issue-document-lines .document-line-card {
  grid-template-columns: 3rem minmax(13rem, 2fr) minmax(7rem, .9fr) minmax(5rem, .6fr) minmax(9rem, 1.1fr) minmax(9rem, 1.1fr) minmax(7rem, .7fr) minmax(7rem, .7fr) minmax(9rem, 1fr) 4rem;
  min-width: 71rem;
}

.document-line-table-head {
  color: #475569;
  background: #f1f5f9;
  font-size: .82rem;
  font-weight: 700;
}

.document-line-table-head > div,
.document-line-cell {
  min-width: 0;
  padding: .65rem .5rem;
  border-right: 1px solid #e2e8f0;
}

.document-line-table-head > div:last-child,
.document-line-cell:last-child { border-right: 0; }

.document-line-card {
  padding: 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  background: #fff;
}

.document-line-card:first-child { border-top: 0; }

.document-line-cell .form-label {
  display: none;
}

.document-line-number {
  padding-top: 1.15rem;
  text-align: center;
  color: #64748b;
}

.document-line-remove { text-align: center; }
.document-line-remove [data-remove-line][hidden] { display: none; }

.search-select {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.search-select-menu {
  position: fixed;
  z-index: 2000;
  max-width: calc(100vw - 1rem);
  max-height: 16rem;
  overflow-y: auto;
  padding: .25rem;
  border: 1px solid #cbd5e1;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 .75rem 1.5rem rgba(15, 23, 42, .14);
}

.search-select-menu.search-select-menu-inline {
  position: absolute;
  top: calc(100% + .25rem);
  left: 0;
  width: 100%;
  max-width: 100%;
}

.document-entry-header {
  display: grid;
  grid-template-columns: 18rem 13rem 6rem;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.document-entry-header > [class*="col-"] {
  width: auto;
  max-width: none;
  min-width: 0;
  padding: 0;
}

.document-entry-header-inbound > :nth-child(3),
.document-entry-header-issue > :nth-child(3) { order: 1; }

.document-entry-header-inbound > :nth-child(1),
.document-entry-header-issue > :nth-child(1) { order: 2; }

.document-entry-header-inbound > :nth-child(2),
.document-entry-header-issue > :nth-child(2) { order: 3; }

@media (max-width: 991.98px) {
  .document-entry-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .document-entry-header > [class*="col-"] { width: 100%; }
}

.search-select-option {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: .5rem .65rem;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  color: #0f172a;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.search-select-option:hover,
.search-select-option:focus { background: #eaf2ff; }

.document-readonly-value {
  min-width: 0;
  min-height: 2.35rem;
  padding: .5rem .6rem;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  background: #f8fafc;
  color: #475569;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Inventory operation forms must shrink with the viewport; wide detail tables
   keep their scrolling inside .document-lines-table. */
.inventory-operation-form,
.inventory-operation-surface {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.inventory-operation-form > *,
.inventory-operation-form .row > [class*="col-"],
.inventory-operation-form .document-entry-header,
.inventory-operation-form .document-entry-header > *,
.inventory-operation-form .document-lines-table {
  max-width: 100%;
  min-width: 0;
}

.inventory-operation-form :is(input.form-control, select.form-select, textarea.form-control) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.inventory-operation-form [data-search-input],
.inventory-operation-form select.form-select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-operation-form .btn,
.inventory-operation-surface .btn {
  max-width: 100%;
  box-sizing: border-box;
}

.stocktake-reviewer-select {
  width: 14rem;
  max-width: 100%;
  min-width: 0;
}

.inventory-operation-surface :is(.stocktake-actions, .stocktake-actions > *, .stocktake-actions form > *) {
  min-width: 0;
}

.stocktake-action-button {
  flex: 0 0 auto;
  min-width: 4.25rem;
  white-space: nowrap;
}

.inventory-operation-surface .stocktake-card-heading > * {
  max-width: 100%;
  min-width: 0;
}

.inventory-operation-surface :is(.stocktake-item-code, h2, p, [data-stocktake-progress]) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* iOS Safari and WeCom WKWebView zoom focused controls below 16px. Keep this
   scoped to inventory operation surfaces so labels and supporting copy retain
   the existing compact typography. */
@media (max-width: 991.98px) {
  .inventory-operation-form :is(input:not([type="hidden"]), select, textarea),
  .inventory-operation-surface :is(input:not([type="hidden"]), select, textarea) {
    font-size: 16px;
  }
}

@media (max-width: 767.98px) {
  .inventory-operation-form .section-heading,
  .inventory-operation-form .section-heading > *,
  .inventory-operation-surface .stocktake-actions,
  .inventory-operation-surface .stocktake-actions > *,
  .inventory-operation-surface .stocktake-actions form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .inventory-operation-form .section-heading .d-flex,
  .inventory-operation-surface .stocktake-card-heading,
  .inventory-operation-surface .stocktake-actions form {
    flex-wrap: wrap;
  }

  .inventory-operation-form .btn,
  .inventory-operation-surface .stocktake-actions :is(.btn, .form-control, .form-select) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

.document-readonly-value[data-specification] {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.required-label::after,
.document-required-column::after {
  margin-left: .2rem;
  color: var(--scm-orange);
  content: "*";
  font-weight: 800;
}

.qr-scanner-viewport {
  position: relative;
  overflow: hidden;
  min-height: 18rem;
  border-radius: .85rem;
  background: #0f172a;
}

.qr-scanner-viewport video {
  display: block;
  width: 100%;
  min-height: 18rem;
  max-height: 65vh;
  object-fit: cover;
}

.qr-scanner-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(68vw, 16rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: .2rem solid rgba(255, 255, 255, .92);
  border-radius: .8rem;
  box-shadow: 0 0 0 999rem rgba(15, 23, 42, .38);
}

.qr-scanner-status { min-height: 1.5rem; font-weight: 600; }
.scan-match-highlight { outline: .2rem solid #0d6efd; outline-offset: .15rem; }

@media (max-width: 991.98px) {
  .document-lines-table { overflow: visible; border: 0; }
  .document-line-table-head { display: none; }
  .document-line-list { gap: 1rem; }
  .document-line-card {
    display: grid;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid #d8e1ec;
    border-radius: .85rem;
    background: #f8fafc;
  }
  .issue-document-lines .document-line-card { min-width: 0; grid-template-columns: 1fr; }
  .document-line-card:first-child { border-top: 1px solid #d8e1ec; }
  .document-line-cell { padding: 0; border: 0; }
  .document-line-cell .form-label { display: block; }
  .document-line-number { padding-top: 0; text-align: left; font-weight: 700; }
  .document-line-number::before { content: "明细 "; }
  .document-line-remove { text-align: right; }
}

.master-data-form .btn {
  justify-self: start;
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
  border-color: #cbd5e1;
  background-color: #e9eef5;
  color: #475569;
  cursor: not-allowed;
  opacity: 1;
}

.master-data-delete-blocked {
  display: inline-flex;
  cursor: help;
}

.master-data-delete-blocked:focus-visible {
  border-radius: .375rem;
  outline: 3px solid rgba(13, 110, 253, .25);
  outline-offset: 2px;
}

.master-data-delete-blocked > .btn:disabled {
  pointer-events: none;
}

.supplier-card,
.item-card,
.inventory-card,
.ledger-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  background: #fff;
}

.inventory-quantity {
  color: #126c45;
  font-size: 1.35rem;
}

.supplier-code,
.item-code {
  color: #64748b;
  font-size: .85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.supplier-details,
.item-details {
  display: grid;
  gap: .65rem;
}

.supplier-details > div,
.item-details > div {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: .75rem;
}

.supplier-details dt,
.item-details dt {
  color: #64748b;
  font-weight: 500;
}

.supplier-details dd,
.item-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.empty-card {
  padding: 1.5rem;
  color: #7a8798;
  text-align: center;
}

.validation-summary-valid {
  display: none;
}

.wecom-login-panel {
  margin-top: 2rem;
}

.organization-login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.organization-login-card {
  display: flex;
  min-height: 13rem;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
  border: 1px solid #dce5ef;
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff 0%, #eef5ff 100%);
  color: #172033;
  text-decoration: none;
  box-shadow: 0 .3rem 1.2rem rgba(20, 37, 63, .05);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.organization-login-card:hover,
.organization-login-card:focus-visible {
  border-color: #0d6efd;
  color: #172033;
  box-shadow: 0 .55rem 1.5rem rgba(13, 110, 253, .12);
  transform: translateY(-2px);
}

.organization-login-code {
  display: inline-flex;
  margin-bottom: 1.25rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: #e7effc;
  color: #315985;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.organization-login-card strong {
  margin-bottom: .4rem;
  font-size: 1.35rem;
}

.organization-login-card > span:not(.organization-login-code):not(.organization-login-action) {
  color: #64748b;
}

.organization-login-action {
  margin-top: auto;
  color: #0d6efd;
  font-weight: 600;
}

.wecom-qr-code {
  display: flex;
  min-height: 320px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wecom-qr-code iframe {
  width: 100%;
  max-width: 320px;
  height: 320px;
}

.report-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.report-filter-keyword {
  grid-column: span 2;
}

.report-filter-actions {
  display: flex;
  align-items: end;
  gap: .65rem;
}

.report-filter > div {
  min-width: 0;
}

.report-filter .form-label {
  margin-bottom: .35rem;
  color: #42566f;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
}

.report-filter-date { width: 9.5rem; }
.report-filter-datetime { width: 12.25rem; }
.report-filter-status { width: 8.5rem; }
.report-filter-employee { width: 9rem; }
.report-filter-keyword { min-width: 11rem; }

.report-table-wrap {
  overflow-x: auto;
  border: 1px solid #dfe8e8;
  border-radius: .75rem;
  background: #fff;
  scrollbar-color: #a7b8b8 transparent;
}

.report-table-wrap:focus-visible {
  outline: 3px solid rgba(0, 134, 116, .28);
  outline-offset: 2px;
}

.report-table {
  min-width: 76rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
}

.report-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .78rem .85rem;
  border-bottom: 1px solid #cfdcdc;
  background: #f4f8f7;
  color: #385454;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

.report-table tbody td {
  max-width: 15rem;
  padding: .75rem .85rem;
  border-color: #e7eeee;
  color: #2b3d45;
  vertical-align: middle;
  white-space: nowrap;
}

.report-table tbody tr:hover > * {
  background: #f4faf8;
}

.report-table-name {
  min-width: 9rem;
  max-width: 13rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-detail-table {
  min-width: 70rem;
}

@media (min-width: 1200px) {
  .report-filter {
    display: flex;
    align-items: end;
    gap: .75rem;
  }

  .report-filter-warehouse,
  .report-filter-location,
  .report-filter-item,
  .report-filter-supplier {
    flex: 1 1 12rem;
  }

  .report-filter-keyword {
    flex: 0 0 11rem;
  }

  .report-filter-actions {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .report-filter-actions .btn {
    min-width: 4.5rem;
  }

  .report-filter-returns .report-filter-item,
  .report-filter-inventory .report-filter-item {
    flex-basis: 10.5rem;
  }

  .report-filter-returns .report-filter-keyword,
  .report-filter-inventory .report-filter-keyword {
    flex-basis: 10rem;
  }
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .75rem;
}

.report-metrics .metric-card {
  min-height: 6rem;
}

.report-metrics .metric-card strong {
  font-size: 1.35rem;
}

.report-card-list {
  display: grid;
  gap: 1rem;
}

.replenishment-grid-heading,
.replenishment-grid-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.replenishment-grid-toolbar {
  display: grid;
  grid-template-columns: minmax(18rem, 32rem) minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
}

.replenishment-grid-wrap {
  max-height: 68vh;
  border: 1px solid #dfe6ee;
  border-radius: .75rem;
}

.replenishment-grid-table {
  min-width: 76rem;
}

.replenishment-grid-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.replenishment-grid-table thead th {
  background: #f5f8fb;
  border-bottom-color: #cfd9e5;
  color: #42566f;
  font-size: .84rem;
  white-space: nowrap;
}

.replenishment-grid-table tbody tr.is-dirty > * {
  background: #f0f7ff;
}

.replenishment-grid-table tbody tr.is-dirty > *:first-child {
  box-shadow: inset .2rem 0 0 #0d6efd;
}

.replenishment-grid-table th:nth-child(1),
.replenishment-grid-table td:nth-child(1) {
  min-width: 8rem;
}

.replenishment-grid-table th:nth-child(2),
.replenishment-grid-table td:nth-child(2) {
  min-width: 10rem;
}

.replenishment-grid-table th:nth-child(3),
.replenishment-grid-table td:nth-child(3) {
  min-width: 9rem;
}

.replenishment-grid-table th:nth-child(5),
.replenishment-grid-table td:nth-child(5) {
  min-width: 9rem;
}

.replenishment-quantity-cell {
  min-width: 13rem;
  vertical-align: top !important;
}

.replenishment-quantity-cell .input-group-text {
  min-width: 3rem;
  justify-content: center;
}

.replenishment-row-state {
  min-height: 1.25rem;
}

.report-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  background: #fff;
}

.report-card-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.report-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem 1rem;
  margin: 0;
}

.report-details > div {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: .5rem;
}

.report-details dt {
  color: #64748b;
  font-weight: 500;
}

.report-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .organization-login-grid {
    grid-template-columns: 1fr;
  }

  .organization-login-card {
    min-height: 11rem;
  }

  .report-filter,
  .report-metrics,
  .report-details {
    grid-template-columns: 1fr;
  }

  .report-filter-keyword {
    grid-column: auto;
  }

  .report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-card-title {
    flex-direction: column;
  }

  .replenishment-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.master-data-read-only form {
    display: none !important;
}

@media (max-width: 768px) {
  .report-filter-replenishment {
    grid-template-columns: minmax(0, 1fr) minmax(7rem, .55fr);
    gap: .75rem;
  }

  .report-filter-replenishment .report-filter-keyword,
  .report-filter-replenishment .report-filter-actions {
    grid-column: 1 / -1;
  }

  .report-filter-replenishment .report-filter-actions {
    align-items: center;
    gap: .55rem;
  }

  .replenishment-maintenance-link {
    padding-inline: .7rem;
    font-size: .875rem;
  }

  .replenishment-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .replenishment-report-panel .report-table-footer-compact-mobile {
    align-items: flex-start;
    flex-direction: column;
    gap: .65rem;
  }

  .replenishment-report-panel .report-table-footer-compact-mobile .report-pager {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .replenishment-report-panel .report-pager-first,
  .replenishment-report-panel .report-pager-last,
  .replenishment-report-panel .report-pager-page:not(.is-current),
  .replenishment-report-panel .report-page-ellipsis { display: none; }

  .replenishment-report-panel .report-page-jump { margin-left: 0; }
}

.master-data-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.master-data-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.master-data-transfer-actions .btn,
.master-data-keyword-filter .btn,
.master-data-keyword-filter .form-control {
  min-height: 2.375rem;
}

.master-data-transfer-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.master-data-keyword-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .5rem;
  margin-top: 1rem;
}

.master-data-keyword-field {
  flex: 1 1 18rem;
  max-width: 30rem;
}

.master-data-keyword-field .form-label {
  margin-bottom: .375rem;
}

.master-data-filter-count {
  align-self: center;
  color: var(--bs-secondary-color);
  margin-left: .25rem;
}

@media (max-width: 767.98px) {
  .master-data-page-header {
    grid-template-columns: 1fr;
  }

  .master-data-transfer-actions {
    justify-content: flex-start;
  }

  .master-data-keyword-field {
    flex-basis: 100%;
    max-width: none;
  }

  .master-data-filter-count {
    flex-basis: 100%;
    margin-left: 0;
  }
}

.transfer-count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .75rem;
}

.transfer-count-grid > span {
    padding: .75rem;
    border-radius: .75rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}

.transfer-count-grid strong {
    display: block;
    color: var(--bs-body-color);
    font-size: 1.2rem;
}

.transfer-json {
    display: block;
    min-width: 12rem;
    max-width: 28rem;
    white-space: normal;
    overflow-wrap: anywhere;
}
/* Inventory document photo attachments */
.document-attachments { scroll-margin-top: 6rem; }
.stocktake-replacement-target { scroll-margin-top: 6rem; }
.stocktake-create-row > [class*="col-"] { min-width: 0; }
@media (min-width: 992px) {
    .stocktake-create-action { padding-top: 1.62rem; }
}
.stocktake-table-wrap { overflow-x: auto; }
.stocktake-table {
    min-width: 70rem;
    font-size: .84rem;
}
.table.stocktake-table > :not(caption) > * > * { padding: .58rem .62rem; }
.stocktake-table th:nth-child(1) { width: 10rem; }
.stocktake-table th:nth-child(2) { width: 11rem; }
.stocktake-table th:nth-child(3) { width: 9rem; }
.stocktake-table th:nth-child(4) { width: 10rem; }
.stocktake-table th:nth-child(5) { width: 4.5rem; }
.stocktake-table th:nth-child(6) { width: 6.5rem; }
.stocktake-table th:nth-child(7) { width: 8rem; }
.stocktake-table th:nth-child(8) { min-width: 10rem; }
.stocktake-table th:nth-child(9) { width: 7.5rem; }
.stocktake-item-code { white-space: nowrap; }
.stocktake-count-input,
.stocktake-remark-input { min-height: 2.3rem; padding: .42rem .55rem; font-size: .84rem; }
.stocktake-save-cell { text-align: center; }
.stocktake-save-cell [data-count-save-status] { min-height: 1.15rem; }
.stocktake-incomplete-highlight {
    outline: .2rem solid var(--scm-orange);
    outline-offset: .15rem;
}

@media (max-width: 991.98px) {
    .stocktake-table-wrap { overflow: visible; border: 0; }
    .stocktake-table { display: block; min-width: 0; }
    .stocktake-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .stocktake-table tbody { display: grid; gap: .85rem; }
    .stocktake-table tbody tr {
        display: grid;
        overflow: hidden;
        border: 1px solid var(--scm-border);
        border-radius: var(--scm-radius-sm);
        background: #fff;
    }
    .table.stocktake-table tbody tr > td {
        display: grid;
        grid-template-columns: 6.5rem minmax(0, 1fr);
        gap: .65rem;
        align-items: center;
        padding: .62rem .75rem;
        border-bottom: 1px solid #edf1ef !important;
    }
    .table.stocktake-table tbody tr > td::before {
        color: var(--scm-muted);
        font-size: .78rem;
        font-weight: 700;
        content: attr(data-label);
    }
    .table.stocktake-table tbody tr > td:last-child { border-bottom: 0 !important; }
    .stocktake-table .stocktake-save-cell { text-align: left; }
    .stocktake-table .stocktake-save-cell form { width: 100%; }
}

.attachment-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1rem;
}

.attachment-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-body-bg);
}

.attachment-preview-link {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef2f6;
}

.attachment-preview-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-card-body {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .75rem;
    color: var(--bs-secondary-color);
    font-size: .875rem;
}

.attachment-file-name {
    overflow: hidden;
    color: var(--bs-body-color);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-upload-status {
    display: grid;
    gap: .5rem;
    margin-bottom: 1rem;
}

.attachment-upload-status:empty {
    display: none;
}

.attachment-upload-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(7rem, 12rem) minmax(8rem, auto);
    gap: .75rem;
    align-items: center;
    padding: .65rem .75rem;
    border-radius: .5rem;
    background: #f4f7fa;
    font-size: .875rem;
}

.attachment-upload-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-upload-row.is-success { color: var(--bs-success); }
.attachment-upload-row.is-error { color: var(--bs-danger); }

@media (min-width: 769px) {
    .attachment-camera-button { display: none; }
}

@media (max-width: 768px) {
    .attachment-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attachment-upload-row { grid-template-columns: 1fr; gap: .35rem; }
    .attachment-upload-row progress { width: 100%; }
}

/* V0.10.0 global brand system ------------------------------------------------ */
:root {
  --scm-teal: #037f69;
  --scm-teal-dark: #026756;
  --scm-teal-soft: #e8f4f1;
  --scm-teal-faint: #f3f9f7;
  --scm-orange: #e6450a;
  --scm-orange-soft: #fff0e9;
  --scm-ink: #26312f;
  --scm-muted: #687572;
  --scm-canvas: #f5f7f6;
  --scm-surface: #fff;
  --scm-border: #dce5e2;
  --scm-border-strong: #cbd8d4;
  --scm-danger: #c73232;
  --scm-warning: #a76000;
  --scm-success: #08735f;
  --scm-radius-sm: .5rem;
  --scm-radius: .75rem;
  --scm-radius-lg: 1rem;
  --scm-shadow-sm: 0 1px 2px rgb(25 51 45 / 5%), 0 5px 18px rgb(25 51 45 / 4%);
  --scm-shadow: 0 12px 34px rgb(25 51 45 / 8%);
}

html { background: var(--scm-canvas); }

body {
  color: var(--scm-ink);
  background: var(--scm-canvas);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  letter-spacing: .005em;
}

a { color: var(--scm-teal); }
a:hover { color: var(--scm-teal-dark); }

::selection { color: var(--scm-ink); background: #cfeae4; }

:focus-visible {
  outline: 3px solid rgb(3 127 105 / 24%);
  outline-offset: 2px;
}

.text-primary { color: var(--scm-teal) !important; }
.text-secondary, .text-muted { color: var(--scm-muted) !important; }
.bg-primary, .text-bg-primary { background-color: var(--scm-teal) !important; }

.app-topbar {
  height: 4.5rem;
  border-bottom: 1px solid var(--scm-border);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 1px 0 rgb(25 51 45 / 2%);
  backdrop-filter: blur(12px);
}

.app-sidebar {
  width: 16.5rem;
  padding: 1.25rem 1rem 1rem;
  border-right: 1px solid var(--scm-border);
  background: var(--scm-surface);
  box-shadow: none;
}

.app-content { margin-left: 16.5rem; padding-top: 4.5rem; }
.app-main { width: min(100%, 96rem); margin: 0 auto; padding: 1.5rem 2rem 3rem; }

.app-logo-link {
  background: transparent;
  border-radius: 0;
}

.app-logo-image,
.login-brand-logo {
  background-color: transparent;
  background-size: contain;
}

.app-logo-image { background-size: auto 190%; }

.app-logo-link-topbar { width: 8.8rem; height: 2.2rem; }
.app-logo-link-sidebar { height: 3.1rem; margin-bottom: .65rem; }
.app-logo-link-mobile { width: 8.8rem; height: 2.3rem; }
.app-logo-link-public { width: 9.5rem; height: 2.5rem; }

.app-company-name {
  margin-left: .9rem;
  padding-left: .9rem;
  border-left: 1px solid var(--scm-border);
  color: var(--scm-muted);
  font-size: .82rem;
}

.app-user-actions { gap: .65rem; }
.app-user-name { color: var(--scm-ink); font-size: .86rem; font-weight: 650; }
.app-menu-button { color: var(--scm-teal); border-color: var(--scm-border); background: var(--scm-surface); }

.sidebar-brand { border-color: var(--scm-border); }
.sidebar-navigation { gap: .2rem; padding: .55rem 0; }
.sidebar-link,
.sidebar-group > summary,
.sidebar-subgroup > summary {
  min-height: 2.6rem;
  border-radius: var(--scm-radius-sm);
  color: #52615e;
  font-size: .89rem;
  font-weight: 600;
}

.sidebar-link:hover,
.sidebar-group > summary:hover,
.sidebar-subgroup > summary:hover {
  color: var(--scm-teal-dark);
  background: var(--scm-teal-faint);
}

.sidebar-link.active {
  color: var(--scm-teal-dark);
  background: var(--scm-teal-soft);
  box-shadow: inset 3px 0 0 var(--scm-orange);
}

.sidebar-link.active::before { display: none; }
.sidebar-group.active > summary,
.sidebar-subgroup.active > summary { color: var(--scm-teal); }
.sidebar-group.active { border-color: transparent; background: transparent; }
.sidebar-submenu { border-left-color: var(--scm-border); }
.sidebar-version { color: #8a9693; font-size: .72rem; letter-spacing: .04em; }

.page-breadcrumb {
  min-height: 2rem;
  margin-bottom: 1rem;
  color: #899491;
  font-size: .78rem;
}

.page-breadcrumb span[aria-hidden="true"] { color: #bcc7c4; }
.page-breadcrumb strong { color: var(--scm-teal-dark); font-weight: 700; }

.eyebrow {
  color: var(--scm-teal);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, h4, h5, h6 { color: var(--scm-ink); letter-spacing: -.015em; }
.h2, h1.h2 { font-size: clamp(1.55rem, 2vw, 2rem); font-weight: 760; }
.h4, h2.h4 { font-weight: 720; }

.dashboard-hero {
  position: relative;
  overflow: hidden;
  padding: 1.8rem 2rem;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-lg);
  background: var(--scm-surface);
  box-shadow: var(--scm-shadow-sm);
}

.dashboard-hero::after {
  position: absolute;
  top: 0;
  right: 0;
  width: .38rem;
  height: 100%;
  background: var(--scm-orange);
  content: "";
}

.dashboard-eyebrow { color: var(--scm-teal); }
.company-code {
  padding: .22rem .55rem;
  border-radius: 999px;
  color: var(--scm-teal-dark);
  background: var(--scm-teal-soft);
  font-size: .75rem;
  font-weight: 750;
}

.content-panel,
.metric-card {
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius);
  background: var(--scm-surface);
  box-shadow: var(--scm-shadow-sm);
}

.content-panel { padding: 1.35rem; }
.metric-card { min-height: 7.25rem; padding: 1.2rem 1.35rem; }
.metric-card span { color: var(--scm-muted); font-size: .78rem; font-weight: 650; }
.metric-card strong { color: var(--scm-ink); font-size: 1.85rem; font-weight: 780; }
.metric-card::before { background: var(--scm-teal); }
.metric-card.alert-metric::before,
.metric-card.warning-metric::before { background: var(--scm-orange); }
.metric-card.danger-metric::before { background: var(--scm-danger); }
.dashboard-shortcut { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.dashboard-shortcut:hover { border-color: var(--scm-border-strong); box-shadow: var(--scm-shadow); transform: translateY(-1px); }

.btn {
  min-height: 2.5rem;
  border-radius: var(--scm-radius-sm);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.25;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.btn-sm { min-height: 2rem; font-size: .78rem; }
.btn-primary { border-color: var(--scm-teal); background: var(--scm-teal); }
.btn-primary:hover, .btn-primary:focus { border-color: var(--scm-teal-dark); background: var(--scm-teal-dark); }
.btn-outline-primary { color: var(--scm-teal); border-color: #8bc5ba; background: #fff; }
.btn-outline-primary:hover, .btn-outline-primary:focus { color: #fff; border-color: var(--scm-teal); background: var(--scm-teal); }
.btn-outline-secondary { color: #52615e; border-color: var(--scm-border-strong); background: #fff; }
.btn-outline-secondary:hover { color: var(--scm-ink); border-color: #aebdb9; background: var(--scm-canvas); }
.btn-warning, .btn-outline-warning { color: #844900; border-color: #e6ad66; }
.btn:active { transform: translateY(1px); }
.btn:disabled { transform: none; }

.form-label { margin-bottom: .42rem; color: #4e5c59; font-size: .8rem; font-weight: 700; }
.form-control, .form-select {
  min-height: 2.65rem;
  border-color: var(--scm-border-strong);
  border-radius: var(--scm-radius-sm);
  color: var(--scm-ink);
  background-color: #fff;
  font-size: .9rem;
}

.form-control:hover, .form-select:hover { border-color: #a9bab6; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--scm-teal);
  box-shadow: 0 0 0 .2rem rgb(3 127 105 / 14%);
}

.form-check-input:checked { border-color: var(--scm-teal); background-color: var(--scm-teal); }
.input-group-text { color: var(--scm-muted); border-color: var(--scm-border-strong); background: var(--scm-canvas); }

.table-responsive { border: 1px solid var(--scm-border); border-radius: var(--scm-radius-sm); }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--scm-teal-faint); margin-bottom: 0; color: var(--scm-ink); }
.table > :not(caption) > * > * { padding: .78rem .85rem; border-bottom-color: #e7ecea; }
.table thead th {
  color: #56635f;
  background: #f4f7f6;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .025em;
  white-space: nowrap;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.empty-cell { padding: 2.4rem !important; color: var(--scm-muted) !important; text-align: center; }

.nav-tabs { gap: .35rem; border-bottom-color: var(--scm-border); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--scm-muted); font-size: .88rem; font-weight: 700; }
.nav-tabs .nav-link:hover { color: var(--scm-teal); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--scm-teal-dark); border-bottom-color: var(--scm-orange); background: transparent; }

.alert {
  position: relative;
  padding: .9rem 1rem .9rem 1.15rem;
  border-width: 1px;
  border-radius: var(--scm-radius-sm);
  font-size: .875rem;
  box-shadow: none;
}
.alert::before { position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: var(--scm-radius-sm) 0 0 var(--scm-radius-sm); content: ""; }
.alert-success { color: #075f50; border-color: #b9ddd5; background: #edf8f5; }
.alert-success::before { background: var(--scm-success); }
.alert-danger { color: #8e2727; border-color: #ebc2c2; background: #fff1f1; }
.alert-danger::before { background: var(--scm-danger); }
.alert-warning { color: #744700; border-color: #ead2a8; background: #fff8e9; }
.alert-warning::before { background: var(--scm-orange); }
.alert-info, .alert-secondary { color: #435450; border-color: var(--scm-border); background: var(--scm-teal-faint); }
.alert-info::before, .alert-secondary::before { background: var(--scm-teal); }

.badge { border-radius: 999px; font-weight: 750; }
.text-bg-danger { background-color: var(--scm-orange) !important; }
.pagination .page-link { color: var(--scm-teal); border-color: var(--scm-border); }
.pagination .active > .page-link { color: #fff; border-color: var(--scm-teal); background: var(--scm-teal); }

.modal-content { overflow: hidden; border: 1px solid var(--scm-border); border-radius: var(--scm-radius-lg); box-shadow: 0 24px 70px rgb(19 45 39 / 18%); }
.modal-header, .modal-footer { border-color: var(--scm-border); }
.modal-header { gap: .7rem; }
.scm-dialog-symbol { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: var(--scm-orange); background: var(--scm-orange-soft); font-weight: 900; }
.scm-confirm-modal .modal-body { color: #52615e; line-height: 1.7; }

/* Login */
.login-body { min-width: 20rem; margin-bottom: 0; background: #fff; }
.login-main { min-height: 100vh; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(30rem, 44%) 1fr; }
.login-brand-panel, .login-access-panel { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: center; }
.login-brand-panel { overflow: hidden; padding: 4rem clamp(3rem, 5vw, 5.5rem); border-right: 1px solid var(--scm-border); background: var(--scm-canvas); }
.login-brand-content { position: relative; z-index: 1; width: min(100%, 34rem); }
.login-brand-logo { width: min(100%, 29rem); height: 9rem; margin: 0 0 3.25rem; background-position: left center; }
.login-brand-copy h1 { margin: 0 0 1.25rem; font-size: clamp(2.25rem, 3.4vw, 3.55rem); font-weight: 780; line-height: 1.2; letter-spacing: -.04em; }
.login-brand-copy h1::after { display: block; width: 3.25rem; height: .28rem; margin-top: 1.4rem; background: var(--scm-orange); content: ""; }
.login-brand-copy > p:last-child { max-width: 29rem; margin: 0; color: var(--scm-muted); font-size: 1rem; line-height: 1.9; }
.login-brand-decoration { position: absolute; right: -4rem; bottom: 7rem; display: grid; gap: 1rem; opacity: .55; transform: rotate(-8deg); }
.login-brand-decoration span { display: block; width: 17rem; height: 1px; background: #c6d8d4; }
.login-brand-decoration span:nth-child(2) { width: 12rem; margin-left: 3rem; background: var(--scm-teal); }
.login-brand-decoration span:nth-child(3) { width: 6rem; margin-left: 8rem; background: var(--scm-orange); }
.login-copyright { position: absolute; bottom: 2rem; left: clamp(3rem, 5vw, 5.5rem); color: #899491; font-size: .75rem; }
.login-access-panel { padding: 4rem clamp(3rem, 8vw, 8rem); background: #fff; }
.login-access-content { width: min(100%, 42rem); margin: 0 auto; }
.login-heading { margin-bottom: 2rem; }
.login-heading h2 { margin-bottom: .65rem; font-size: clamp(1.9rem, 3vw, 2.55rem); font-weight: 780; }
.login-heading > p:last-child { margin: 0; color: var(--scm-muted); }
.organization-login-grid { display: grid; gap: .75rem; }
.organization-login-card { display: grid; min-height: 5.25rem; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--scm-border); border-radius: var(--scm-radius); color: var(--scm-ink); background: #fff; box-shadow: none; text-decoration: none; }
.organization-login-card:hover, .organization-login-card:focus-visible { border-color: #8bc5ba; color: var(--scm-ink); background: var(--scm-teal-faint); box-shadow: 0 8px 22px rgb(3 127 105 / 8%), inset 3px 0 0 var(--scm-orange); transform: none; }
.organization-login-marker { width: .85rem; height: .85rem; border: 2px solid #8eb2aa; border-radius: 50%; box-shadow: inset 0 0 0 2px #fff; }
.organization-login-card:hover .organization-login-marker { border-color: var(--scm-teal); background: var(--scm-teal); }
.organization-login-identity { display: grid; min-width: 0; gap: .28rem; }
.organization-login-identity strong { overflow: hidden; font-size: .96rem; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.organization-login-code { display: block; width: fit-content; padding: 0; color: #84908d; background: transparent; font-size: .72rem; font-weight: 650; letter-spacing: .045em; }
.organization-login-action { color: var(--scm-teal); font-size: .8rem; font-weight: 750; white-space: nowrap; }
.login-emergency { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.7rem; padding-top: 1.2rem; border-top: 1px solid var(--scm-border); font-size: .8rem; }
.login-emergency p { margin: 0; color: var(--scm-muted); }
.login-emergency a { font-weight: 700; text-decoration: none; }
.login-security-note { position: absolute; right: clamp(3rem, 8vw, 8rem); bottom: 2rem; left: clamp(3rem, 8vw, 8rem); color: #929c99; font-size: .72rem; text-align: center; }

@media (max-width: 991.98px) {
  .app-topbar { height: 4rem; padding-inline: 1rem; }
  .app-content { margin-left: 0; padding-top: 4rem; }
  .app-main { padding: 1rem 1rem 2.5rem; }
  .app-logo-link-topbar { width: 7.4rem; height: 2rem; }
  .app-company-name { max-width: min(42vw, 20rem); margin-left: .55rem; padding-left: .55rem; }
  .mobile-navigation { width: min(88vw, 20rem); }
  .mobile-navigation .offcanvas-header { border-bottom: 1px solid var(--scm-border); }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 11rem; padding: 2rem 1.5rem 1.75rem; border-right: 0; border-bottom: 1px solid var(--scm-border); justify-content: flex-start; }
  .login-brand-logo { width: 13rem; height: 4.25rem; margin-bottom: 1.25rem; }
  .login-brand-copy h1 { margin-bottom: .65rem; font-size: 1.65rem; }
  .login-brand-copy h1 br, .login-brand-copy h1::after, .login-brand-copy > p:last-child, .login-brand-decoration { display: none; }
  .login-copyright { top: 2rem; right: 1.5rem; bottom: auto; left: auto; }
  .login-access-panel { min-height: calc(100vh - 11rem); padding: 2rem 1.5rem 4rem; justify-content: flex-start; }
  .login-heading { margin-bottom: 1.5rem; }
  .login-heading h2 { font-size: 1.7rem; }
  .login-security-note { right: 1.5rem; bottom: 1.25rem; left: 1.5rem; }
}

@media (max-width: 575.98px) {
  .app-company-name { display: none; }
  .app-user-name { display: none; }
  .app-user-actions { margin-left: auto; }
  .app-user-actions .btn { min-height: 2.1rem; padding: .35rem .55rem; font-size: .74rem; }
  .content-panel { padding: 1rem; }
  .dashboard-hero { padding: 1.35rem 1.2rem; }
  .metric-card { min-height: 6rem; padding: 1rem; }
  .metric-card strong { font-size: 1.5rem; }
  .table > :not(caption) > * > * { padding: .68rem .72rem; }
  .login-brand-panel { min-height: 10.5rem; padding: 1.35rem 1rem 1.1rem; }
  .login-brand-logo { width: 10.5rem; height: 3.4rem; margin-bottom: .7rem; }
  .login-brand-copy .eyebrow { display: none; }
  .login-brand-copy h1 { margin: 0; font-size: 1.28rem; }
  .login-copyright { top: 1.5rem; right: 1rem; font-size: .68rem; }
  .login-access-panel { min-height: calc(100vh - 10.5rem); padding: 1.6rem 1rem 3.5rem; }
  .organization-login-card { min-height: 4.6rem; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; padding: .85rem; }
  .organization-login-action { grid-column: 2; }
  .login-emergency { align-items: flex-start; flex-direction: column; gap: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Legacy feature surfaces aligned to the same brand tokens. */
.section-nav a:hover,
.replenishment-suggestion,
.organization-login-action { color: var(--scm-teal); }
.section-nav a:hover { border-color: var(--scm-teal); }
.scan-match-highlight { outline-color: var(--scm-orange); }
.search-select-option:focus,
.replenishment-grid-table tbody tr.is-dirty { background: var(--scm-teal-faint); }
.replenishment-grid-table tbody tr.is-dirty > *:first-child { box-shadow: inset .2rem 0 0 var(--scm-orange); }
.search-select-input,
.search-select-menu,
.document-line-card,
.authorization-card,
.mobile-card,
.report-card { border-color: var(--scm-border); }
.search-select-option:hover,
.search-select-option:focus { color: var(--scm-teal-dark); background: var(--scm-teal-soft); }
.form-control[readonly],
.form-control:disabled,
.form-select:disabled { border-color: var(--scm-border); color: #687572; background-color: #eef2f0; }

/* V0.10.1 shell and dashboard calibration ---------------------------------- */
.app-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
}

.app-topbar { left: 16.5rem; }
.app-brand-context { min-width: 0; }
.app-company-name {
  display: flex;
  max-width: min(48vw, 42rem);
  align-items: center;
  gap: .6rem;
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
  color: #596763;
  font-size: .88rem;
}
.app-context-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border-radius: .58rem;
  color: var(--scm-orange);
  background: var(--scm-teal-soft);
}
.app-context-icon .app-icon { width: 1.05rem; height: 1.05rem; }
.app-user-actions form { margin: 0; }
.app-user-logout-form { display: flex; }
.app-user-menu-toggle {
  display: inline-flex;
  align-items: center;
  max-width: 15rem;
  min-height: 2.35rem;
  gap: .5rem;
  padding: .18rem .55rem .18rem .25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--scm-ink);
  background: transparent;
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}
.app-user-menu-toggle:hover,
.app-user-menu-toggle[aria-expanded="true"] {
  border-color: var(--scm-border);
  color: var(--scm-teal);
  background: var(--scm-teal-soft);
}
.app-user-menu-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--scm-teal) 28%, transparent);
  outline-offset: 2px;
}
.app-user-avatar {
  display: block;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--scm-teal) 22%, var(--scm-border));
  border-radius: 50%;
  background: var(--scm-teal-soft);
}
.app-user-avatar { object-fit: cover; }
.app-user-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user-menu-caret { display: inline-flex; transition: transform .16s ease; }
.app-user-menu-caret .app-icon { width: .85rem; height: .85rem; transform: rotate(90deg); }
.app-user-menu-toggle[aria-expanded="true"] .app-user-menu-caret { transform: rotate(180deg); }
.app-user-menu-list {
  min-width: 8rem;
  margin-top: .4rem !important;
  padding: .35rem;
  border-color: var(--scm-border);
  border-radius: .7rem;
  box-shadow: var(--scm-shadow);
}
.app-user-logout-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  border-radius: .45rem;
  color: var(--scm-ink);
}
.app-user-logout-item:hover,
.app-user-logout-item:focus {
  color: var(--scm-orange);
  background: var(--scm-orange-soft);
}
.app-user-logout-item .app-icon { width: 1rem; height: 1rem; }
.app-action-button { gap: .4rem; }
.app-action-button .app-icon { width: 1rem; height: 1rem; }
.app-action-button .badge { min-width: 1.25rem; padding: .2rem .36rem; }
.app-menu-button { display: inline-flex; align-items: center; justify-content: center; }

.app-sidebar { transition: width .2s ease, padding .2s ease; }
.desktop-navigation-region { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.desktop-navigation-region .sidebar-navigation { flex: 1 1 auto; }
.sidebar-collapse-toggle {
  position: absolute;
  z-index: 2;
  top: 4.75rem;
  right: -.78rem;
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--scm-border-strong);
  border-radius: 50%;
  color: var(--scm-teal-dark);
  background: #fff;
  box-shadow: 0 4px 12px rgb(25 51 45 / 10%);
  transition: color .16s ease, border-color .16s ease, transform .2s ease;
}
.sidebar-collapse-toggle:hover { color: var(--scm-orange); border-color: #efaa8e; }
.sidebar-collapse-toggle .app-icon { width: .95rem; height: .95rem; }
.sidebar-navigation { gap: .26rem; }
.sidebar-link,
.sidebar-group > summary,
.sidebar-subgroup > summary {
  min-height: 2.8rem;
  font-size: .97rem;
  line-height: 1.35;
}
.sidebar-link,
.sidebar-group > summary { gap: .72rem; }
.sidebar-icon {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 1.45rem;
  place-items: center;
  color: #71807c;
}
.sidebar-icon .app-icon { width: 1.18rem; height: 1.18rem; }
.sidebar-link:hover .sidebar-icon,
.sidebar-group > summary:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon,
.sidebar-group.active > summary .sidebar-icon { color: var(--scm-teal); }
.sidebar-link.active .sidebar-icon { color: var(--scm-teal-dark); }
.sidebar-submenu .sidebar-link { font-size: .91rem; }
.sidebar-subgroup > summary { font-size: .88rem; }
.sidebar-third-level .sidebar-link { font-size: .85rem; }

@media (min-width: 992px) {
  html.scm-sidebar-collapsed .app-sidebar { width: 5.25rem; padding-inline: .72rem; }
  html.scm-sidebar-collapsed .app-content { margin-left: 5.25rem; }
  html.scm-sidebar-collapsed .app-topbar { left: 5.25rem; }
  html.scm-sidebar-collapsed .app-logo-link-sidebar { height: 2.35rem; margin-top: .35rem; }
  html.scm-sidebar-collapsed .sidebar-brand { margin-bottom: 1.1rem; }
  html.scm-sidebar-collapsed .sidebar-collapse-toggle { transform: rotate(180deg); }
  html.scm-sidebar-collapsed .sidebar-label,
  html.scm-sidebar-collapsed .sidebar-group > summary::after,
  html.scm-sidebar-collapsed .sidebar-submenu,
  html.scm-sidebar-collapsed .sidebar-version { display: none; }
  html.scm-sidebar-collapsed .sidebar-link,
  html.scm-sidebar-collapsed .sidebar-group > summary { justify-content: center; padding-inline: .55rem; }
  html.scm-sidebar-collapsed .sidebar-navigation { overflow-x: visible; padding-right: 0; }
  .app-content, .app-topbar { transition: margin-left .2s ease, left .2s ease; }
}

.report-table-toolbar,
.report-table-footer,
.report-pager {
  display: flex;
  align-items: center;
}

.report-table-toolbar {
  justify-content: flex-end;
  gap: .5rem;
  margin-bottom: .75rem;
}

.report-table-footer {
  justify-content: space-between;
  gap: 1rem;
  padding-top: .85rem;
}

.report-total-count {
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.report-pager {
  justify-content: flex-end;
  gap: .35rem;
  flex-wrap: nowrap;
}

.report-page-size {
  width: 7rem;
  margin-right: .25rem;
}

.report-pager .btn {
  display: inline-flex;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.report-page-jump {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-left: .45rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

.report-page-jump-input {
  width: 3.25rem;
  min-width: 3.25rem;
  text-align: center;
}

.work-center-shell {
  display: grid;
  gap: 1rem;
}

.work-center-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--scm-border);
  scrollbar-width: thin;
}

.work-center-tab {
  position: relative;
  display: inline-flex;
  min-height: 3rem;
  padding: .7rem .9rem;
  align-items: center;
  gap: .45rem;
  flex: 0 0 auto;
  border: 0;
  border-bottom: .18rem solid transparent;
  color: var(--bs-secondary-color);
  background: transparent;
  font-weight: 700;
}

.work-center-tab:hover { color: var(--scm-teal-dark); }
.work-center-tab.active {
  color: var(--scm-teal-dark);
  border-bottom-color: var(--scm-orange);
}
.work-center-tab:focus-visible {
  z-index: 1;
  outline: .18rem solid rgb(3 127 105 / 24%);
  outline-offset: -.18rem;
}

.work-center-tab-count,
.work-center-tab-unread {
  display: inline-flex;
  min-width: 1.55rem;
  min-height: 1.55rem;
  padding: .12rem .42rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 1;
}
.work-center-tab-count { color: var(--scm-teal-dark); background: var(--scm-teal-soft); }
.work-center-tab-unread { color: #b5330b; background: var(--scm-orange-soft); font-size: .75rem; }

.work-center-panel { min-width: 0; }
.work-center-panel-heading {
  display: flex;
  margin-bottom: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.work-center-range { color: var(--bs-secondary-color); font-size: .875rem; white-space: nowrap; }
.work-center-list { overflow: hidden; border: 1px solid var(--scm-border); border-radius: .75rem; }
.work-center-item {
  display: grid;
  min-width: 0;
  padding: 1rem 1.1rem;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, auto) auto;
  align-items: center;
  gap: 1rem;
  color: var(--scm-ink);
  background: #fff;
  text-decoration: none;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.work-center-item + .work-center-item { border-top: 1px solid var(--scm-border); }
.work-center-item:hover { color: var(--scm-ink); background: var(--scm-teal-faint); }
.work-center-item:focus-visible { position: relative; z-index: 1; outline: .18rem solid rgb(3 127 105 / 24%); outline-offset: -.18rem; }
.work-center-item-main,
.work-center-item-details { display: flex; min-width: 0; }
.work-center-item-main { flex-direction: column; gap: .22rem; }
.work-center-item-details { flex-direction: column; align-items: flex-end; gap: .2rem; color: var(--bs-secondary-color); font-size: .875rem; }
.work-center-item-title,
.work-center-message-body { overflow: hidden; text-overflow: ellipsis; }
.work-center-item-number { color: var(--bs-secondary-color); font-size: .875rem; }
.work-center-item-action { color: var(--scm-teal-dark); font-size: .875rem; font-weight: 700; white-space: nowrap; }
.work-center-status { padding: .28rem .55rem; border-radius: 999px; color: var(--scm-teal-dark); background: var(--scm-teal-soft); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.work-center-empty { padding: 1.5rem 0; }

.work-center-message.is-unread {
  background: var(--scm-orange-soft);
  box-shadow: inset .24rem 0 0 var(--scm-orange);
}
.work-center-message.is-unread:hover { background: #ffe8dc; }
.work-center-message.is-unread .work-center-item-title { font-weight: 750; }
.work-center-message-title-row { display: flex; min-width: 0; align-items: center; gap: .55rem; }
.work-center-message-body { color: var(--bs-secondary-color); white-space: nowrap; }
.work-center-unread-label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex: 0 0 auto;
  color: #b5330b;
  font-size: .75rem;
  font-weight: 700;
}
.work-center-unread-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--scm-orange); }
.work-center-pagination { margin-top: .15rem; }
.report-page-ellipsis { display: inline-flex; min-width: 1rem; align-items: center; justify-content: center; }

@media (max-width: 767.98px) {
  .work-center-panel-heading { align-items: flex-start; }
  .work-center-item { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .work-center-item-details { align-items: flex-start; }
  .work-center-item-action,
  .work-center-status { justify-self: start; }
  .work-center-message-body { white-space: normal; }
  .work-center-pagination { align-items: flex-start; flex-direction: column; }
  .work-center-pagination .report-pager { width: 100%; overflow-x: auto; justify-content: flex-start; padding-bottom: .2rem; }
}

@media (max-width: 575.98px) {
  .work-center-panel-heading { flex-direction: column; gap: .35rem; }
  .work-center-tab { padding-inline: .72rem; }
  .work-center-item { padding: .9rem; }
}

.log-date-input {
  width: 10.5rem;
}

.log-organization-input {
  width: min(18rem, 42vw);
}

.log-date-column {
  width: 12.6rem;
  min-width: 12.6rem;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .log-date-input,
  .log-organization-input { width: 100%; }
  .log-date-column { min-width: 11.5rem; }
}

.report-column-settings {
  position: relative;
}

.report-column-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + .4rem);
  right: 0;
  width: 13rem;
  padding: .65rem;
  background: #fff;
  border: 1px solid var(--scm-border, #d8e2df);
  border-radius: .65rem;
  box-shadow: 0 .75rem 2rem rgba(16, 45, 39, .14);
}

.report-column-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .25rem;
  cursor: pointer;
}

.report-columns-reset {
  width: 100%;
  margin-top: .35rem;
}

.report-sort-button {
  display: inline-flex;
  align-items: center;
  width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  white-space: nowrap;
  background: transparent;
  border: 0;
}

.report-sort-button:hover,
.report-sort-button:focus-visible {
  color: var(--scm-primary, #008b72);
}

.report-table [hidden] {
  display: none !important;
}

.dashboard-welcome {
  position: relative;
  margin: .15rem 0 1.8rem;
  padding: .45rem 0 .4rem 1.05rem;
}
.dashboard-welcome::before {
  position: absolute;
  top: .55rem;
  bottom: .5rem;
  left: 0;
  width: .25rem;
  border-radius: 1rem;
  background: var(--scm-orange);
  content: "";
}
.dashboard-welcome h1 {
  margin: 0 0 .55rem;
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -.04em;
}
.dashboard-welcome p { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: 0; color: var(--scm-muted); }
.dashboard-welcome p strong { color: var(--scm-ink); font-weight: 720; }

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.dashboard-metrics .metric-card {
  display: flex;
  min-height: 7rem;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.dashboard-metrics .metric-card:hover { border-color: #b8d7d0; box-shadow: var(--scm-shadow); transform: translateY(-2px); }
.dashboard-metrics .metric-card-link { color: inherit; text-decoration: none; }
.dashboard-metrics .metric-card-link:focus-visible { outline: 3px solid var(--scm-teal); outline-offset: 3px; }
.dashboard-metrics .metric-card::before { display: none; }
.metric-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  place-items: center;
  border-radius: .82rem;
  color: var(--scm-teal);
  background: var(--scm-teal-soft);
}
.dashboard-metrics .metric-card:nth-child(even) .metric-icon { color: var(--scm-orange); background: var(--scm-orange-soft); }
.metric-icon .app-icon { width: 1.45rem; height: 1.45rem; }
.metric-copy { display: grid; gap: .18rem; }
.dashboard-metrics .metric-copy > span { color: var(--scm-muted); font-size: .78rem; font-weight: 700; }
.dashboard-metrics .metric-copy > strong { color: var(--scm-ink); font-size: 1.85rem; font-weight: 780; line-height: 1.1; }

.dashboard-work-center {
  overflow: hidden;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-lg);
  background: #fff;
  box-shadow: var(--scm-shadow-sm);
}
.dashboard-section-heading {
  display: flex;
  min-height: 5.1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--scm-border);
  background: #fbfdfc;
}
.dashboard-section-heading h2 { margin: 0 0 .2rem; font-size: 1.22rem; font-weight: 760; }
.dashboard-section-heading p { margin: 0; color: var(--scm-muted); font-size: .82rem; }
.dashboard-section-accent { width: 2.8rem; height: .24rem; border-radius: 1rem; background: linear-gradient(90deg, var(--scm-teal) 0 62%, var(--scm-orange) 62%); }
.dashboard-work-list { display: grid; }
.dashboard-work-row {
  display: grid;
  min-height: 5.75rem;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.05rem;
  padding: .7rem 1.35rem;
  border-bottom: 1px solid #e8eeec;
  transition: background-color .16s ease;
}
.dashboard-work-row:last-child { border-bottom: 0; }
.dashboard-work-row:hover { background: var(--scm-teal-faint); }
.work-row-icon {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  place-items: center;
  border-radius: .85rem;
  color: var(--scm-teal);
  background: var(--scm-teal-soft);
}
.work-row-icon .app-icon { width: 1.5rem; height: 1.5rem; }
.work-row-content { min-width: 0; }
.work-row-content h3 { margin: 0 0 .15rem; font-size: 1.03rem; font-weight: 750; line-height: 1.25; }
.work-row-content > p { margin: 0; color: var(--scm-muted); font-size: .8rem; line-height: 1.4; }
.work-row-facts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.work-row-facts span {
  padding: .1rem .42rem;
  border: 1px solid var(--scm-border);
  border-radius: .4rem;
  color: #6b7774;
  background: #fff;
  font-size: .7rem;
  font-weight: 650;
}
.work-row-action { min-width: 7.2rem; white-space: nowrap; }
.dashboard-work-row-warning { background: #fffaf7; box-shadow: inset .25rem 0 0 var(--scm-orange); }
.dashboard-work-row-warning:hover { background: #fff6f1; }
.dashboard-work-row-warning .work-row-icon { color: var(--scm-orange); background: var(--scm-orange-soft); }
.inventory-alert-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; font-size: .82rem; }
.inventory-alert-out { padding: .2rem .5rem; border-radius: .4rem; color: #b5330b; background: var(--scm-orange-soft); }
.inventory-alert-low { color: #8a5200; }
.inventory-alert-divider { color: #aab4b1; }
.btn-accent { color: #fff; border-color: var(--scm-orange); background: var(--scm-orange); }
.btn-accent:hover, .btn-accent:focus { color: #fff; border-color: #c93705; background: #c93705; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

@media (max-width: 1199.98px) {
  .dashboard-metrics .metric-card { gap: .75rem; padding-inline: 1rem; }
  .metric-icon { width: 2.65rem; height: 2.65rem; flex-basis: 2.65rem; }
}

@media (max-width: 991.98px) {
  .app-topbar { left: 0; }
  .app-company-name { max-width: min(48vw, 24rem); margin-left: 0; padding-left: 0; }
  .app-user-name-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .app-user-menu-toggle { max-width: none; padding: .12rem; }
  .app-user-menu-caret { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-navigation .sidebar-icon { display: grid; }
}

@media (max-width: 767.98px) {
  .dashboard-welcome { margin-bottom: 1.25rem; }
  .dashboard-welcome h1 { font-size: 1.7rem; }
  .dashboard-work-row { grid-template-columns: 2.8rem minmax(0, 1fr); gap: .8rem; padding: 1rem; }
  .work-row-icon { width: 2.8rem; height: 2.8rem; }
  .work-row-action { grid-column: 1 / -1; width: 100%; margin-top: .2rem; }
}

@media (max-width: 575.98px) {
  .app-brand-context { display: none; }
  .app-context-icon { width: 1.8rem; height: 1.8rem; flex-basis: 1.8rem; }
  .app-action-button > .app-icon { display: none; }
  .dashboard-metrics { gap: .75rem; }
  .dashboard-metrics .metric-card { min-height: 5.8rem; gap: .65rem; padding: .85rem; }
  .metric-icon { width: 2.4rem; height: 2.4rem; flex-basis: 2.4rem; border-radius: .68rem; }
  .metric-icon .app-icon { width: 1.2rem; height: 1.2rem; }
  .dashboard-metrics .metric-copy > strong { font-size: 1.45rem; }
  .dashboard-section-heading { min-height: 4.6rem; padding: .9rem 1rem; }
  .dashboard-section-heading p { display: none; }
  .dashboard-section-accent { width: 2rem; }
  .work-row-content > p { font-size: .8rem; }
}

/* V0.10.4 login and organization selection refinements -------------------- */
.app-sidebar { padding-top: 0; }

.app-logo-link-sidebar {
  width: calc(100% + 2rem);
  height: 4.5rem;
  flex: 0 0 4.5rem;
  margin: 0 -1rem;
  padding: .7rem 1.35rem;
  border-bottom: 1px solid var(--scm-border);
}

.app-logo-image-wide {
  display: block;
  width: 100%;
  height: 100%;
  background-size: auto 190%;
}

.app-logo-image-square { display: none; }
.sidebar-collapse-toggle { top: 3.68rem; }
.desktop-navigation-region { overflow-y: auto; }
.desktop-navigation-region .sidebar-navigation {
  flex: 0 0 auto;
  grid-auto-rows: max-content;
  align-content: start;
  gap: .25rem;
  padding-top: .7rem;
}

.sidebar-link,
.sidebar-group > summary { min-height: 2.8rem; }

.sidebar-link:hover,
.sidebar-group > summary:hover,
.sidebar-subgroup > summary:hover { background: #fff5ef; }

.sidebar-group[open].active > summary::after,
.sidebar-group[open].active > summary .sidebar-icon { color: var(--scm-orange); }

.sidebar-submenu .sidebar-link.active {
  color: var(--scm-teal-dark);
  background: #fff5ef;
  box-shadow: inset 3px 0 0 var(--scm-orange);
}

@media (min-width: 992px) {
  html.scm-sidebar-collapsed .app-sidebar { padding-top: 0; }
  html.scm-sidebar-collapsed .app-logo-link-sidebar {
    width: calc(100% + 1.44rem);
    height: 4.5rem;
    flex-basis: 4.5rem;
    margin: 0 -.72rem;
    padding: .3rem .45rem;
  }
  html.scm-sidebar-collapsed .app-logo-image-wide { display: none; }
  html.scm-sidebar-collapsed .app-logo-image-square {
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("../images/branding/hongrun-scm-square.png");
    /* The source square artwork has a little transparent space above the mark;
       keep the image centered in the compact header without changing the asset. */
    background-position: center calc(50% + .15rem);
    background-repeat: no-repeat;
    background-size: 90% auto;
  }
  html.scm-sidebar-collapsed .sidebar-collapse-toggle { top: 3.68rem; }
  html.scm-sidebar-collapsed .desktop-navigation-region .sidebar-navigation {
    gap: .3rem;
    padding-top: .7rem;
  }
  html.scm-sidebar-collapsed .sidebar-link,
  html.scm-sidebar-collapsed .sidebar-group > summary { min-height: 2.8rem; }
}

.login-shell {
  grid-template-columns: minmax(38rem, 54%) minmax(30rem, 46%);
  background: #fff;
}

.login-brand-panel {
  isolation: isolate;
  padding: 4rem clamp(3rem, 6vw, 7rem) 3rem;
  border-right-color: #f0a486;
  background: #fff;
  text-align: center;
}

.login-brand-panel::before,
.login-brand-panel::after {
  position: absolute;
  z-index: -1;
  bottom: 0;
  content: "";
  pointer-events: none;
}

.login-brand-panel::before {
  left: 0;
  width: 12%;
  height: 29%;
  background: var(--scm-teal);
  clip-path: polygon(0 0, 50% 14%, 100% 100%, 0 100%);
  opacity: .8;
}

.login-brand-panel::after {
  right: 0;
  width: 20%;
  height: 12%;
  background: var(--scm-orange);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  opacity: .88;
}

.login-brand-watermark {
  position: absolute;
  z-index: -2;
  right: 0;
  bottom: 4%;
  left: 0;
  height: 47%;
  background: url("../images/branding/hongrun-brand-mark.png") center bottom / auto 127% no-repeat;
  filter: grayscale(1);
  opacity: .045;
  pointer-events: none;
}

.login-brand-content {
  width: min(100%, 42rem);
  margin: 0 auto 14rem;
}

.login-brand-logo {
  width: min(100%, 36rem);
  height: 10rem;
  margin: 0 auto 1.7rem;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.login-brand-copy h1 {
  margin: 0 0 .8rem;
  color: var(--scm-teal);
  font-size: clamp(2rem, 3vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
}

.login-brand-copy h1::after { display: none; }
.login-brand-copy > p:last-child {
  max-width: none;
  margin: 0;
  color: #747f7c;
  font-size: clamp(.92rem, 1.25vw, 1.15rem);
  line-height: 1.8;
  letter-spacing: .16em;
}

.login-brand-footer {
  position: absolute;
  z-index: 1;
  right: clamp(3rem, 6vw, 7rem);
  bottom: 3rem;
  left: clamp(3rem, 6vw, 7rem);
  color: #7d8986;
  text-align: center;
}

.login-brand-footer > p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 1rem;
  color: #596763;
  font-size: .9rem;
  letter-spacing: .13em;
}

.login-brand-footer > p::before,
.login-brand-footer > p::after {
  width: 3rem;
  height: 1px;
  background: #cbd4d1;
  content: "";
}

.login-brand-footer > div {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  font-size: .75rem;
}

.login-access-panel {
  padding: 4rem clamp(3rem, 7vw, 7rem);
  background: #fff;
}

.login-access-content { width: min(100%, 38rem); }
.login-access-view[hidden] { display: none !important; }
.login-qr-view { min-height: 27rem; }
.login-qr-back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1.75rem;
  padding: 0;
  border: 0;
  color: var(--scm-orange);
  background: transparent;
  font-weight: 700;
}
.login-qr-back:hover,
.login-qr-back:focus-visible { color: #c93705; }
.login-qr-instruction { color: var(--scm-ink); font-weight: 700; }
.login-inline-qr { min-height: 12rem; }
.login-qr-error { margin-top: 1rem; }
.login-heading { margin-bottom: 2.1rem; }
.login-heading h2 {
  margin-bottom: .55rem;
  font-size: clamp(2rem, 3vw, 2.65rem);
  font-weight: 800;
}
.login-heading > p:last-child { font-size: .95rem; }
.organization-login-grid {
  grid-template-columns: 1fr;
  gap: .8rem;
}
.organization-login-card {
  min-height: 5.1rem;
  border-radius: .42rem;
  padding: .9rem 1.15rem;
}
.organization-login-card:first-child { border-color: #f08359; }
.organization-login-marker {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border: 0;
  border-radius: .55rem;
  color: var(--scm-teal);
  background: var(--scm-teal-faint);
  box-shadow: none;
}
.organization-login-marker .app-icon { width: 1.45rem; height: 1.45rem; }
.organization-login-card:hover .organization-login-marker { color: var(--scm-teal-dark); background: var(--scm-teal-soft); }
.organization-login-identity strong { font-size: 1rem; }
.organization-login-action {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: .86rem;
}
.organization-login-action .app-icon { width: 1rem; height: 1rem; color: var(--scm-orange); }
.login-emergency {
  justify-content: center;
  margin-top: 1.8rem;
  padding-top: 0;
  border-top: 0;
}
.login-emergency a { color: var(--scm-orange); }

.emergency-access-content { width: min(100%, 36rem); }
.emergency-back-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 2.4rem;
  color: var(--scm-teal);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}
.emergency-back-link:hover { color: var(--scm-teal-dark); }
.emergency-warning {
  margin-bottom: 1.8rem;
  color: #a33b12;
  border-color: #f2a17f;
  background: #fff6f1;
}
.emergency-login-form { display: grid; gap: 1.2rem; }
.emergency-login-form .form-control,
.emergency-login-form .form-select { min-height: 3.5rem; }
.password-input-wrap { position: relative; }
.password-input-wrap .form-control { padding-right: 3.5rem; }
.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: .8rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: .35rem;
  color: #7b8784;
  background: transparent;
  transform: translateY(-50%);
}
.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible { color: var(--scm-teal); background: var(--scm-teal-faint); }
.password-visibility-toggle .app-icon { width: 1.2rem; height: 1.2rem; }
.emergency-submit {
  min-height: 3.5rem;
  margin-top: .25rem;
  color: #fff;
  border-color: var(--scm-orange);
  background: var(--scm-orange);
  font-size: 1rem;
}
.emergency-submit:hover,
.emergency-submit:focus { color: #fff; border-color: #c93806; background: #c93806; }
.emergency-audit-note {
  margin: 1.6rem 0 0;
  color: #7b8784;
  font-size: .78rem;
}

@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel {
    min-height: 12rem;
    padding: 1.5rem;
    border-right: 0;
    border-bottom: 0;
    justify-content: flex-start;
  }
  .login-brand-panel::before,
  .login-brand-panel::after,
  .login-brand-watermark,
  .login-brand-footer { display: none; }
  .login-brand-content { width: 100%; margin: 0; }
  .login-brand-logo { width: 13rem; height: 4.6rem; margin: 0 auto .65rem; }
  .login-brand-copy h1 { margin: 0; font-size: 1.45rem; }
  .login-brand-copy > p:last-child { display: none; }
  .login-access-panel {
    min-height: calc(100vh - 12rem);
    padding: 2rem 1.5rem 4rem;
    justify-content: flex-start;
  }
  .login-security-note { right: 1.5rem; left: 1.5rem; }
}

@media (max-width: 575.98px) {
  .login-brand-panel { min-height: 9.5rem; padding: 1rem; }
  .login-brand-logo { width: 10.5rem; height: 3.8rem; margin-bottom: .35rem; }
  .login-brand-copy h1 { font-size: 1.2rem; }
  .login-access-panel { min-height: calc(100vh - 9.5rem); padding: 1.5rem 1rem 3.5rem; }
  .organization-login-card { grid-template-columns: auto minmax(0, 1fr); }
  .organization-login-action { grid-column: 2; }
  .emergency-back-link { margin-bottom: 1.5rem; }
}
.scm-operation-modal .modal-content {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1.5rem 4rem rgba(23, 45, 43, .2);
}

.scm-operation-modal .modal-header {
    align-items: center;
    gap: .85rem;
}

.scm-operation-symbol {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 2.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    height: 2.5rem;
    justify-content: center;
}

.scm-operation-severity {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    margin-bottom: .1rem;
}

/* Slice 3A enterprise platform shell --------------------------------------- */
.platform-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .72rem;
  color: var(--scm-ink);
  text-decoration: none;
}

.platform-brand:hover { color: var(--scm-teal-dark); }
.platform-brand-mark {
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 2.55rem;
  object-fit: contain;
}

.platform-brand-copy { display: grid; min-width: 0; gap: .12rem; text-align: left; }
.platform-brand-copy strong {
  overflow: hidden;
  font-size: .94rem;
  font-weight: 800;
  letter-spacing: .015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.platform-brand-copy small {
  overflow: hidden;
  color: var(--scm-muted);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand.platform-brand {
  width: calc(100% + 2rem);
  height: 4.5rem;
  flex: 0 0 4.5rem;
  margin: 0 -1rem .2rem;
  padding: .72rem 1.15rem;
  border-bottom: 1px solid var(--scm-border);
  background: #fff;
  text-align: left;
}

.app-topbar-brand {
  min-width: 0;
  align-items: center;
  gap: .45rem;
  color: var(--scm-teal-dark);
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
}
.app-topbar-brand img { width: 1.8rem; height: 1.8rem; object-fit: contain; }
.app-topbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-company-selector { min-width: 0; }
.app-company-name {
  min-height: 2.45rem;
  max-width: min(48vw, 42rem);
  padding: .28rem .62rem;
  border: 1px solid transparent;
  border-radius: .72rem;
  color: #43534f;
}
.app-company-switcher-toggle:hover,
.app-company-switcher-toggle[aria-expanded="true"] {
  border-color: var(--scm-border-strong);
  color: var(--scm-teal-dark);
  background: var(--scm-teal-faint);
}
.app-company-label { flex: 0 0 auto; color: var(--scm-muted); font-weight: 600; }
.app-company-value { overflow: hidden; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.app-company-caret { flex: 0 0 auto; color: var(--scm-teal); font-size: .62rem; }
.app-company-switcher-menu { width: min(26rem, calc(100vw - 2rem)); padding: .45rem; }
.app-company-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: .45rem;
  white-space: normal;
}
.app-company-option.active { color: var(--scm-teal-dark); background: var(--scm-teal-soft); }
.app-company-current-mark {
  flex: 0 0 auto;
  padding: .12rem .38rem;
  border-radius: 999px;
  color: var(--scm-teal-dark);
  background: #fff;
  font-size: .68rem;
  font-weight: 750;
}
.app-user-company-option { display: none; }

.sidebar-primary-section { display: grid; gap: .25rem; margin: 0; }
.sidebar-primary-section + .sidebar-primary-section { margin-top: .7rem; }
.sidebar-section-label {
  margin: 0;
  padding: .25rem .8rem .12rem;
  color: #8a9693;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.sidebar-section-menu { display: grid; gap: .25rem; }
.sidebar-section-menu > .sidebar-link { padding-left: 1rem; }
.sidebar-section-menu > .sidebar-subgroup { margin-left: 0; }

.login-brand-mark {
  display: block;
  width: clamp(7rem, 12vw, 10rem);
  height: clamp(7rem, 12vw, 10rem);
  margin: 0 auto 1.5rem;
  object-fit: contain;
}

.platform-brand-mobile { max-width: min(78vw, 22rem); }
.platform-brand-public { min-height: 4rem; }
.dashboard-welcome .eyebrow { margin-bottom: .35rem !important; }

@media (min-width: 992px) {
  html.scm-sidebar-collapsed .sidebar-brand.platform-brand {
    width: calc(100% + 1.44rem);
    margin-inline: -.72rem;
    padding: .65rem;
    justify-content: center;
  }
  html.scm-sidebar-collapsed .platform-brand-copy,
  html.scm-sidebar-collapsed .sidebar-section-label { display: none; }
  html.scm-sidebar-collapsed .platform-brand-mark { width: 2.7rem; height: 2.7rem; flex-basis: 2.7rem; }
  html.scm-sidebar-collapsed .sidebar-primary-section + .sidebar-primary-section { margin-top: .25rem; }
}

@media (max-width: 991.98px) {
  .app-topbar {
    display: grid;
    height: 6.75rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 3.25rem 3.05rem;
    gap: 0 .55rem;
    padding: .25rem .9rem .45rem;
  }
  .app-menu-button { grid-column: 1; grid-row: 1; }
  .app-topbar-brand { display: inline-flex !important; grid-column: 2; grid-row: 1; }
  .app-user-actions { grid-column: 3; grid-row: 1; }
  .app-brand-context {
    display: flex;
    min-width: 0;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: stretch;
  }
  .app-company-selector,
  .app-company-switcher,
  .app-company-name { width: 100%; max-width: none; }
  .app-company-name {
    justify-content: flex-start;
    padding: .26rem .48rem;
    background: #f7faf9;
  }
  .app-company-value { flex: 1 1 auto; }
  .app-content { padding-top: 6.75rem; }
  .app-user-company-option { display: block; }
  .app-user-menu-list { width: min(24rem, calc(100vw - 1.5rem)); }
  .app-user-menu-list .dropdown-item { white-space: normal; }
  .mobile-navigation .platform-brand-copy strong { font-size: .86rem; }
}

@media (max-width: 575.98px) {
  .app-topbar { padding-inline: .6rem; }
  .app-topbar-brand span { font-size: .72rem; }
  .app-topbar-brand img { width: 1.55rem; height: 1.55rem; }
  .app-action-button { width: 2.25rem; min-width: 2.25rem; padding: .35rem; }
  .app-action-button > span:not(.badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .app-action-button > .app-icon { display: block; }
  .app-company-label { font-size: .78rem; }
  .app-company-value { font-size: .82rem; }
  .app-context-icon { width: 1.65rem; height: 1.65rem; flex-basis: 1.65rem; }
  .login-brand-mark { width: 4.25rem; height: 4.25rem; margin-bottom: .35rem; }
  .login-brand-copy > p:last-child { display: block; font-size: .76rem; letter-spacing: .06em; }
}

/* Slice 3A.1 enterprise workbench and navigation polish ------------------ */
.app-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.app-main { flex: 1 0 auto; }

.app-footer {
  display: flex;
  width: min(100%, 96rem);
  align-items: center;
  gap: .6rem;
  margin: auto auto 0;
  padding: 1rem 2rem 1.35rem;
  border-top: 1px solid var(--scm-border);
  color: #71807c;
  font-size: .76rem;
}

.sidebar-primary-section + .sidebar-primary-section {
  margin-top: 1rem;
  padding-top: .15rem;
}

.sidebar-section-label {
  padding: .3rem .8rem .22rem;
  color: #52615e;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.sidebar-section-menu,
.sidebar-primary-section { gap: .3rem; }

.sidebar-submenu {
  gap: .14rem;
  padding-left: 1rem;
}

.sidebar-submenu .sidebar-link,
.sidebar-section-menu > .sidebar-link {
  font-size: .9rem;
}

/* Slice 3A.2 desktop sidebar typography and hierarchy polish ------------ */
@media (min-width: 992px) {
  .desktop-navigation-region .sidebar-primary-section {
    gap: .4375rem;
  }

  .desktop-navigation-region .sidebar-primary-section + .sidebar-primary-section {
    margin-top: 1.25rem;
    padding-top: 0;
  }

  .desktop-navigation-region .sidebar-section-label {
    min-height: 1.5rem;
    padding: 0 .8rem;
    color: #52615e;
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.5rem;
  }

  .desktop-navigation-region .sidebar-primary-section > .sidebar-link,
  .desktop-navigation-region .sidebar-group > summary,
  .desktop-navigation-region .sidebar-section-menu > .sidebar-link,
  .desktop-navigation-region .sidebar-subgroup > summary {
    min-height: 2.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
  }

  .desktop-navigation-region .sidebar-section-menu > .sidebar-subgroup > summary {
    gap: .72rem;
    padding: .6rem .75rem;
  }

  html:not(.scm-sidebar-collapsed) .desktop-navigation-region .sidebar-section-menu > .sidebar-subgroup > summary::before {
    width: 1.45rem;
    height: 1.45rem;
    flex: 0 0 1.45rem;
    content: "";
  }

  .desktop-navigation-region .sidebar-submenu,
  .desktop-navigation-region .sidebar-third-level {
    gap: .125rem;
    padding: .125rem .35rem .4rem 2.15rem;
  }

  .desktop-navigation-region .sidebar-submenu .sidebar-link,
  .desktop-navigation-region .sidebar-third-level .sidebar-link {
    min-height: 2.5rem;
    padding: .625rem .65rem .625rem .75rem;
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.25rem;
  }

  .desktop-navigation-region .sidebar-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-navigation-region .sidebar-icon {
    width: 1.45rem;
    height: 1.45rem;
    flex: 0 0 1.45rem;
  }

  .desktop-navigation-region .sidebar-group > summary::after,
  .desktop-navigation-region .sidebar-subgroup > summary::after {
    color: #9aa6a2;
    font-size: .9rem;
    line-height: 1;
  }

  .desktop-navigation-region .sidebar-link.active,
  .desktop-navigation-region .sidebar-group.active > summary,
  .desktop-navigation-region .sidebar-subgroup.active > summary {
    color: var(--scm-teal-dark);
    background: var(--scm-teal-soft);
    box-shadow: inset 3px 0 0 var(--scm-orange);
    font-weight: 600;
  }
}

.workbench-hero {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 25rem);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin: .1rem 0 1.6rem;
  padding: clamp(1.55rem, 3vw, 2.35rem);
  border: 1px solid #cfe4df;
  border-radius: var(--scm-radius-lg);
  background:
    radial-gradient(circle at 92% 18%, rgb(230 69 10 / 11%) 0, transparent 26%),
    linear-gradient(120deg, #f5fbf9 0%, #fff 68%);
  box-shadow: var(--scm-shadow-sm);
}

.workbench-hero::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: .32rem;
  background: linear-gradient(180deg, var(--scm-teal), var(--scm-orange));
  content: "";
}

.workbench-welcome {
  margin: 0 0 .35rem;
  color: var(--scm-teal-dark);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.workbench-hero h1 {
  margin: 0;
  color: var(--scm-ink);
  font-size: clamp(1.8rem, 3.2vw, 2.75rem);
  font-weight: 820;
  letter-spacing: -.04em;
  line-height: 1.18;
}

.workbench-subtitle {
  margin: .7rem 0 0;
  color: var(--scm-muted);
  font-size: 1rem;
}

.workbench-company {
  display: grid;
  min-width: 0;
  gap: .24rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid #d8e8e4;
  border-radius: var(--scm-radius-md);
  background: rgb(255 255 255 / 84%);
}

.workbench-company span,
.workbench-company small {
  color: var(--scm-muted);
  font-size: .76rem;
  font-weight: 700;
}

.workbench-company strong {
  overflow: hidden;
  color: var(--scm-ink);
  font-size: 1rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-section { margin-top: 1.45rem; }

.workbench-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: .8rem;
}

.workbench-section-heading h2 {
  margin: 0;
  color: var(--scm-ink);
  font-size: 1.12rem;
  font-weight: 800;
}

.workbench-section-heading p {
  margin: .2rem 0 0;
  color: var(--scm-muted);
  font-size: .78rem;
}

.workbench-section .dashboard-metrics { margin-bottom: 0; }

.workbench-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.workbench-quick-card {
  display: grid;
  min-width: 0;
  min-height: 6.2rem;
  grid-template-columns: 2.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-md);
  color: var(--scm-ink);
  background: #fff;
  box-shadow: var(--scm-shadow-sm);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.workbench-quick-card:hover {
  border-color: #a9d1c8;
  color: var(--scm-teal-dark);
  box-shadow: var(--scm-shadow);
  transform: translateY(-2px);
}

.workbench-quick-card:focus-visible {
  outline: 3px solid var(--scm-teal);
  outline-offset: 3px;
}

.workbench-quick-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: .22rem;
}

.workbench-quick-card strong { font-size: .94rem; font-weight: 780; }
.workbench-quick-card small { overflow: hidden; color: var(--scm-muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.workbench-quick-icon { display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: .78rem; color: var(--scm-teal); background: var(--scm-teal-soft); }
.workbench-quick-icon .app-icon { width: 1.3rem; height: 1.3rem; }
.workbench-quick-arrow { color: #91a19d; font-size: 1.4rem; }
.workbench-quick-card-warning .workbench-quick-icon { color: var(--scm-orange); background: var(--scm-orange-soft); }

@media (max-width: 1199.98px) {
  .workbench-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .workbench-hero { grid-template-columns: 1fr; gap: 1.1rem; padding: 1.3rem; }
  .workbench-company { padding: .8rem .9rem; }
  .workbench-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .workbench-quick-card { min-height: 7.4rem; grid-template-columns: 2.55rem minmax(0, 1fr); align-content: center; gap: .65rem; padding: .85rem; }
  .workbench-quick-icon { width: 2.55rem; height: 2.55rem; }
  .workbench-quick-arrow { display: none; }
  .app-footer { flex-wrap: wrap; padding: .9rem 1rem 1.15rem; }
}

@media (max-width: 399.98px) {
  .workbench-quick-grid { grid-template-columns: 1fr; }
  .workbench-quick-card { min-height: 5.4rem; }
}

.scm-operation-modal[data-severity="success"] .scm-operation-symbol {
    background: #e6f5f1;
    color: #00866f;
}

.scm-operation-modal[data-severity="warning"] .scm-operation-symbol,
.scm-operation-modal[data-severity="conflict"] .scm-operation-symbol {
    background: #fff3dc;
    color: #b56300;
}

.scm-operation-modal[data-severity="error"] .scm-operation-symbol {
    background: #fde9e8;
    color: #c3322b;
}

.scm-operation-modal[data-severity="success"] .scm-operation-severity { color: #00866f; }
.scm-operation-modal[data-severity="warning"] .scm-operation-severity,
.scm-operation-modal[data-severity="conflict"] .scm-operation-severity { color: #a65a00; }
.scm-operation-modal[data-severity="error"] .scm-operation-severity { color: #b82d27; }

.scm-operation-modal .modal-body {
    color: #50615f;
    white-space: pre-line;
}

.scm-operation-modal .modal-footer {
    flex-wrap: wrap;
}

@media (max-width: 575.98px) {
    .scm-operation-modal .modal-dialog { margin: 1rem; }
    .scm-operation-modal .modal-footer .btn { flex: 1 1 100%; }
}

/* Inventory document reversal workflow */
.document-reversal-page {
  display: grid;
  gap: 1rem;
}

.document-reversal-hero {
  border-right-color: var(--scm-orange);
}

.document-reversal-summary,
.document-reversal-form {
  margin: 0;
}

.document-reversal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem 1.5rem;
}

.document-reversal-grid > div {
  min-width: 0;
}

.document-reversal-grid-wide {
  grid-column: 1 / -1;
}

.document-reversal-grid dt {
  margin-bottom: .2rem;
  color: var(--bs-secondary-color);
  font-size: .82rem;
  font-weight: 600;
}

.document-reversal-grid dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.document-reversal-warning {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: 1rem 1.1rem;
  border: 1px solid #f0b8b4;
  border-radius: var(--scm-radius-sm);
  background: #fff2f0;
  color: #8f231d;
}

.document-reversal-warning-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #b42318;
  color: #fff;
}

.document-reversal-warning-icon .app-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.document-reversal-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.document-reversal-decision-form {
  padding: 1rem;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-sm);
  background: var(--bs-tertiary-bg);
}

.document-reversal-reassign-form {
  display: flex;
  align-items: end;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--scm-border);
}

.document-reversal-reassign-form > div {
  width: min(100%, 22rem);
}

.document-reversal-actions {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 1rem;
}

@media (max-width: 767.98px) {
  .document-reversal-grid,
  .document-reversal-decision-grid {
    grid-template-columns: 1fr;
  }

  .document-reversal-grid {
    gap: .7rem;
  }

  .document-reversal-grid > div {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: .6rem;
  }

  .document-reversal-grid dt {
    margin: 0;
  }

  .document-reversal-warning {
    padding: .9rem;
  }

  .document-reversal-reassign-form {
    align-items: stretch;
    flex-direction: column;
  }

  .document-reversal-reassign-form > div,
  .document-reversal-reassign-form .btn,
  .document-reversal-form > form > .btn,
  .document-reversal-decision-form .btn,
  .document-reversal-actions .btn {
    width: 100%;
  }
}

/* Inventory document reading view */
.document-detail-page {
  display: grid;
  gap: 1rem;
}

.document-detail-hero {
  margin: 0;
}

.document-detail-hero h1 {
  font-size: clamp(1.625rem, 1.5rem + .75vw, 1.875rem);
}

.document-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
}

.document-sheet {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius);
  background: var(--bs-body-bg);
  box-shadow: var(--scm-shadow);
}

.document-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.7rem 1.8rem 1.45rem;
  border-bottom: 2px solid var(--scm-teal);
  background: linear-gradient(135deg, var(--scm-teal-faint), var(--bs-body-bg) 56%);
}

.document-sheet-heading {
  min-width: 0;
}

.document-sheet-type {
  margin: 0 0 .35rem;
  color: var(--scm-teal);
  font-size: .9rem;
  font-weight: 750;
  letter-spacing: .06em;
}

.document-sheet-heading h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 .35rem;
  margin: 0;
  font-size: clamp(1.35rem, 1.2rem + .7vw, 1.75rem);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.document-sheet-section {
  padding: 1.45rem 1.8rem;
  border-bottom: 1px solid var(--scm-border);
}

.document-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.document-section-heading > span {
  color: var(--bs-secondary-color);
  font-size: .85rem;
}

.document-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 750;
}

.document-section-heading .document-section-title {
  margin: 0;
}

.document-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1rem 1.5rem;
  margin: 0;
}

.document-summary-party {
  width: 100%;
  justify-content: flex-end;
  justify-self: end;
  text-align: right;
}

.document-info-grid > div,
.document-footer-signatures > div,
.document-mobile-line dl > div {
  min-width: 0;
}

.document-info-grid dt,
.document-footer-signatures dt,
.document-mobile-line dt,
.document-footer-remark > span {
  margin-bottom: .22rem;
  color: var(--bs-secondary-color);
  font-size: .78rem;
  font-weight: 650;
}

.document-info-grid dd,
.document-footer-signatures dd,
.document-mobile-line dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.document-metadata-field {
  display: flex;
  align-items: baseline;
  gap: .35rem;
}

.document-metadata-field dt,
.document-metadata-field dd {
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.document-metadata-field dt {
  flex: 0 0 auto;
}

.document-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--scm-border);
}

.document-reading-lines-table {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-sm);
}

.document-reading-lines-table table {
  min-width: 70rem;
}

.document-reading-lines-table thead th {
  padding: .72rem .75rem;
  border-bottom: 1px solid var(--scm-border);
  background: var(--bs-tertiary-bg);
  color: #40514f;
  font-size: .8rem;
  white-space: nowrap;
}

.document-reading-lines-table tbody td {
  padding: .78rem .75rem;
  border-color: var(--scm-border);
  vertical-align: middle;
}

.document-line-name {
  min-width: 9rem;
  font-weight: 600;
}

.document-stock-change {
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}

.document-mobile-lines {
  display: grid;
  gap: .8rem;
}

.document-mobile-line {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--scm-border);
  border-radius: var(--scm-radius-sm);
  background: var(--bs-body-bg);
}

.document-mobile-line header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--scm-border);
}

.document-mobile-line header > div {
  min-width: 0;
}

.document-mobile-line h4 {
  margin: .2rem 0 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.document-mobile-line .document-stock-change {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  font-size: 1.2rem;
}

.document-mobile-line .document-stock-change small {
  color: var(--bs-secondary-color);
  font-size: .68rem;
  font-weight: 600;
}

.document-mobile-line dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1rem;
  margin: .85rem 0 0;
}

.document-mobile-line-wide {
  grid-column: 1 / -1;
}

.document-footer {
  padding: 1.45rem 1.8rem 1.6rem;
  background: var(--bs-tertiary-bg);
}

.document-footer-remark {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px dashed var(--scm-border);
}

.document-footer-remark p {
  margin: 0;
  overflow-wrap: anywhere;
}

.document-footer-signatures {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  gap: 1rem;
  margin: 1.1rem 0 0;
}

.document-footer-posted-by,
.document-footer-posted-at {
  justify-self: end;
  text-align: right;
}

@media (max-width: 991.98px) {
  .document-info-grid,
  .document-footer-signatures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-summary-party,
  .document-footer-posted-by,
  .document-footer-posted-at {
    justify-self: stretch;
    text-align: left;
  }

  .document-summary-party {
    justify-content: flex-start;
  }

  .document-page-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .document-detail-page {
    gap: .85rem;
  }

  .document-detail-hero {
    padding: 1.1rem;
  }

  .document-sheet-header,
  .document-sheet-section,
  .document-footer {
    padding: 1rem;
  }

  .document-sheet-header {
    gap: .75rem;
  }

  .document-info-grid {
    grid-template-columns: 1fr;
    gap: .7rem;
  }

  .document-info-grid > .document-metadata-field {
    gap: .35rem;
  }

  .document-info-grid dt {
    margin: 0;
  }

  .document-footer-signatures {
    gap: .8rem 1rem;
  }

  .document-footer-remark {
    grid-template-columns: 1fr;
    gap: .3rem;
  }
}

@media (max-width: 575.98px) {
  .document-page-actions .btn {
    flex: 1 1 calc(50% - .35rem);
  }

  .document-page-actions .btn:last-child {
    flex-basis: 100%;
  }

  .document-sheet-header {
    align-items: flex-start;
  }

  .document-sheet-header .status-badge {
    flex: 0 0 auto;
  }

  .document-footer-signatures {
    grid-template-columns: 1fr;
  }

  .document-mobile-line header {
    align-items: flex-start;
  }
}
.equipment-scan-card { min-width: 0; max-width: 100%; padding: 16px; border: 1px solid var(--app-border, #ddd); border-radius: 8px; overflow-wrap: anywhere; }
.equipment-scan-card form { min-width: 0; max-width: 100%; }
.equipment-scan-card button { white-space: normal; max-width: 100%; }
.repair-rating { display: flex; flex-wrap: wrap; gap: .5rem; }
.repair-rating label { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .25rem .5rem; }
.repair-rating input[type="radio"] { width: auto; }
