:root {
  --ink: #303a50;
  --muted: #8993a5;
  --line: #e3e7ee;
  --purple: #7783ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.b-auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f6fb;
}

.b-auth-card {
  width: min(430px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 20px 60px rgba(36, 46, 76, .13);
}

.b-auth-logo {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--purple);
  font-size: 25px;
  font-weight: 700;
}

.b-auth-card h1 { margin: 14px 0 20px; }
.b-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.b-auth-tabs button {
  height: 42px;
  border: 0;
  border-bottom: 2px solid #e5e8ef;
  color: #8b95a7;
  background: transparent;
  cursor: pointer;
}
.b-auth-tabs button.active { border-color: var(--purple); color: var(--purple); font-weight: 600; }
.b-auth-card form { display: grid; gap: 13px; }
.b-auth-card label { display: grid; gap: 7px; color: #5f697d; font-size: 12px; }
.b-auth-card input {
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.b-auth-card textarea,
.b-modal textarea,
.b-modal input {
  font: inherit;
}
.b-auth-card .b-order-button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--purple);
  cursor: pointer;
}
.b-auth-message { min-height: 18px; margin-top: 12px; color: #d34d4d; font-size: 12px; }

body {
  margin: 0;
  color: var(--ink);
  background: #f7f8fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
}

.b-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 38px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.b-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.b-brand > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--purple);
  font-size: 23px;
  font-weight: 700;
  box-shadow: 0 9px 20px rgba(119, 131, 255, .28);
}

.b-brand p {
  margin: 0 0 3px;
  color: #a0a8b7;
  font-size: 9px;
  letter-spacing: .18em;
}

.b-brand h1 {
  margin: 0;
  font-size: 23px;
}

.b-header-meta {
  text-align: right;
}

.b-header-meta > span { color: #5f697d; font-size: 12px; }
.b-header-meta > button {
  margin-left: 8px;
  border: 0;
  color: var(--purple);
  background: transparent;
  cursor: pointer;
}

.b-header-meta strong,
.b-header-meta small {
  display: block;
}

.b-header-meta strong {
  font-size: 17px;
}

.b-header-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

main {
  width: min(1440px, calc(100% - 40px));
  margin: 24px auto 60px;
}

.b-page-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.b-page-nav button {
  min-width: 120px;
  height: 40px;
  border: 0;
  border-radius: 7px;
  color: #727d91;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

.b-page-nav button.active {
  color: white;
  background: var(--purple);
}

.b-customer-orders-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.b-customer-orders-heading p {
  margin: 0 0 3px;
  color: #9aa3b3;
  font-size: 9px;
  letter-spacing: .18em;
}

.b-customer-orders-heading h2 {
  margin: 0;
  font-size: 22px;
}

.b-customer-orders-heading button {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #667084;
  background: white;
  cursor: pointer;
}

.b-customer-orders-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.b-order-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.b-order-search-bar select,
.b-order-search-bar input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: white;
}

.b-order-search-bar input {
  width: 220px;
}

.b-order-search-bar button {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  color: #667084;
  background: white;
  cursor: pointer;
}

.b-order-search-bar #customerOrderSearchButton {
  color: white;
  border-color: var(--purple);
  background: var(--purple);
}

.b-order-summary-card {
  min-width: 110px;
  padding: 9px 14px;
  border: 1px solid #dbe1ec;
  border-radius: 9px;
  background: white;
  text-align: right;
}

.b-order-summary-card small,
.b-order-summary-card strong {
  display: block;
}

.b-order-summary-card small {
  color: #8893a8;
  font-size: 10px;
}

.b-order-summary-card strong {
  margin-top: 2px;
  color: #3e495f;
  font-size: 19px;
}

.b-order-summary-card.pending {
  border-color: #f0d7ad;
  background: #fff8eb;
}

.b-order-summary-card.pending small {
  color: #9b7540;
}

.b-order-summary-card.pending strong {
  color: #ad6716;
}

.b-unpaid-principal-card {
  min-width: 140px;
  padding: 9px 14px;
  border: 1px solid #f0d7ad;
  border-radius: 9px;
  background: #fff8eb;
  text-align: right;
}

.b-unpaid-principal-card small,
.b-unpaid-principal-card strong {
  display: block;
}

.b-unpaid-principal-card small {
  color: #9b7540;
  font-size: 10px;
}

.b-unpaid-principal-card strong {
  margin-top: 2px;
  color: #ad6716;
  font-size: 19px;
}

.b-customer-orders-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.b-customer-orders-wrap::-webkit-scrollbar,
.b-table-wrap::-webkit-scrollbar {
  height: 12px;
}

.b-customer-orders-wrap::-webkit-scrollbar-track,
.b-table-wrap::-webkit-scrollbar-track {
  background: #f1f3f7;
}

