:root {
  --by-ops-ink: #16322e;
  --by-ops-muted: #66736f;
  --by-ops-green: #087466;
  --by-ops-green-dark: #04594f;
  --by-ops-mint: #eaf6f1;
  --by-ops-blue: #eef5ff;
  --by-ops-amber: #fff5df;
  --by-ops-red: #fff0ee;
  --by-ops-line: #dce5e1;
  --by-ops-bg: #f4f7f6;
  --by-ops-white: #ffffff;
  --by-ops-shadow: 0 12px 32px rgba(27, 52, 47, 0.11);
}

body.by-order-ops-v2-open {
  overflow: hidden !important;
}

#by-order-ops-v2 {
  position: fixed;
  z-index: 1200;
  inset: 0;
  overflow: auto;
  color: var(--by-ops-ink);
  background: var(--by-ops-bg);
  font-family: Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.by-ops-appbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid #d5e1dd;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 22px rgba(22, 50, 46, 0.08);
  backdrop-filter: blur(12px);
}

.by-ops-appbar-inner {
  display: grid;
  grid-template-columns: minmax(245px, auto) minmax(0, 1fr) auto;
  width: min(1588px, 100%);
  min-height: 68px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: center;
  gap: 24px;
}

.by-ops-brand,
.by-ops-account,
.by-ops-main-nav {
  display: flex;
  align-items: center;
}

.by-ops-brand {
  gap: 11px;
  color: var(--by-ops-ink);
  text-decoration: none;
}

.by-ops-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--by-ops-green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.by-ops-brand strong,
.by-ops-brand small,
.by-ops-account strong,
.by-ops-account small {
  display: block;
}

.by-ops-brand strong {
  font-size: 17px;
}

.by-ops-brand small,
.by-ops-account small {
  margin-top: 2px;
  color: var(--by-ops-muted);
  font-size: 11px;
}

.by-ops-main-nav {
  align-self: stretch;
  gap: 6px;
}

.by-ops-main-nav a,
.by-ops-main-nav button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border: 0;
  border-radius: 11px;
  padding: 0 16px;
  color: var(--by-ops-muted);
  background: transparent;
  font: 700 14px/1 Roboto, Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.by-ops-main-nav .is-active {
  color: var(--by-ops-green-dark);
  background: var(--by-ops-mint);
}

.by-ops-main-nav a:hover,
.by-ops-main-nav button:hover {
  color: var(--by-ops-green-dark);
  background: #f1f7f5;
}

.by-ops-account {
  gap: 9px;
  justify-self: end;
}

.by-ops-account-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--by-ops-green-dark);
  font-weight: 900;
}

.by-ops-account strong {
  font-size: 13px;
}

#by-order-ops-v2 *,
#by-order-ops-v2 *::before,
#by-order-ops-v2 *::after {
  box-sizing: border-box;
}

.by-ops-shell {
  width: min(1540px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 24px;
}

.by-ops-topbar,
.by-ops-title-row,
.by-ops-toolbar,
.by-ops-actions,
.by-ops-card-head,
.by-ops-order-top,
.by-ops-detail-head,
.by-ops-section-head,
.by-ops-tracking-row {
  display: flex;
  align-items: center;
}

.by-ops-topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.by-ops-title-row {
  gap: 12px;
}

.by-ops-title-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--by-ops-green);
  font-size: 23px;
  font-weight: 800;
}

