:root {
  --ink: #111111;
  --muted: #6b6b6b;
  --quiet: #9b9b9b;
  --line: #e8e8e8;
  --paper: #fafafa;
  --panel: #ffffff;
  --soft: #f4f4f4;
  --soft-2: #f8f8f8;
  --success: #111111;
  --warning: #555555;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.055);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

button {
  min-height: 38px;
  padding: 0 13px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

button:hover {
  border-color: #cfcfcf;
  background: #fbfbfb;
}

.button-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  border-color: #cfcfcf;
  background: #fbfbfb;
}

input {
  min-height: 42px;
  padding: 0 13px;
  font-size: 14px;
}

select {
  min-height: 42px;
  padding: 0 34px 0 13px;
  font-size: 13px;
  font-weight: 700;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #777 50%),
    linear-gradient(135deg, #777 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.primary:hover {
  background: #000;
  border-color: #000;
}

.danger-button {
  border-color: #111;
  color: #111;
}

.danger-button:hover {
  background: #111;
  border-color: #111;
  color: #fff;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 26px;
  background: rgba(250, 250, 250, 0.84);
  border-bottom: 1px solid rgba(232, 232, 232, 0.9);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  align-items: end;
  gap: 10px;
}

.wordmark {
  line-height: 0.86;
  font-style: italic;
  font-weight: 950;
  letter-spacing: 0;
}

.wordmark {
  font-size: 23px;
}

.wordmark span,
.wordmark strong {
  display: block;
}

.wordmark strong {
  color: #ff5a00;
}

.brand-lockup > span {
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.nav {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.nav.active {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.key-button {
  min-width: 58px;
}

.session-chip {
  display: grid;
  gap: 2px;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.session-chip span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.session-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

.login-card {
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: end;
  gap: 12px;
}

.login-brand > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.login-copy h1 {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.login-form button {
  min-height: 46px;
  margin-top: 6px;
  font-size: 15px;
}

.login-error {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
}

main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.search-home {
  min-height: 28vh;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding-top: 20px;
}

.search-home p {
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: 18px;
}

.universal-search {
  width: min(860px, 100%);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}

kbd {
  min-width: 48px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.search-suggestions {
  width: min(860px, 100%);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.search-suggestions button {
  min-height: 34px;
  color: var(--muted);
  background: transparent;
}

.product-record {
  margin-top: 18px;
}

.product-record[hidden] {
  display: none !important;
}

.home-queues {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.queue-panel {
  min-height: 250px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.queue-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  text-transform: none;
}

.queue-panel p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.queue-list {
  display: grid;
  gap: 6px;
}

.view-all {
  width: 100%;
  margin-top: 10px;
  background: var(--soft-2);
  color: var(--muted);
}

.product-hub-shell {
  padding: 18px;
}

.product-hub-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.product-hub-head h1 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.product-hub-head p {
  margin-top: 6px;
  color: var(--muted);
}

.hub-actions,
.hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hub-toolbar {
  align-items: center;
  margin-bottom: 12px;
}

.hub-toolbar input {
  min-width: 260px;
}

.hub-toolbar select,
.batch-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
}

#hubDirtyState {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hub-progress {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-2);
  color: var(--muted);
  font-weight: 700;
}

.hub-table-wrap {
  overflow: auto;
  max-height: 68vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.hub-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.col-select {
  width: 44px;
}

.col-sku {
  width: 152px;
}

.col-product {
  width: 390px;
}

.col-brand {
  width: 96px;
}

.col-cost {
  width: 120px;
}

.col-price {
  width: 86px;
}

.col-flag {
  width: 86px;
}

.col-website-price {
  width: 152px;
}

.col-stock {
  width: 96px;
}

.col-sync {
  width: 108px;
}

.col-sync-wide {
  width: 128px;
}

.hub-table th,
.hub-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: middle;
}

.hub-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f6f6;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.18;
  text-align: left;
  white-space: normal;
}

.hub-table tbody tr:hover td {
  background: #fbfbfb;
}

.hub-table tr.dirty td {
  background: #fbfbfb;
}

.hub-cell-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
}

.product-name-input {
  min-height: 44px;
  padding-top: 4px;
  line-height: 1.32;
  overflow: hidden;
  resize: none;
  white-space: normal;
}

.numeric-input {
  text-align: right;
}

.hub-cell-input:focus {
  outline: 1px solid #111;
  background: #fff;
}

.sku-edit-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.hub-sku-link {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 11px;
}

.money-cell {
  font-weight: 800;
  text-align: right;
}

.readonly-number {
  display: inline-block;
  width: 100%;
  font-weight: 800;
  text-align: right;
}

.sync-badge,
.stock-alert,
.error-dot {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-badge.ok {
  background: #efefef;
  color: #111;
}

.sync-badge.pending {
  background: #f5f5f5;
  color: #666;
}

.sync-badge.error,
.error-dot {
  background: #111;
  color: #fff;
}

.row-flags {
  min-height: 18px;
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.stock-alert {
  min-height: 18px;
  padding: 0 6px;
  background: #111;
  color: #fff;
  font-size: 10px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.12);
}

.drawer[hidden] {
  display: none !important;
}

.drawer-panel {
  width: min(520px, 100vw);
  height: 100%;
  overflow: auto;
  padding: 18px;
  background: #fff;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.12);
}

.drawer-panel > button {
  margin-bottom: 16px;
}

.invoice-center {
  padding: 18px;
}

.invoice-page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.invoice-page-head h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
}

.invoice-page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.invoice-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.invoice-document {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.06);
}

.invoice-document-top,
.invoice-bottom {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.invoice-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-brand {
  display: grid;
  gap: 8px;
}

.invoice-brand-image {
  width: 240px;
  max-width: 100%;
  height: auto;
  display: block;
}

.invoice-brand small,
.invoice-company-lines {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.invoice-company-lines {
  margin: 12px 0 0;
}

.invoice-document h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.invoice-dates,
.invoice-billto {
  display: grid;
  gap: 12px;
}

.invoice-billto {
  margin: 28px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-billto label:last-child {
  grid-column: 1 / -1;
}

.invoice-dates label,
.invoice-billto label,
.invoice-bottom label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-billto textarea,
.invoice-bottom textarea {
  min-height: 82px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.45;
  text-transform: none;
}

.invoice-lines-card {
  overflow: auto;
  margin: 8px -8px 22px;
  padding: 0 8px 8px;
}

.invoice-lines-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.invoice-lines-table th:nth-child(1),
.invoice-lines-table td:nth-child(1) {
  min-width: 260px;
}

.invoice-lines-table th:nth-child(2),
.invoice-lines-table td:nth-child(2) {
  width: 82px;
}

.invoice-lines-table th:nth-child(3),
.invoice-lines-table td:nth-child(3),
.invoice-lines-table th:nth-child(4),
.invoice-lines-table td:nth-child(4) {
  width: 128px;
}

.invoice-lines-table th:nth-child(5),
.invoice-lines-table td:nth-child(5) {
  width: 46px;
}

.invoice-lines-table th,
.invoice-lines-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px;
  text-align: left;
  vertical-align: middle;
}

.invoice-lines-table th {
  background: #f7f7f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-lines-table tr:last-child td {
  border-bottom: 0;
}

.invoice-lines-table input {
  width: 100%;
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  padding: 0 4px;
}

.invoice-lines-table input:focus {
  border-color: var(--line);
  background: #fff;
}

.invoice-line-qty,
.invoice-line-price,
.invoice-line-amount {
  text-align: right;
}

.invoice-line-amount {
  width: 100px;
  font-weight: 800;
}

.invoice-line-remove {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
}

.invoice-total-box {
  align-self: end;
  display: grid;
  gap: 10px;
  min-width: 280px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f8f8;
}

.invoice-total-box div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.invoice-total-box div:last-child {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.invoice-total-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-total-box strong {
  font-size: 16px;
}

.invoice-total-box div:last-child strong {
  font-size: 24px;
}

.invoice-payment-box {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 13px;
}

.invoice-payment-box strong {
  color: var(--ink);
}

.invoice-side-panel {
  display: grid;
  gap: 14px;
}

.invoice-action-card,
.invoice-list-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.invoice-action-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-action-card strong {
  font-size: 20px;
}

.invoice-action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

#invoiceProgress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.invoice-list-head h2 {
  margin: 0;
  font-size: 20px;
}

.invoice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.invoice-row.active {
  border-color: #111;
  box-shadow: inset 3px 0 0 #111;
}

.invoice-row strong {
  display: block;
  font-size: 16px;
}

.invoice-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.invoice-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.invoice-row-actions button,
.invoice-row-actions .button-link {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.batch-modal {
  width: min(900px, calc(100vw - 28px));
  max-height: 82vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.18);
}

.batch-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.batch-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.batch-preview {
  overflow: auto;
}

.batch-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.batch-preview th,
.batch-preview td {
  padding: 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.queue-item {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  text-align: left;
  background: #fff;
}

.queue-item:hover {
  background: var(--soft-2);
}

.queue-item strong,
.queue-item small,
.queue-item em {
  display: block;
}

.queue-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item em {
  max-width: 126px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}

.record-breadcrumb {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.record-breadcrumb span {
  margin: 0 7px;
}

.record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.record-main {
  overflow: hidden;
}

.record-top {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  padding: 18px;
}

.main-product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  filter: grayscale(1);
}

.record-title {
  display: grid;
  align-content: start;
  gap: 16px;
}

h1,
h2,
p,
dl {
  margin: 0;
}

.record-title h1 {
  max-width: 780px;
  font-size: 22px;
  line-height: 1.22;
  font-weight: 720;
  letter-spacing: 0;
}

.status {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.identity-list,
.clean-list {
  display: grid;
  gap: 9px;
}

.content-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.content-assets div {
  display: grid;
  gap: 7px;
}

.content-assets img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  filter: grayscale(1);
}

.content-assets span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.identity-list div,
.clean-list div {
  display: grid;
  gap: 3px;
}

dt {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.record-tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.record-tab {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.record-tab.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.record-sections {
  padding: 18px;
}

.record-section {
  display: none;
}

.record-section.active {
  display: block;
}

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

.mini-panel {
  min-height: 146px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

h2 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.mini-panel p {
  color: var(--ink);
  line-height: 1.5;
}

.spec-grid,
.metric-grid,
.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

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

.spec,
.metric-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.spec span,
.metric-grid span {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.spec strong,
.metric-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.formula {
  margin: 10px 0;
  padding: 12px;
  border-radius: 14px;
  background: var(--soft-2);
  color: var(--muted);
  line-height: 1.45;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 120px 54px 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.history-row p,
.history-row small {
  color: var(--muted);
}

.assistant-panel {
  position: sticky;
  top: 88px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.assistant-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  text-transform: none;
}

.assistant-title span {
  color: var(--muted);
  font-size: 12px;
}

.ai-message {
  padding: 12px;
  border-radius: 14px;
  background: var(--soft-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ai-input {
  grid-template-columns: 1fr auto;
  display: grid;
  gap: 8px;
}

.receive-shell,
.simple-view,
.order-center {
  padding: 22px;
}

.receive-shell h1,
.simple-view h1,
.order-center h1 {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
}

.order-center {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.order-center h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

.order-head,
.order-toolbar,
.order-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.order-head p {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 14px;
}

.order-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  overflow: hidden;
}

.order-summary article {
  min-height: 70px;
  padding: 13px 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.order-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.order-toolbar {
  margin-bottom: 12px;
  align-items: stretch;
}

.order-toolbar input {
  flex: 1;
  min-width: 260px;
}

.order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.order-queue,
.order-detail-panel {
  min-width: 0;
}

.order-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.order-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.order-table th,
.order-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.order-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfbfb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.order-table td {
  font-size: 13px;
  font-weight: 650;
}

.order-table small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.order-table tr.needs-review td:first-child {
  box-shadow: inset 2px 0 0 var(--ink);
}

.order-table tbody tr {
  cursor: pointer;
  transition: background 120ms ease;
}

.order-table tbody tr:hover {
  background: #fafafa;
}

.order-table tbody tr.selected {
  background: #f4f4f4;
}

.order-link {
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  font-weight: 820;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ededed;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  text-transform: capitalize;
}

.order-badge.ok {
  background: var(--ink);
  color: #fff;
}

.order-badge.error {
  background: #fff;
  color: var(--ink);
  outline: 1px solid var(--ink);
}

.order-badge.pending {
  background: #eeeeee;
}

.order-status-stack,
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.order-detail-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.045);
}

.order-detail-top {
  display: grid;
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.order-detail-top > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.order-detail-top h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.order-detail-top p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.empty-detail {
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 7px;
  text-align: center;
}

.empty-detail span {
  font-size: 18px;
  font-weight: 850;
}

.empty-detail p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.muted,
.empty-row {
  color: var(--muted);
}

.drawer-lines {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.drawer-lines div {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-lines span,
.drawer-lines em {
  color: var(--muted);
  font-style: normal;
}

.shipping-panel {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfb;
}

.order-status-panel {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.order-status-panel h3 {
  margin: 0;
  font-size: 15px;
}

.status-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.status-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

.status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.status-error {
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.shipping-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.shipping-address {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.shipping-address strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.shipping-address span {
  font-size: 13px;
  font-weight: 700;
}

.shipping-address-lines {
  display: grid;
  gap: 2px;
}

.shipping-address-lines p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.shipping-address small {
  color: var(--muted);
  font-size: 12px;
}

.billing-address {
  background: var(--soft-2);
}

.shipping-source {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.shipping-error {
  padding: 10px 12px;
  border: 1px solid #111;
  border-radius: 12px;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 700;
}

.shipping-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shipping-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shipping-panel h3 {
  margin: 0;
  font-size: 15px;
}

.shipping-choice,
.shipping-label {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.shipping-choice strong,
.shipping-label strong {
  font-size: 13px;
}

.shipping-choice span,
.shipping-choice small,
.shipping-label span,
.shipping-label small {
  color: var(--muted);
  font-size: 12px;
}

.quote-list {
  display: grid;
  gap: 6px;
}

.quote-list label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
}

.quote-list strong {
  font-variant-numeric: tabular-nums;
}

.create-label,
.quote-shipping {
  width: 100%;
}

.scan-box,
.settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 18px;
}

.camera-scanner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.camera-scanner[hidden] {
  display: none !important;
}

.camera-scanner video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}

.camera-scanner strong,
.camera-scanner span {
  display: block;
}

.camera-scanner span {
  margin: 6px 0 12px;
  color: var(--muted);
}

.session-box {
  margin: 18px 0;
  padding: 14px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

summary {
  margin-top: 18px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.channel-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.channel-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.command-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: start center;
  padding-top: 11vh;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.command-overlay[hidden] {
  display: none !important;
}

.command-modal {
  width: min(680px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

#commandInput {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
}

.command-results {
  display: grid;
  padding: 7px;
  max-height: min(520px, 68vh);
  overflow: auto;
}

.command-item {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 12px;
}

.command-item:hover {
  background: var(--soft-2);
}

.command-item strong {
  font-size: 14px;
  font-weight: 650;
}

.command-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: 180ms ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .app-header,
  .record-grid,
  .record-top,
  .home-queues,
  .order-summary {
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .header-actions,
  .quick-actions,
  .order-head,
  .order-toolbar,
  .order-actions {
    flex-wrap: wrap;
  }

  .assistant-panel {
    position: static;
  }

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

@media (max-width: 720px) {
  main,
  .app-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .search-home {
    min-height: 42vh;
  }

  .universal-search {
    min-height: 58px;
    font-size: 14px;
  }

  .info-grid,
  .identity-list,
  .content-assets,
  .spec-grid,
  .price-grid,
  .metric-grid,
  .history-row,
  .camera-scanner {
    grid-template-columns: 1fr;
  }
}