.b-customer-orders-wrap::-webkit-scrollbar-thumb,
.b-table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid #f1f3f7;
  border-radius: 999px;
  background: #aeb7c8;
}

.b-customer-orders-table {
  width: 100%;
  min-width: 2040px;
  border-collapse: collapse;
  table-layout: fixed;
}

.b-customer-orders-table th,
.b-customer-orders-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  color: #4f5a70;
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.b-customer-orders-table th {
  height: 58px;
  color: #566177;
  background: #f7f8fa;
}

.b-customer-order-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.b-customer-order-address {
  min-width: 240px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-align: left !important;
  white-space: normal !important;
}

.b-customer-order-detail-table th:nth-child(4),
.b-customer-order-detail-table td:nth-child(4),
.b-customer-order-msku {
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.b-inline-action {
  min-width: 70px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  color: var(--purple);
  background: white;
  cursor: pointer;
}

.b-customer-orders-table tbody tr:hover {
  background: #fafbff;
}

.b-order-group-row td {
  padding: 0;
  background: #fbfcff;
}

.b-order-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 0;
  color: #445067;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.b-order-group-arrow {
  width: 18px;
  color: #7f8aa0;
  font-size: 14px;
  text-align: center;
}

.b-order-group-main {
  min-width: 220px;
  display: grid;
  gap: 4px;
}

.b-order-group-main strong {
  font-size: 14px;
}

.b-order-group-main small {
  color: #8590a5;
  font-size: 11px;
}

.b-order-group-metric {
  padding: 6px 10px;
  border-radius: 999px;
  color: #5f6b80;
  background: #eef2f8;
  font-size: 11px;
  white-space: nowrap;
}

.b-order-group-metric.pending {
  color: #ad6716;
  background: #fff3dd;
}

.b-order-group-metric.completed {
  color: #078a50;
  background: #e7f8ef;
}

.b-order-group-metric.unpaid {
  color: #ad6716;
  background: #fff3dd;
}

.b-order-group-detail-row td {
  padding: 0;
  background: #ffffff;
}

.b-order-group-detail-cell {
  border-bottom: 1px solid var(--line);
}