.by-ops-title {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.by-ops-subtitle {
  margin: 5px 0 0;
  color: var(--by-ops-muted);
  font-size: 14px;
}

.by-ops-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.by-ops-btn,
.by-ops-filter,
.by-ops-order-card,
.by-ops-icon-btn {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.by-ops-btn,
.by-ops-filter {
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 15px;
  font-weight: 700;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.by-ops-btn:hover,
.by-ops-filter:hover,
.by-ops-icon-btn:hover {
  transform: translateY(-1px);
}

.by-ops-btn:focus-visible,
.by-ops-filter:focus-visible,
.by-ops-order-card:focus-visible,
.by-ops-icon-btn:focus-visible,
.by-ops-search:focus-visible {
  outline: 3px solid rgba(8, 116, 102, 0.24);
  outline-offset: 2px;
}

.by-ops-btn--primary {
  color: #fff;
  background: var(--by-ops-green);
  box-shadow: 0 7px 18px rgba(8, 116, 102, 0.2);
}

.by-ops-btn--primary:hover {
  background: var(--by-ops-green-dark);
}

.by-ops-btn--secondary {
  color: var(--by-ops-green-dark);
  border: 1px solid #bcd5ce;
  background: #fff;
}

.by-ops-btn--quiet {
  color: var(--by-ops-muted);
  border: 1px solid var(--by-ops-line);
  background: rgba(255, 255, 255, 0.72);
}

.by-ops-btn:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.by-ops-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.by-ops-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--by-ops-ink);
  border: 1px solid var(--by-ops-line);
  background: #fff;
  text-align: left;
}

.by-ops-filter.is-active {
  color: #fff;
  border-color: var(--by-ops-green);
  background: var(--by-ops-green);
  box-shadow: 0 8px 20px rgba(8, 116, 102, 0.18);
}

.by-ops-filter-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--by-ops-green-dark);
  background: var(--by-ops-mint);
  text-align: center;
}

.by-ops-filter.is-active .by-ops-filter-count {
  color: #0a4b43;
  background: #e6f5ef;
  font-weight: 800;
}

.by-ops-grid {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  min-height: calc(100vh - 205px);
  border: 1px solid var(--by-ops-line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--by-ops-shadow);
}

.by-ops-queue {
  min-width: 0;
  border-right: 1px solid var(--by-ops-line);
  background: #fbfcfc;
}

.by-ops-queue-head {
  position: sticky;
  z-index: 4;
  top: 0;
  padding: 16px;
  border-bottom: 1px solid var(--by-ops-line);
  background: rgba(251, 252, 252, 0.96);
  backdrop-filter: blur(9px);
}

.by-ops-search {
  width: 100%;
  height: 44px;
  border: 1px solid #cfdad6;
  border-radius: 12px;
  padding: 0 14px 0 40px;
  color: var(--by-ops-ink);
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2366736f' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 13px center;
  font: inherit;
}

.by-ops-order-list {
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 10px;
}

.by-ops-order-card {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 14px;
  color: inherit;
  background: #fff;
  box-shadow: 0 2px 10px rgba(31, 58, 52, 0.05);
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.by-ops-order-card:hover {
  border-color: #bad4cd;
  box-shadow: 0 7px 18px rgba(31, 58, 52, 0.1);
  transform: translateY(-1px);
}

.by-ops-order-card.is-selected {
  border-color: var(--by-ops-green);
  background: #f7fcfa;
  box-shadow: inset 4px 0 0 var(--by-ops-green), 0 6px 16px rgba(8, 116, 102, 0.09);
}

.by-ops-order-card--new {
  border-color: #efbbb4;
  background: #fff8f7;
}

.by-ops-order-card--processing {
  border-color: #ead08a;
  background: #fffaf0;
}

.by-ops-order-card--completed {
  border-color: #a9d6b9;
  background: #f3fbf6;
}

.by-ops-order-card--cancelled {
  border-color: #d7dfdc;
  background: #f7f9f8;
}

.by-ops-order-card--new.is-selected,
.by-ops-order-card--processing.is-selected,
.by-ops-order-card--completed.is-selected,
.by-ops-order-card--cancelled.is-selected {
  border-color: var(--by-ops-green);
  box-shadow: inset 4px 0 0 var(--by-ops-green), 0 6px 16px rgba(8, 116, 102, 0.09);
}

.by-ops-order-top,
.by-ops-card-head,
.by-ops-detail-head,
.by-ops-section-head,
.by-ops-tracking-row {
  justify-content: space-between;
  gap: 12px;
}

.by-ops-order-number {
  font-size: 18px;
  font-weight: 900;
}

.by-ops-time {
  color: var(--by-ops-muted);
  font-size: 12px;
  white-space: nowrap;
}

.by-ops-customer {
  margin-top: 7px;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.by-ops-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.by-ops-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--by-ops-muted);
  background: #eef2f1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.by-ops-badge--success {
  color: #15603b;
  background: #e1f5e8;
}

