:root {
  --brand-primary: #0d6efd;
  --brand-primary-rgb: 13, 110, 253;
  --brand-primary-strong: #0759d6;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --text-primary: #172033;
  --text-secondary: #687386;
  --line: rgba(31, 43, 67, 0.1);
  --line-strong: rgba(31, 43, 67, 0.16);
  --shadow-sm: 0 1px 2px rgba(20, 35, 60, 0.04), 0 5px 16px rgba(20, 35, 60, 0.05);
  --shadow-md: 0 2px 5px rgba(20, 35, 60, 0.05), 0 16px 40px rgba(20, 35, 60, 0.09);
  --shadow-lg: 0 8px 24px rgba(20, 35, 60, 0.12), 0 30px 70px rgba(20, 35, 60, 0.14);
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --topbar-height: 4rem;
  --sidebar-width: 15rem;
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: var(--brand-primary-rgb);
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--surface-muted);
  color-scheme: light;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 82% -15%, rgba(var(--brand-primary-rgb), 0.11), transparent 31rem),
    linear-gradient(180deg, #f8faff 0, var(--surface-muted) 24rem);
  font-weight: 400;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-primary);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-primary-strong);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h1 { line-height: 1.12; }
h2, h3 { line-height: 1.2; }
h4, h5, h6 { line-height: 1.28; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1035;
  min-height: var(--topbar-height);
  padding:
    max(0.55rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    0.55rem
    max(1rem, env(safe-area-inset-left));
  color: #fff;
  background: rgba(var(--brand-primary-rgb), 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 8px 28px rgba(4, 54, 128, 0.14);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
}

.app-topbar::after {
  position: absolute;
  right: 0;
  bottom: -0.65rem;
  left: 0;
  height: 0.65rem;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(39, 59, 91, 0.08), transparent);
  opacity: 0.65;
}

.app-topbar .container-fluid {
  gap: 1rem;
  padding: 0;
}

.navbar-brand {
  display: inline-flex;
  gap: 0.68rem;
  align-items: center;
  margin: 0;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 720;
  letter-spacing: -0.022em;
}

.navbar-brand:hover,
.navbar-brand:focus-visible {
  color: #fff;
}

.brand-mark {
  display: inline-grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.app-clock {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: 0.025em;
}

.app-shell {
  padding: 0;
}

.app-shell > .row {
  min-height: calc(100vh - var(--topbar-height));
}

.app-sidebar {
  position: sticky;
  top: var(--topbar-height);
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  padding: 1.25rem 0.8rem;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid rgba(31, 43, 67, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

.app-sidebar .nav {
  gap: 0.22rem;
}

.app-sidebar .nav-link {
  display: flex;
  gap: 0.76rem;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.68rem 0.82rem;
  color: #536075;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 590;
  text-decoration: none;
  transform-origin: center;
  user-select: none;
  touch-action: manipulation;
}

.app-sidebar .nav-link i {
  width: 1.35rem;
  color: #7b8798;
  font-size: 1.08rem;
  text-align: center;
}

.app-sidebar .nav-link:hover {
  color: var(--brand-primary);
  background: rgba(var(--brand-primary-rgb), 0.07);
}

.app-sidebar .nav-link.active {
  color: #fff;
  background: linear-gradient(145deg, #2781ff, var(--brand-primary));
  border-color: rgba(var(--brand-primary-rgb), 0.25);
  box-shadow: 0 7px 18px rgba(var(--brand-primary-rgb), 0.24);
}

.app-sidebar .nav-link.active i {
  color: #fff;
}

.nav-separator {
  height: 1px;
  margin: 0.65rem 0.72rem;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.app-main {
  flex: 1 1 0;
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  padding: clamp(1.25rem, 2.2vw, 2rem);
}

.app-main > :first-child {
  width: 100%;
  max-width: 96rem;
  margin-inline: auto;
}

.page-heading,
.app-main > .d-flex:first-child {
  gap: 1rem;
  min-height: 2.8rem;
  margin-bottom: 1.25rem !important;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-heading h1,
.app-main > h5:first-child,
.app-main > .d-flex:first-child h5 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 760;
  letter-spacing: -0.028em;
}

.page-heading h1 i,
.app-main > h5:first-child i,
.app-main > .d-flex:first-child h5 i {
  margin-right: 0.35rem;
  color: var(--brand-primary);
  font-size: 0.88em;
}

.card {
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card.p-3 {
  padding: clamp(1rem, 1.7vw, 1.35rem) !important;
}

.card-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 2.25rem;
  margin-bottom: 0.75rem;
}

.card-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.014em;
}

.card-heading h2 i {
  margin-right: 0.38rem;
  color: var(--brand-primary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.1rem);
}

.metric-card {
  position: relative;
  min-height: 7.25rem;
  padding: 1.18rem 1.25rem;
  overflow: hidden;
  isolation: isolate;
}

.metric-card::after {
  position: absolute;
  top: -2.2rem;
  right: -1.8rem;
  z-index: -1;
  width: 7rem;
  height: 7rem;
  content: "";
  background: currentColor;
  border-radius: 999px;
  opacity: 0.065;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 620;
  letter-spacing: 0.018em;
}

.metric-value {
  margin-top: 0.5rem;
  color: currentColor;
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.metric-primary { color: var(--brand-primary); }
.metric-success { color: #12844f; }
.metric-danger { color: #d73a49; }
.metric-warning { color: #c67b00; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(17rem, 0.82fr);
  gap: clamp(0.8rem, 1.5vw, 1.15rem);
  align-items: start;
}

.dashboard-primary-card,
.dashboard-secondary-card {
  padding: clamp(1rem, 1.8vw, 1.35rem);
}

.dashboard-side-stack {
  display: grid;
  gap: clamp(0.8rem, 1.5vw, 1.15rem);
}

.compact-list {
  display: grid;
}

.compact-list-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 2.4rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--line);
}

.compact-list-item:last-child {
  border-bottom: 0;
}

.compact-list-item a {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 580;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-copy,
.empty-state {
  margin: 0;
  padding: 1.65rem 0.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-align: center;
}

.btn {
  --bs-btn-border-radius: 0.78rem;
  min-height: 2.45rem;
  padding: 0.48rem 0.85rem;
  border-width: 1px;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.006em;
  transform-origin: center;
  user-select: none;
  touch-action: manipulation;
}

.btn-sm {
  min-height: 2.12rem;
  padding: 0.36rem 0.68rem;
  border-radius: 0.68rem;
  font-size: 0.82rem;
}

.btn-lg {
  min-height: 3rem;
  padding: 0.62rem 1rem;
  border-radius: 0.9rem;
  font-size: 1rem;
}

.btn-primary {
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary-strong);
  --bs-btn-hover-border-color: var(--brand-primary-strong);
  --bs-btn-active-bg: var(--brand-primary-strong);
  --bs-btn-active-border-color: var(--brand-primary-strong);
  box-shadow: 0 6px 15px rgba(var(--brand-primary-rgb), 0.2);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand-primary);
  --bs-btn-border-color: rgba(var(--brand-primary-rgb), 0.3);
  --bs-btn-hover-bg: rgba(var(--brand-primary-rgb), 0.08);
  --bs-btn-hover-color: var(--brand-primary);
  --bs-btn-hover-border-color: rgba(var(--brand-primary-rgb), 0.42);
  --bs-btn-active-bg: rgba(var(--brand-primary-rgb), 0.14);
  --bs-btn-active-color: var(--brand-primary-strong);
  background: rgba(255, 255, 255, 0.68);
}

.btn-outline-secondary {
  --bs-btn-color: #59667a;
  --bs-btn-border-color: rgba(79, 93, 115, 0.23);
  --bs-btn-hover-bg: rgba(79, 93, 115, 0.07);
  --bs-btn-hover-color: #2f3a4d;
  --bs-btn-hover-border-color: rgba(79, 93, 115, 0.36);
  background: rgba(255, 255, 255, 0.62);
}

.form-label {
  margin-bottom: 0.42rem;
  color: #48566a;
  font-size: 0.82rem;
  font-weight: 640;
  letter-spacing: 0.005em;
}

.form-control,
.form-select {
  min-height: 2.75rem;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(65, 79, 102, 0.18);
  border-radius: 0.78rem;
  box-shadow: inset 0 1px 2px rgba(20, 35, 60, 0.025);
  font-size: 0.93rem;
}

.form-control-lg,
.form-select-lg {
  min-height: 3.1rem;
  border-radius: 0.9rem;
  font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
  background-color: #fff;
  border-color: rgba(var(--brand-primary-rgb), 0.72);
  box-shadow: 0 0 0 0.22rem rgba(var(--brand-primary-rgb), 0.13);
}

.input-group > .form-control,
.input-group > .form-select {
  border-radius: 0.84rem 0 0 0.84rem;
}

.input-group > .btn,
.input-group > label.btn {
  border-radius: 0 0.84rem 0.84rem 0;
}

.table-responsive {
  margin-inline: -0.35rem;
  padding-inline: 0.35rem;
  border-radius: var(--radius-md);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(var(--brand-primary-rgb), 0.045);
  margin-bottom: 0;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.table > :not(caption) > * > * {
  padding: 0.72rem 0.65rem;
  border-bottom-color: var(--line);
  vertical-align: middle;
}

.table thead th,
.table-light th,
.table > .table-light {
  color: #6b7789;
  background: rgba(238, 242, 248, 0.72);
  border: 0;
  font-size: 0.72rem;
  font-weight: 710;
  letter-spacing: 0.035em;
  text-transform: none;
  white-space: nowrap;
}

.table thead th:first-child {
  border-radius: 0.68rem 0 0 0.68rem;
}

.table thead th:last-child {
  border-radius: 0 0.68rem 0.68rem 0;
}

.clickable-row,
tr[onclick] {
  cursor: pointer;
}

.clickable-row:focus-visible,
tr[onclick]:focus-visible {
  outline: 3px solid rgba(var(--brand-primary-rgb), 0.28);
  outline-offset: -3px;
}

.order-number {
  font-variant-numeric: tabular-nums;
  font-weight: 620;
}

.badge {
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 680;
  letter-spacing: 0.01em;
}

.alert {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.alert-info {
  color: #0759b7;
  background: rgba(225, 241, 255, 0.93);
  border-color: rgba(13, 110, 253, 0.14);
}

.modal {
  --bs-modal-margin: 1rem;
}

.modal-backdrop {
  background-color: #152238;
}

.modal-backdrop.show {
  opacity: 0.42;
}

.modal.fade .modal-dialog {
  transition: none;
  transform: none;
  will-change: transform, opacity;
}

.modal-content {
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
  padding: 1rem 1.15rem;
  border-color: var(--line);
}

.modal-body {
  padding: 1.15rem;
}

.modal-title {
  font-size: 1rem;
  letter-spacing: -0.012em;
}

.btn-close {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 999px;
  background-color: #eef1f5;
  background-size: 0.72rem;
  opacity: 0.72;
}

.btn-close:hover {
  opacity: 1;
}

.category-btn {
  min-width: auto !important;
  min-height: 2.5rem;
  margin: 0.18rem !important;
  padding: 0.48rem 0.86rem !important;
  border-radius: 999px !important;
  font-size: 0.86rem !important;
  font-weight: 650 !important;
  white-space: nowrap;
}

.product-card {
  height: 100%;
  min-height: 8.8rem;
  padding: 1rem 0.85rem !important;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(56, 72, 98, 0.12) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 1px 2px rgba(20, 35, 60, 0.03);
  transform-origin: center;
  user-select: none;
  touch-action: manipulation;
}

.product-card:hover {
  border-color: rgba(var(--brand-primary-rgb), 0.34) !important;
  box-shadow: 0 10px 25px rgba(20, 35, 60, 0.09);
}

.product-card.border-primary {
  background: rgba(var(--brand-primary-rgb), 0.08) !important;
  border-color: rgba(var(--brand-primary-rgb), 0.58) !important;
  box-shadow: 0 0 0 0.18rem rgba(var(--brand-primary-rgb), 0.09);
}

.product-card .p-name {
  color: var(--text-primary);
  font-size: 0.95rem !important;
  font-weight: 710 !important;
  letter-spacing: -0.012em;
}

.product-card .p-spec {
  color: #66748a !important;
  font-size: 0.76rem !important;
  line-height: 1.45;
}

.product-card .p-price {
  color: var(--brand-primary) !important;
  font-size: 1.08rem !important;
  font-variant-numeric: tabular-nums;
  font-weight: 740 !important;
}

.product-card .p-loc {
  color: #8490a1 !important;
  font-size: 0.71rem !important;
}

#cart-panel {
  top: calc(var(--topbar-height) + 1rem) !important;
}

.cart-item,
.cart-row {
  min-height: 3.3rem;
  border-bottom-color: var(--line) !important;
}

.qty-btn {
  display: inline-grid;
  width: 2.25rem !important;
  height: 2.25rem !important;
  min-height: 2.25rem;
  padding: 0 !important;
  place-items: center;
  border-radius: 0.72rem !important;
}

.total-bar {
  color: var(--brand-primary) !important;
  font-size: 1.55rem !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

#toast,
.position-fixed.alert {
  background: rgba(23, 34, 51, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 999px !important;
  box-shadow: var(--shadow-md);
  color: #fff !important;
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.form-check {
  min-height: 2.75rem;
  padding: 0.72rem 0.8rem 0.72rem 2.2rem !important;
  border-color: var(--line) !important;
  border-radius: 0.82rem !important;
}

.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.bottom-nav {
  display: none;
}

:focus-visible {
  outline: 3px solid rgba(var(--brand-primary-rgb), 0.32);
  outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible {
  outline: 3px solid rgba(var(--brand-primary-rgb), 0.28);
  outline-offset: 2px;
}

@media (max-width: 991.98px) {
  :root {
    --sidebar-width: 12.75rem;
  }

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

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  :root {
    --topbar-height: 3.65rem;
  }

  body {
    padding-bottom: calc(4.9rem + env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 90% -8%, rgba(var(--brand-primary-rgb), 0.1), transparent 20rem),
      var(--surface-muted);
  }

  .app-topbar {
    min-height: var(--topbar-height);
    padding-top: max(0.42rem, env(safe-area-inset-top));
    padding-bottom: 0.42rem;
  }

  .navbar-brand {
    font-size: 1.05rem;
  }

  .brand-mark {
    width: 1.9rem;
    height: 1.9rem;
  }

  .app-clock {
    max-width: 8.5rem;
    overflow: hidden;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-sidebar {
    display: none !important;
  }

  .app-main {
    width: 100%;
    padding: 1rem 0.8rem 1.5rem;
  }

  .page-heading,
  .app-main > .d-flex:first-child {
    align-items: flex-start !important;
    margin-bottom: 1rem !important;
  }

  .page-heading h1,
  .app-main > h5:first-child,
  .app-main > .d-flex:first-child h5 {
    font-size: 1.32rem;
  }

  .metrics-grid {
    gap: 0.65rem;
  }

  .metric-card {
    min-height: 6.3rem;
    padding: 0.95rem;
    border-radius: var(--radius-md);
  }

  .metric-value {
    margin-top: 0.35rem;
    font-size: 1.55rem;
  }

  .dashboard-side-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    border-radius: var(--radius-md);
  }

  .card.p-3,
  .dashboard-primary-card,
  .dashboard-secondary-card {
    padding: 1rem !important;
  }

  .table {
    min-width: 36rem;
  }

  .dashboard-primary-card .table {
    min-width: 31rem;
  }

  .row.g-3 {
    --bs-gutter-y: 0.8rem;
  }

  .category-btn {
    flex: 0 0 auto;
  }

  #cat-btns {
    flex-wrap: nowrap !important;
    margin-inline: -1rem;
    padding-inline: 0.8rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #cat-btns::-webkit-scrollbar {
    display: none;
  }

  .product-card {
    min-height: 8.2rem;
  }

  #cart-panel {
    position: static !important;
  }

  .modal-dialog {
    margin: 0.75rem;
  }

  .modal-content {
    border-radius: 1.35rem;
  }

  .bottom-nav {
    position: fixed;
    right: 0.55rem;
    bottom: max(0.55rem, env(safe-area-inset-bottom));
    left: 0.55rem;
    z-index: 1030;
    display: flex;
    min-height: 4.15rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 1.28rem;
    box-shadow: 0 10px 35px rgba(20, 35, 60, 0.18);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
  }

  .bottom-nav a {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.08rem;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: #7a8698;
    border-radius: 0.95rem;
    font-size: 0.64rem;
    font-weight: 650;
    line-height: 1.1;
    text-decoration: none;
    transform-origin: center;
    touch-action: manipulation;
  }

  .bottom-nav a i {
    font-size: 1.18rem;
    line-height: 1;
  }

  .bottom-nav a.active {
    color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), 0.1);
  }
}

@media (max-width: 420px) {
  .app-main {
    padding-inline: 0.65rem;
  }

  .metrics-grid {
    gap: 0.55rem;
  }

  .metric-card {
    padding: 0.85rem;
  }

  .metric-label {
    font-size: 0.73rem;
  }

  .metric-value {
    font-size: 1.38rem;
  }

  .btn {
    padding-inline: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .modal-dialog,
  .btn,
  .product-card,
  .nav-link,
  .bottom-nav a {
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-topbar {
    background: var(--brand-primary);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .app-sidebar,
  .bottom-nav,
  #toast,
  .position-fixed.alert {
    background: #fff !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  #toast,
  .position-fixed.alert {
    color: var(--text-primary) !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(15, 25, 42, 0.34);
    --line-strong: rgba(15, 25, 42, 0.5);
  }

  .app-sidebar,
  .bottom-nav,
  .card,
  .modal-content {
    background: #fff;
    border-color: var(--line-strong);
  }

  .app-topbar {
    background: var(--brand-primary-strong);
    border-bottom-color: #fff;
  }
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    padding: 0;
    background: #fff;
  }

  .app-main {
    width: 100%;
    padding: 0;
  }

  .card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

.user-chip,
.topbar-action {
  color: rgba(255, 255, 255, 0.92);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
}

.topbar-action:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.login-page {
  min-height: 100svh;
  background:
    radial-gradient(circle at 20% 15%, rgba(var(--brand-primary-rgb), 0.16), transparent 38%),
    radial-gradient(circle at 85% 80%, rgba(var(--brand-primary-rgb), 0.1), transparent 34%),
    var(--surface-subtle);
}

.login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.login-card {
  width: min(100%, 420px);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 70px rgba(15, 25, 42, 0.14);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

.login-brand,
.empty-state-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  background: var(--brand-primary);
  box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb), 0.25);
}

.login-eyebrow,
.section-kicker {
  margin-top: 1.15rem;
  color: var(--brand-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.empty-state {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem;
}

.empty-state-icon {
  margin-bottom: 0.4rem;
  background: #ff9f0a;
}

.audit-details {
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
}

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

.statement-summary > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
}

.sync-status.is-live {
  color: #137333;
  background: rgba(52, 199, 89, 0.13);
}

.sync-status.is-polling {
  color: #8a5700;
  background: rgba(255, 159, 10, 0.14);
}

.sync-status.is-connecting {
  color: var(--text-secondary);
  background: rgba(120, 120, 128, 0.1);
}

.computer-cart-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.14);
  border-radius: 12px;
  color: var(--text-secondary);
  background: rgba(var(--brand-primary-rgb), 0.06);
  font-size: 0.82rem;
}

.mobile-sync-button {
  position: sticky;
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 5;
  box-shadow: 0 10px 26px rgba(var(--brand-primary-rgb), 0.24);
}

.mobile-order-sync {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.18);
  border-radius: 16px;
  background: rgba(var(--brand-primary-rgb), 0.05);
}

@media (max-width: 767.98px) {
  .mobile-order-sync {
    display: block;
  }
}

.sync-status.is-polling i,
.sync-status.is-connecting i {
  animation: sync-spin 1.1s linear infinite;
}

@keyframes sync-spin {
  to { transform: rotate(360deg); }
}

.camera-stage {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border-radius: 20px;
  background: #0b0c0f;
}

.camera-stage video {
  display: block;
  width: 100%;
  height: min(62vh, 560px);
  object-fit: cover;
}

.camera-guide {
  position: absolute;
  inset: 14%;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.camera-error {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(88%, 440px);
  padding: 1rem;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  color: #fff;
  background: rgba(28, 28, 30, 0.82);
  text-align: center;
}

@media (max-width: 767.98px) {
  .app-clock { display: none; }
  .user-chip { max-width: 110px; overflow: hidden; white-space: nowrap; }
  .statement-summary { grid-template-columns: 1fr; }
  .sales-page-heading { align-items: flex-start !important; }
  .sales-page-heading > .d-flex { flex-wrap: wrap; justify-content: flex-end; }
  .camera-stage { min-height: 260px; }
}