.b-customer-order-detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.b-customer-order-detail-table th,
.b-customer-order-detail-table td {
  padding: 12px 10px;
  border-top: 1px solid #eef1f5;
  color: #4f5a70;
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.b-customer-order-detail-table th {
  color: #566177;
  background: #f7f8fa;
}

.b-order-status-stack {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.b-order-status-stack span {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
}

.b-order-status-stack .pending,
.b-order-status-stack .unpaid {
  color: #ad6716;
  background: #fff3dd;
}

.b-order-status-stack .completed,
.b-order-status-stack .paid {
  color: #078a50;
  background: #e7f8ef;
}

.b-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.b-filters {
  display: flex;
  align-items: center;
  gap: 14px;
}

.b-search {
  width: 390px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.b-search span {
  color: #98a1b1;
  font-size: 20px;
}

.b-search input {
  width: 100%;
  height: 42px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.b-price-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.b-price-filter > span {
  color: #606a7d;
  font-size: 13px;
  font-weight: 600;
}

.b-price-filter i {
  color: #9aa3b2;
  font-style: normal;
}

.b-price-filter input {
  width: 105px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: white;
}

.b-price-filter input:focus {
  border-color: var(--purple);
}

.b-toolbar button {
  height: 42px;
  padding: 0 18px;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  color: #667084;
  background: white;
  cursor: pointer;
}

.b-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.b-toolbar-actions > span {
  color: #8b95a7;
  font-size: 12px;
  white-space: nowrap;
}

.b-toolbar .b-order-button,
.b-modal .b-order-button {
  color: white;
  border-color: var(--purple);
  background: var(--purple);
}

.b-price-filter #priceSearchButton {
  color: white;
  border-color: var(--purple);
  background: var(--purple);
}

.b-table-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.b-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.b-table th {
  height: 65px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  color: #536078;
  background: #f7f8fa;
  font-size: 14px;
  text-align: left;
}

.b-table td {
  height: 126px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

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

.b-table tbody tr:hover {
  background: #fafbff;
}

.b-table th:nth-child(1), .b-table td:nth-child(1) { width: 55px; text-align: center; }
.b-table th:nth-child(2), .b-table td:nth-child(2) { width: 150px; text-align: center; }
.b-table th:nth-child(3), .b-table td:nth-child(3) { width: 43%; }
.b-table th:nth-child(4), .b-table td:nth-child(4) { width: 140px; }
.b-table th:nth-child(5), .b-table td:nth-child(5) { width: 150px; }

.b-checkbox-cell input,
.b-row-select {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

.b-table tr.selected {
  background: #f0f2ff;
}

.b-product-image {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.b-product-title {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  color: #3d4659;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.b-product-title:hover {
  color: #3158d6;
  text-decoration: underline;
}

.b-product-sku {
  color: #929bad;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.b-price {
  font-size: 16px;
  font-weight: 600;
}

.b-stock {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid #bcefd7;
  border-radius: 5px;
  color: #0eaa5c;
  background: #eafaf2;
}

.b-note {
  color: #747e91;
  line-height: 1.6;
}

.b-empty {
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

.b-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  padding: 10px 18px;
  border-radius: 8px;
  color: white;
  background: #2d374c;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: .2s;
}

.b-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.b-modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 32, 51, .58);
  backdrop-filter: blur(4px);
}

.b-modal {
  position: relative;
  width: min(780px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 25px 70px rgba(26, 36, 60, .25);
}

.b-modal-close {
  position: absolute;
  top: 12px;
  right: 15px;
  border: 0;
  color: #8b95a6;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.b-modal-eyebrow {
  margin: 0 0 5px;
  color: #9ba4b5;
  font-size: 9px;
  letter-spacing: .18em;
}

.b-modal h2 {
  margin: 0 0 18px;
}

.b-selected-product {
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 8px;
  color: #5b667b;
  background: #f5f6fa;
  font-size: 12px;
}

.b-modal label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.b-modal label span {
  color: #5f697d;
  font-size: 11px;
  font-weight: 600;
}

.b-modal label b {
  color: #e65555;
}

.b-modal label input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.b-modal label textarea {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  resize: vertical;
  min-height: 110px;
}

.b-review-section {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fc;
}

.b-review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.b-review-heading > div {
  display: grid;
  gap: 3px;
}

.b-review-heading strong {
  color: #4d586e;
  font-size: 12px;
}

.b-review-heading strong b {
  color: #e65555;
}

.b-review-heading small,
.b-review-heading > span {
  color: #8b95a7;
  font-size: 11px;
}

.b-review-list {
  display: grid;
  gap: 10px;
}

.b-review-row {
  display: grid;
  grid-template-columns: 30px minmax(140px, .75fr) minmax(220px, 1.25fr) 74px;
  align-items: center;
  gap: 8px;
}

.b-review-number {
  color: #8a94a7;
  font-size: 11px;
  text-align: center;
}

.b-review-row input,
.b-review-row textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dfe3eb;
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: white;
  font: inherit;
}

.b-review-row input {
  height: 42px;
  padding: 0 11px;
}

.b-review-row textarea {
  min-height: 42px;
  padding: 10px 11px;
  resize: vertical;
}

.b-review-row input:focus,
.b-review-row textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(119, 131, 255, .12);
}

.b-review-actions {
  display: flex;
  gap: 6px;
}

.b-review-actions button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d9dde7;
  border-radius: 7px;
  color: #667084;
  background: white;
  font-size: 18px;
  cursor: pointer;
}

.b-review-actions button:first-child {
  color: white;
  border-color: var(--purple);
  background: var(--purple);
}

.b-review-actions button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.b-order-image-preview {
  height: 170px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cfd5df;
  border-radius: 9px;
  color: #9aa3b3;
  background: #fafbfc;
}

.b-order-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.b-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.b-order-form-status {
  min-height: 18px;
  margin-top: 10px;
  color: #d34d4d;
  font-size: 12px;
}

.b-order-form-status.success {
  color: #159567;
}

.b-modal-actions button {
  height: 42px;
  padding: 0 20px;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  color: #657084;
  background: white;
  cursor: pointer;
}

@media (max-width: 720px) {
  .b-review-row {
    grid-template-columns: 26px 1fr 72px;
  }

  .b-review-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .b-review-row .b-review-content {
    grid-column: 2 / 4;
  }
}

.b-product-detail-modal {
  width: min(820px, calc(100% - 28px));
}

.b-detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.b-detail-image {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e0e5ee;
  border-radius: 12px;
  background: #f8f9fb;
  text-align: center;
}

.b-detail-image img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  background: #fff;
}

.b-detail-image small {
  color: #7a8598;
}

.b-detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #3158d6;
}

.b-detail-description {
  color: #66748a;
  line-height: 1.7;
  white-space: pre-wrap;
}

.b-detail-no-image {
  grid-column: 1 / -1;
  padding: 50px;
  color: #9099a8;
  text-align: center;
}

@media (max-width: 760px) {
  .b-header { padding: 18px; }
  .b-header-meta small { display: none; }
  main { width: calc(100% - 20px); }
  .b-customer-orders-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .b-customer-orders-actions { justify-content: space-between; }
  .b-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .b-filters { align-items: stretch; flex-direction: column; }
  .b-search { width: 100%; }
  .b-price-filter { flex-wrap: wrap; }
  .b-table-wrap { overflow-x: auto; }
  .b-table { min-width: 850px; }
}