.by-ops-badge--warn {
  color: #8a5a00;
  background: var(--by-ops-amber);
}

.by-ops-badge--danger {
  color: #9d3228;
  background: var(--by-ops-red);
}

.by-ops-badge--info {
  color: #265f91;
  background: var(--by-ops-blue);
}

.by-ops-badge--processing {
  color: #765000;
  background: #ffedb8;
}

.by-ops-badge--muted {
  color: #5e6966;
  background: #e8edeb;
}

.by-ops-card-action {
  display: block;
  margin-top: 8px;
  color: var(--by-ops-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.by-ops-price {
  margin-left: auto;
  font-weight: 900;
  white-space: nowrap;
}

.by-ops-detail {
  min-width: 0;
  padding: 24px;
  overflow: auto;
  background: #fff;
}

.by-ops-detail-inner {
  width: min(940px, 100%);
  margin: 0 auto;
}

.by-ops-detail-head {
  align-items: flex-start;
  margin-bottom: 17px;
}

.by-ops-detail-title {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.1;
}

.by-ops-detail-date {
  margin-top: 6px;
  color: var(--by-ops-muted);
}

.by-ops-detail-head [data-action='mobile-back'] {
  display: none;
}

.by-ops-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.by-ops-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.by-ops-step {
  min-height: 62px;
  border: 1px solid var(--by-ops-line);
  border-radius: 13px;
  padding: 10px;
  color: var(--by-ops-muted);
  background: #fafcfc;
  font-size: 12px;
  font-weight: 700;
}

.by-ops-step strong {
  display: block;
  margin-top: 4px;
  color: var(--by-ops-ink);
  font-size: 14px;
}

.by-ops-step.is-done {
  border-color: #bcdccf;
  background: var(--by-ops-mint);
}

.by-ops-step.is-alert {
  border-color: #efd49a;
  background: var(--by-ops-amber);
}

.by-ops-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.by-ops-panel {
  min-width: 0;
  border: 1px solid var(--by-ops-line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.by-ops-panel--wide {
  grid-column: 1 / -1;
}

.by-ops-panel-title {
  margin: 0 0 12px;
  font-size: 16px;
}

.by-ops-facts {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1.4fr);
  gap: 9px 12px;
  margin: 0;
}

.by-ops-facts dt {
  color: var(--by-ops-muted);
}

.by-ops-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.by-ops-link {
  color: var(--by-ops-green);
  font-weight: 800;
  text-decoration: none;
}

.by-ops-link:hover {
  text-decoration: underline;
}

.by-ops-tracking-row {
  align-items: flex-start;
  border-radius: 14px;
  padding: 14px;
  background: var(--by-ops-mint);
}

.by-ops-tracking-number {
  margin-top: 5px;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.025em;
  overflow-wrap: anywhere;
}

.by-ops-items {
  display: grid;
  gap: 10px;
}

.by-ops-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--by-ops-line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfcfc;
}

.by-ops-item-image {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  object-fit: cover;
  background: #eef2f1;
}

.by-ops-item-title {
  margin: 0 0 7px;
  font-size: 16px;
}

.by-ops-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--by-ops-muted);
  font-size: 13px;
}

.by-ops-item-price {
  align-self: start;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.by-ops-empty,
.by-ops-loading,
.by-ops-error {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 30px;
  color: var(--by-ops-muted);
  text-align: center;
}

.by-ops-error {
  color: #9d3228;
}

.by-ops-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border: 4px solid #dce9e5;
  border-top-color: var(--by-ops-green);
  border-radius: 50%;
  animation: by-ops-spin 800ms linear infinite;
}

.by-ops-toast {
  position: fixed;
  z-index: 1400;
  right: 22px;
  bottom: 22px;
  max-width: min(430px, calc(100vw - 32px));
  border-radius: 13px;
  padding: 13px 16px;
  color: #fff;
  background: #183c36;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  font-weight: 700;
}

.by-ops-toast.is-error {
  background: #9d3228;
}

.by-ops-icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--by-ops-green-dark);
  background: var(--by-ops-mint);
  font-size: 18px;
}

#by-order-ops-v2-legacy {
  position: fixed;
  z-index: 1300;
  right: 18px;
  bottom: 18px;
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  color: #fff;
  background: var(--by-ops-green);
  box-shadow: var(--by-ops-shadow);
  font: 700 14px Roboto, Arial, sans-serif;
  cursor: pointer;
}

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

@media (max-width: 1100px) {
  .by-ops-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .by-ops-grid {
    grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  }

  .by-ops-columns {
    grid-template-columns: 1fr;
  }

  .by-ops-panel--wide {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  #by-order-ops-v2 {
    inset: 0;
  }

  .by-ops-appbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 62px;
    padding: 0 14px;
    gap: 10px;
  }

  .by-ops-main-nav {
    justify-self: end;
  }

  .by-ops-main-nav button,
  .by-ops-account {
    display: none;
  }

  .by-ops-shell {
    padding: 14px;
  }

  .by-ops-topbar {
    align-items: flex-start;
  }

  .by-ops-subtitle {
    display: none;
  }

  .by-ops-toolbar .by-ops-btn--quiet {
    display: none;
  }

  .by-ops-filters {
    display: flex;
    margin: 0 -14px 12px;
    padding: 0 14px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .by-ops-filter {
    min-width: max-content;
  }

  .by-ops-grid {
    display: block;
    min-height: 0;
    overflow: visible;
  }

  .by-ops-queue {
    border-right: 0;
  }

  .by-ops-order-list {
    max-height: none;
  }

  .by-ops-detail {
    display: none;
    position: fixed;
    z-index: 5;
    inset: 62px 0 0;
    padding: 17px;
    overflow: auto;
  }

  #by-order-ops-v2.is-detail-open .by-ops-detail {
    display: block;
  }

  .by-ops-detail-head {
    flex-direction: column;
  }

  .by-ops-detail-head [data-action='mobile-back'] {
    display: inline-flex;
    margin-bottom: 12px;
  }

  .by-ops-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 520px) {
  .by-ops-brand small {
    display: none;
  }

  .by-ops-brand strong {
    font-size: 15px;
  }

  .by-ops-brand-mark {
    width: 36px;
    height: 36px;
  }

  .by-ops-main-nav a {
    min-height: 38px;
    padding: 0 12px;
  }

  .by-ops-shell {
    padding: 10px;
  }

  .by-ops-title-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 20px;
  }

  .by-ops-title {
    font-size: 22px;
  }

  .by-ops-toolbar .by-ops-btn--secondary {
    width: 42px;
    overflow: hidden;
    padding: 10px 12px;
    color: transparent;
  }

  .by-ops-toolbar .by-ops-btn--secondary::after {
    content: '↻';
    color: var(--by-ops-green-dark);
    font-size: 21px;
  }

  .by-ops-filters {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .by-ops-grid {
    border-radius: 16px;
  }

  .by-ops-queue-head,
  .by-ops-detail,
  .by-ops-panel {
    padding: 13px;
  }

  .by-ops-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .by-ops-item-image {
    width: 72px;
    height: 72px;
  }

  .by-ops-item-price {
    grid-column: 2;
  }

  .by-ops-facts {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .by-ops-facts dd {
    margin-bottom: 8px;
  }

  .by-ops-tracking-row {
    flex-direction: column;
  }

  .by-ops-tracking-row .by-ops-btn {
    width: 100%;
  }
}

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