:root {
  color-scheme: light;
  --primary: #2563eb;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --vat: #8b5cf6;
  --bg: #f5f6f8;
  --card: #ffffff;
  --title: #111827;
  --text: #374151;
  --muted: #6b7280;
  --soft-blue: #eff6ff;
  --soft-green: #ecfdf5;
  --soft-yellow: #fffbeb;
  --soft-red: #fef2f2;
  --soft-purple: #f5f3ff;
  --radius: 24px;
  --button-height: 56px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* Product and order detail refinements */
.product-detail-page,
.order-detail-page {
  max-width: 430px;
  margin: 0 auto;
  padding-bottom: 18px;
}

.product-detail-hero,
.order-detail-hero,
.detail-card-ui {
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.product-detail-hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.product-swatch {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, #eaf2ff, #f4f8ff);
}

.product-swatch .merch-product-image,
.product-swatch .merch-product-image.large,
.product-swatch .merch-product-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.product-hero-main {
  min-width: 0;
}

.product-hero-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-hero-title p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.product-hero-title h1 {
  margin: 0;
  color: #111827;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
}

.product-fav-btn {
  margin-left: auto;
  min-width: 58px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d64ff;
  font-size: 13px;
  font-weight: 800;
}

.product-hero-main h2 {
  margin: 8px 0 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.product-tags span {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f5fb;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.product-price-row {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.product-price-row strong {
  color: #1d64ff;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.product-price-row span {
  color: #6b7280;
  font-size: 13px;
}

.detail-card-ui {
  margin-top: 14px;
  padding: 20px 18px;
}

.detail-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-card-title h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.detail-card-title em {
  color: #1d64ff;
  font-style: normal;
  font-size: 14px;
  font-weight: 800;
}

.detail-card-title button {
  border: 0;
  background: transparent;
  color: #1d64ff;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  font-weight: 800;
}

.detail-card-title button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-spec-grid span,
.detail-info-list p,
.order-stage-list p {
  min-width: 0;
  margin: 0;
  border-radius: 16px;
  background: #f7f9fc;
}

.product-spec-grid span {
  padding: 14px;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.product-spec-grid strong {
  color: #111827;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
}

.product-price-card {
  border-radius: 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f9fbff 100%);
  padding: 16px;
}

.product-price-card span,
.product-price-card p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
}

.product-price-card strong {
  display: block;
  margin: 8px 0 6px;
  color: #1d64ff;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
}

.detail-timeline {
  display: flex;
  flex-direction: column;
}

.detail-timeline p {
  position: relative;
  margin: 0;
  display: grid;
  grid-template-columns: 92px 22px 1fr;
  gap: 8px;
  padding: 0 0 18px;
}

.detail-timeline p:last-child {
  padding-bottom: 0;
}

.detail-timeline time {
  color: #6b7280;
  font-size: 15px;
}

.detail-timeline i {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.12);
}

.detail-timeline i.current {
  background: #1d64ff;
  box-shadow: 0 0 0 6px rgba(29, 100, 255, 0.12);
}

.detail-timeline p:not(:last-child) i::after {
  content: "";
  position: absolute;
  left: 105px;
  top: 17px;
  width: 1px;
  height: calc(100% - 12px);
  background: #dbe3f0;
}

.detail-timeline strong {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.detail-timeline span {
  grid-column: 3;
  color: #6b7280;
  font-size: 14px;
}

.product-process-list article {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: #f7f9fc;
}

.product-process-list article + article {
  margin-top: 12px;
}

.product-process-list h3 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.product-process-list p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 15px;
}

.product-process-list div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.product-process-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d64ff;
  font-size: 13px;
  font-weight: 800;
}

.order-detail-hero {
  padding: 22px 18px 20px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.18), transparent 28%),
    linear-gradient(135deg, #1677ff 0%, #1d64ff 55%, #38a7ff 100%);
  color: #fff;
}

.order-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.order-hero-top p,
.order-hero-top h1 {
  margin: 0;
}

.order-hero-top p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 700;
}

.order-hero-top h1 {
  margin-top: 8px;
  color: #fff;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 900;
}

.order-hero-top span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 800;
}

.order-hero-top > strong {
  color: #fff36a;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
}

.order-progress-bar {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
}

.order-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.order-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.order-hero-grid span {
  min-height: 58px;
  border-radius: 16px;
  background: rgba(255,255,255,.14);
  padding: 10px 12px;
  color: rgba(255,255,255,.72);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.order-hero-grid strong {
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.order-action-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.order-action-strip button,
.order-link-grid button {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: #eaf2ff;
  color: #1d64ff;
  font-size: 15px;
  font-weight: 900;
}

.detail-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-info-list p {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-info-list span,
.order-stage-list span {
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
}

.detail-info-list strong {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.order-detail-info-compact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-detail-info-compact .detail-info-row {
  display: grid;
  gap: 12px;
}

.order-detail-info-compact .detail-info-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-detail-info-compact .detail-info-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-detail-info-compact p {
  min-width: 0;
  margin: 0;
}

.order-stage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-stage-list p {
  display: grid;
  grid-template-columns: 58px 1fr 76px;
  align-items: center;
  gap: 10px;
  padding: 14px;
}

.order-stage-list strong {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.order-stage-list b {
  color: #1d64ff;
  text-align: right;
  font-size: 15px;
}

.order-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 400px) {
  .product-detail-hero {
    grid-template-columns: 96px 1fr;
    gap: 14px;
  }

  .product-swatch {
    width: 96px;
    height: 96px;
  }

  .product-hero-title h1 {
    font-size: 24px;
  }

  .product-hero-main h2 {
    font-size: 16px;
  }

  .product-spec-grid,
  .detail-info-list {
    gap: 10px;
  }

  .order-hero-top h1 {
    font-size: 26px;
  }

  .order-action-strip {
    gap: 8px;
  }

  .order-action-strip button {
    font-size: 14px;
  }
}

/* Reference-style product and inventory detail pages */
.content.no-tab:has(.ref-detail-page) {
  padding: 0;
  background: #f4f6f9;
}

.workspace:has(.ref-detail-page) {
  display: block;
  background: #f4f6f9;
}

.app:has(.ref-detail-page) {
  width: 100%;
  max-width: none;
}

.inventory-live-table .head,
.inventory-live-table button {
  grid-template-columns: 1.28fr .95fr .58fr 20px;
  gap: 8px;
}

.inventory-live-table button svg {
  display: block;
}

@media (max-width: 400px) {
  .inventory-live-table .head,
  .inventory-live-table button {
    grid-template-columns: 1.18fr .9fr .52fr 18px;
    gap: 7px;
  }

  .inventory-live-table button span {
    font-size: 15px;
  }

  .inventory-live-table button em,
  .inventory-live-table button b {
    font-size: 14px;
  }

  .overview-value {
    font-size: 20px;
  }

  .change-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    padding: 10px 0;
  }

  .change-value {
    grid-column: 2;
    justify-self: start;
  }
}

.ref-detail-page {
  min-height: 100vh;
  background: #f4f6f9;
  color: #111827;
}

.ref-detail-page svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ref-hero {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 28px 72px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.12), transparent 32%),
    linear-gradient(135deg, #0d6dff 0%, #1d64ff 52%, #35a8ff 100%);
}

.ref-hero::before,
.ref-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ref-hero::before {
  right: -130px;
  bottom: -76px;
  width: 560px;
  height: 255px;
  border-radius: 50%;
  background: rgba(255,255,255,.17);
  transform: rotate(-18deg);
}

.ref-hero::after {
  left: -96px;
  bottom: 42px;
  width: 135%;
  height: 178px;
  border-top: 2px solid rgba(255,255,255,.20);
  border-radius: 50%;
  transform: rotate(10deg);
}

.ref-topline {
  position: relative;
  z-index: 1;
  margin-top: 0;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 44px;
}

.ref-topline h1 {
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
}

.ref-topline span {
  display: block;
}

.ref-hero-main {
  position: relative;
  z-index: 1;
  margin-top: 36px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.ref-hero-main > div {
  min-width: 0;
}

.ref-hero-main strong {
  display: block;
  color: #fff;
  font-size: clamp(42px, 11.5vw, 52px);
  line-height: 1.05;
  font-weight: 900;
}

.product-ref-page .ref-hero-main strong {
  font-size: clamp(42px, 11.5vw, 52px);
}

.ref-hero-main h2 {
  margin: 12px 0 0;
  color: #fff;
  font-size: clamp(32px, 9.2vw, 48px);
  line-height: 1.12;
  font-weight: 900;
}

.product-ref-page .ref-hero-main h2 {
  font-size: clamp(34px, 8.4vw, 46px);
  white-space: nowrap;
}

.inventory-ref-page .ref-hero-main h2 {
  display: none;
}

.ref-hero-main p {
  margin: 8px 0 0;
  color: rgba(255,255,255,.92);
  font-size: clamp(18px, 5vw, 22px);
  line-height: 1.35;
  font-weight: 700;
}

.ref-hero-main button {
  min-width: 118px;
  height: 44px;
  border: 1.5px solid rgba(255,255,255,.88);
  border-radius: 16px;
  background: rgba(255,255,255,.1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.ref-hero-main button svg {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.ref-detail-body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: -44px auto 0;
  padding: 0 16px 28px;
}

.ref-card {
  border-radius: 24px;
  background: #fff;
  padding: 22px 20px;
  box-shadow: 0 13px 32px rgba(15,23,42,.07);
}

.ref-card + .ref-card {
  margin-top: 14px;
}

.ref-card-title,
.ref-card-headline {
  display: flex;
  align-items: center;
}

.ref-card-title {
  gap: 14px;
}

.ref-card-title-between {
  justify-content: space-between;
  gap: 14px;
}

.ref-card-title-core {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ref-card-title > span {
  width: 34px;
  height: 34px;
  color: #1d64ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ref-card-title svg {
  width: 34px;
  height: 34px;
}

.ref-card-title h2 {
  margin: 0;
  color: #111827;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 900;
}

.ref-card-title-core > span {
  width: 34px;
  height: 34px;
  color: #1d64ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ref-card-title-core svg {
  width: 34px;
  height: 34px;
}

.ref-card-title-core h2 {
  margin: 0;
  color: #111827;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 900;
}

.ref-inline-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d64ff;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.ref-card-headline {
  justify-content: space-between;
  margin-bottom: 18px;
}

.ref-card-headline > span {
  color: #6b7280;
  font-size: 18px;
}

.ref-product-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
}

.ref-fabric-thumb {
  position: relative;
  width: 104px;
  height: 104px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 45% 48%, rgba(255,255,255,.95), rgba(219,235,255,.45) 35%, transparent 56%),
    conic-gradient(from 20deg at 52% 52%, #d9eaff, #f8fbff, #c8ddff, #edf5ff, #d7e9ff);
}

.ref-fabric-thumb::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: repeating-conic-gradient(from 18deg, rgba(255,255,255,.25) 0 10deg, transparent 10deg 24deg);
  filter: blur(5px);
}

.ref-fabric-thumb span {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #2563eb;
  font-size: 46px;
  font-weight: 900;
}

.ref-product-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ref-product-meta p {
  margin: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.ref-product-meta span {
  color: #6b7280;
  font-size: 18px;
  white-space: nowrap;
}

.ref-product-meta b,
.ref-product-meta strong {
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  white-space: nowrap;
}

.ref-product-meta strong {
  color: #1d64ff;
}

.product-ref-page .ref-hero-main > div {
  min-width: 0;
}

.product-ref-page .ref-hero-main p {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-product-summary-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.ref-product-summary-main h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.ref-summary-price,
.ref-summary-date {
  margin: 0;
}

.ref-summary-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: #374151;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
}

.ref-summary-price strong {
  color: #1d64ff;
  font-size: 21px;
  font-weight: 900;
}

.ref-summary-date {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.ref-info-stack {
  margin-top: 20px;
}

.ref-info-row {
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid #e5eaf2;
}

.ref-info-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.ref-info-row p,
.ref-info-row-wide {
  margin: 0;
}

.ref-info-row-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ref-info-row p,
.ref-info-row-wide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  text-align: left;
}

.ref-info-row span,
.ref-price-detail span {
  color: #6b7280;
  font-size: 16px;
  line-height: 1.3;
}

.ref-info-row b,
.ref-price-detail b {
  color: #111827;
  font-size: 19px;
  line-height: 1.38;
  font-weight: 900;
}

.ref-info-row-wide b {
  white-space: normal;
}

.ref-price-detail {
  margin-top: 18px;
  border-top: 1px solid #e5eaf2;
}

.ref-price-detail-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid #e5eaf2;
}

.ref-price-detail-row p {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.ref-price-detail-row:first-child p:first-child b {
  color: #1d64ff;
  font-size: 22px;
}

.ref-history-entry {
  width: 100%;
  min-height: 48px;
  padding: 14px 0 0;
  border: 0;
  background: transparent;
  color: #1d64ff;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
  text-align: left;
}

.ref-detail-edit-btn {
  width: 100%;
  height: 52px;
  margin: 16px 0 calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 16px;
  background: #1d64ff;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(29, 100, 255, 0.24);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.ref-pill-btn {
  border: 0;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d64ff;
  height: 44px;
  min-width: 58px;
  font-size: 16px;
  font-weight: 800;
}

.ref-info-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr);
  gap: 0 34px;
}

.ref-info-grid p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0 0 20px;
}

.ref-info-grid p:nth-child(n + 3) {
  padding-top: 20px;
  border-top: 1px solid #e5eaf2;
}

.ref-info-grid p:nth-child(5) {
  grid-column: 1 / 2;
}

.ref-info-grid span,
.ref-price-grid span {
  color: #6b7280;
  font-size: 17px;
}

.ref-info-grid b,
.ref-price-grid b {
  color: #111827;
  font-size: 19px;
  line-height: 1.28;
  font-weight: 800;
}

.ref-price-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
}

.ref-price-grid p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-price-grid p:first-child b,
.ref-three-list b {
  color: #1d64ff;
}

.ref-three-list {
  margin-top: 14px;
}

.price-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
}

.price-modal-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #ffffff;
  box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.18);
}

.price-modal-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #d8e1f0;
}

.price-modal-head h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.price-modal-head p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
}

.price-modal-form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.price-modal-form label {
  display: grid;
  gap: 8px;
}

.price-modal-form span {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.price-modal-form input,
.price-modal-form select,
.price-modal-form textarea {
  width: 100%;
  border: 1px solid #dbe3f0;
  border-radius: 14px;
  background: #f7f9fc;
  color: #111827;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  outline: none;
}

.price-modal-form input,
.price-modal-form select {
  height: 48px;
  padding: 0 14px;
}

.price-modal-form textarea {
  min-height: 78px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: none;
}

.price-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  margin-top: 18px;
}

.price-modal-actions button {
  height: 52px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 900;
}

.price-modal-cancel {
  background: #f3f5f8;
  color: #6b7280;
}

.price-modal-save {
  background: #1d64ff;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 100, 255, 0.24);
}

.ref-three-list p {
  margin: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e5eaf2;
}

.ref-three-list p:last-child {
  border-bottom: 0;
}

.ref-three-list span,
.ref-three-list em {
  color: #6b7280;
  font-size: 16px;
  font-style: normal;
}

.ref-three-list b {
  text-align: center;
  font-size: 17px;
  font-weight: 900;
}

.ref-three-list em {
  text-align: right;
}

.ref-process-text {
  margin-top: 14px;
}

.ref-process-text h3 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.ref-process-text p,
.ref-note-card p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.48;
}

.ref-inventory-timeline p {
  position: relative;
  margin: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 62px 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e5eaf2;
}

.ref-inventory-timeline p:last-child {
  border-bottom: 0;
}

.ref-inventory-timeline time {
  color: #6b7280;
  font-size: 18px;
}

.ref-inventory-timeline i {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.ref-inventory-timeline i.up {
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22,163,74,.13);
}

.ref-inventory-timeline i.down {
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239,68,68,.12);
}

.ref-inventory-timeline p:not(:last-child) i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 11px;
  width: 1px;
  height: 64px;
  background: #dbe3f0;
  transform: translateX(-50%);
}

.ref-inventory-timeline strong {
  color: #111827;
  font-size: 20px;
  font-weight: 800;
}

.ref-inventory-timeline b {
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.ref-inventory-timeline b.up {
  color: #16a34a;
}

.ref-inventory-timeline b.down {
  color: #ef4444;
}

.ref-stock-table {
  margin-top: 24px;
}

.ref-stock-table .head,
.ref-stock-table button {
  display: grid;
  grid-template-columns: 1.22fr .9fr 1fr 0;
  align-items: center;
  gap: 10px;
}

.ref-stock-table .head {
  padding-bottom: 14px;
  color: #6b7280;
  border-bottom: 1px solid #e5eaf2;
  font-size: 17px;
}

.ref-stock-table button {
  width: 100%;
  min-height: 64px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #e5eaf2;
  background: transparent;
  text-align: left;
}

.ref-stock-table button:last-child {
  border-bottom: 0;
}

.ref-stock-table button span {
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.ref-stock-table button em {
  color: #6b7280;
  font-size: 16px;
  line-height: 1.22;
  font-style: normal;
}

.ref-stock-table button b {
  color: #111827;
  font-size: 17px;
  line-height: 1.22;
  font-weight: 900;
  text-align: right;
}

.ref-stock-table button svg {
  display: none;
}

.inventory-live-table .head,
.inventory-live-table button {
  grid-template-columns: 1.28fr .95fr .58fr 20px;
  gap: 8px;
}

.inventory-live-table .head {
  font-size: 15px;
}

.inventory-live-table button {
  min-height: 56px;
}

.inventory-live-table button span {
  font-size: 16px;
}

.inventory-live-table button em {
  color: #374151;
  font-size: 15px;
  font-weight: 700;
}

.inventory-live-table button b {
  font-size: 15px;
  text-align: left;
}

.inventory-live-table button svg {
  display: block;
  width: 17px;
  height: 17px;
  color: #9ca3af;
  justify-self: end;
}

.inventory-type-body {
  margin-top: -52px;
}

.type-detail-card .ref-card-title {
  margin-bottom: 20px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 14px;
}

.overview-grid p {
  margin: 0;
  min-width: 0;
}

.overview-label {
  display: block;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.25;
}

.overview-value {
  display: block;
  margin-top: 7px;
  color: #111827;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
}

.inventory-source-detail-card .ref-card-title {
  margin-bottom: 14px;
}

.inventory-source-table {
  overflow: hidden;
  border: 1px solid #e9edf3;
  border-radius: 14px;
}

.inventory-source-head,
.inventory-source-table p {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(100px, 0.8fr);
  align-items: center;
  margin: 0;
}

.inventory-source-head {
  min-height: 42px;
  color: #667085;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 750;
}

.inventory-source-head span,
.inventory-source-table p strong,
.inventory-source-table p b {
  padding: 10px 14px;
}

.inventory-source-head span:last-child,
.inventory-source-table p b {
  border-left: 1px solid #edf0f4;
  text-align: right;
}

.inventory-source-table p {
  min-height: 48px;
  border-top: 1px solid #edf0f4;
}

.inventory-source-table p strong {
  overflow: hidden;
  color: #344054;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-source-table p b {
  color: #111827;
  font-size: 15px;
  font-weight: 850;
}

.inventory-source-empty {
  padding: 20px 14px;
  color: #98a2b3;
  font-size: 14px;
  text-align: center;
}

.change-list {
  margin-top: 12px;
}

.change-row {
  margin: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #edf1f7;
}

.change-row:last-child {
  border-bottom: 0;
}

.change-date {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.25;
}

.change-title {
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}

.change-value {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 900;
  white-space: nowrap;
}

.change-value.increase {
  color: #16a34a;
}

.change-value.decrease {
  color: #ef4444;
}

/* Stock board reference layout */
.content:has(.stock-board-page) {
  padding: 24px 20px 116px;
  background:
    radial-gradient(circle at 12% -10%, rgba(255,255,255,.95) 0 160px, transparent 260px),
    linear-gradient(180deg, #f7f9fc 0%, #f2f4f8 100%);
}

.stock-board-page {
  max-width: 430px;
  margin: 0 auto;
}

.stock-board-page svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stock-board-header h1 {
  margin: 0;
  color: #111827;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 900;
}

.stock-board-header p {
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
}

.stock-board-header svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
  stroke-width: 2.2;
}

.stock-search {
  margin-top: 20px;
  height: 54px;
  border: 1px solid #edf1f7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.stock-search svg {
  width: 20px;
  height: 20px;
  color: #8b95a7;
  flex-shrink: 0;
}

.stock-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.stock-search input::placeholder {
  color: #9aa3b2;
  font-weight: 700;
}

.stock-update-panel {
  margin-top: 18px;
  border-radius: 18px;
  background: #fff;
  padding: 18px 14px 18px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

.stock-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stock-panel-head h2 {
  margin: 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 900;
}

.stock-panel-head button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #1d64ff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.stock-panel-head button svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.stock-update-list {
  display: grid;
  gap: 8px;
}

.stock-update-item {
  width: 100%;
  min-height: 66px;
  border: 1px solid #dbe6f5;
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fbff 0%, #f2f7ff 100%);
  padding: 11px 12px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.stock-update-item strong {
  display: block;
  color: #111827;
  font-size: 16px;
  line-height: 1.22;
  font-weight: 900;
}

.stock-update-item span {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
}

@media (max-width: 400px) {
  .ref-hero {
    min-height: 288px;
    padding: calc(env(safe-area-inset-top, 0px) + 26px) 24px 68px;
  }

  .ref-hero-main strong {
    font-size: 42px;
  }

  .product-ref-page .ref-hero-main strong {
    font-size: 42px;
  }

  .ref-hero-main h2 {
    font-size: 31px;
  }

  .product-ref-page .ref-hero-main h2 {
    font-size: 33px;
  }

  .ref-hero-main p {
    font-size: 18px;
  }

  .ref-hero-main button {
    min-width: 112px;
    height: 50px;
    padding: 0 12px;
    font-size: 16px;
  }

  .ref-detail-body {
    padding-inline: 12px;
  }

  .ref-product-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .ref-fabric-thumb {
    width: 88px;
    height: 88px;
  }

  .ref-fabric-thumb span {
    font-size: 42px;
  }

  .ref-product-meta p {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 5px;
  }

  .ref-product-meta span,
  .ref-info-grid span,
  .ref-price-grid span,
  .ref-three-list span,
  .ref-three-list em {
    font-size: 16px;
  }

  .ref-product-meta b,
  .ref-product-meta strong,
  .ref-info-grid b,
  .ref-price-grid b {
    font-size: 17px;
  }

  .ref-card-title h2 {
    font-size: 23px;
  }

  .ref-stock-table .head,
  .ref-stock-table button {
    grid-template-columns: 1.2fr .88fr 1fr 0;
    gap: 7px;
  }

  .ref-stock-table button span,
  .ref-stock-table button em {
    font-size: 15px;
  }

  .ref-stock-table button b {
    font-size: 16px;
  }

  .ref-inventory-timeline p {
    grid-template-columns: 56px 18px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .ref-inventory-timeline time,
  .ref-inventory-timeline b {
    font-size: 16px;
  }

  .ref-inventory-timeline strong {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .ref-hero {
    min-height: 282px;
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px 66px;
  }

  .ref-topline {
    grid-template-columns: 44px 1fr 44px;
  }

  .ref-topline h1 {
    font-size: 25px;
  }

  .ref-hero-main {
    margin-top: 32px;
    display: block;
    min-height: 148px;
  }

  .ref-hero-main strong,
  .product-ref-page .ref-hero-main strong {
    font-size: 40px;
    white-space: nowrap;
  }

  .ref-hero-main h2 {
    font-size: 28px;
    max-width: 175px;
  }

  .product-ref-page .ref-hero-main h2 {
    max-width: none;
    font-size: 31px;
    white-space: nowrap;
  }

  .ref-hero-main p {
    font-size: 18px;
    max-width: 172px;
  }

  .ref-hero-main button {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 96px;
    height: 48px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 15px;
  }

  .ref-card {
    padding: 20px 16px;
  }

  .ref-product-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .ref-fabric-thumb {
    width: 76px;
    height: 76px;
    border-radius: 14px;
  }

  .ref-fabric-thumb span {
    font-size: 34px;
  }

  .ref-product-meta {
    gap: 10px;
  }

  .ref-product-meta p {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .ref-product-meta span,
  .ref-product-meta b,
  .ref-product-meta strong {
    font-size: 14px;
  }

  .ref-product-meta b,
  .ref-product-meta strong {
    white-space: normal;
  }

  .ref-info-grid {
    gap: 0 22px;
  }

  .ref-stock-table .head {
    font-size: 14px;
  }

  .ref-stock-table .head,
  .ref-stock-table button {
    grid-template-columns: 1.08fr .86fr 1fr 0;
    gap: 6px;
  }

  .ref-stock-table button {
    min-height: 66px;
  }

  .ref-stock-table button span,
  .ref-stock-table button em {
    font-size: 13px;
  }

  .ref-stock-table button b {
    font-size: 14px;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-size: 18px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

button {
  border: 0;
  cursor: pointer;
}

.workspace {
  width: 100%;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  background: var(--bg);
}

.app {
  width: min(430px, 100%);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

.screen {
  min-height: 100svh;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: enter 220ms var(--ease);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  flex: 0 0 auto;
  min-height: 64px;
  padding: 12px max(20px, env(safe-area-inset-left)) 10px max(20px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  background: rgba(245, 246, 248, 0.94);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 3;
}

.topbar h2 {
  margin: 0;
  text-align: center;
  font-size: 20px;
  line-height: 1.25;
  color: var(--title);
  font-weight: 800;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  color: var(--title);
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.back-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.back-button-icon,
.back-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-button.dark {
  color: #111827;
}

.back-button.light {
  color: #fff;
}

.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 122px;
}

.content.no-tab {
  padding-bottom: 32px;
}

.login {
  min-height: 100svh;
  width: 100%;
  padding: clamp(28px, 7vw, 72px) 20px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 28px;
  background: var(--bg);
}

.login h1 {
  margin: 20px 0 10px;
  font-size: clamp(36px, 8vw, 54px);
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--title);
  font-weight: 900;
}

.login p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 19px;
}

.login-card,
.form-card,
.card,
.kpi,
.menu-item,
.timeline,
.empty-state {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 18px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.search-row input {
  width: 100%;
  min-height: var(--button-height);
  border: 0;
  border-radius: 18px;
  background: #f2f4f7;
  color: var(--title);
  padding: 14px 16px;
  outline: none;
}

.field textarea {
  min-height: 116px;
  resize: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-row input:focus {
  background: #eef4ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.role-grid,
.hero-row,
.kpi-grid,
.menu-grid,
.actions,
.detail-grid {
  display: grid;
  gap: 10px;
}

.role-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.role-btn,
.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: var(--button-height);
  border-radius: 18px;
  font-weight: 800;
  font-size: 18px;
}

.role-btn,
.secondary-btn {
  background: #eef2ff;
  color: var(--primary);
}

.primary-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}

.danger-btn {
  width: 100%;
  background: var(--soft-red);
  color: var(--danger);
}

.hero {
  padding: 20px;
  border-radius: 28px;
  color: var(--title);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero .meta {
  font-size: 16px;
  color: var(--muted);
  font-weight: 700;
}

.hero h1 {
  margin: 6px 0 14px;
  font-size: 32px;
  line-height: 1.08;
  color: var(--title);
  font-weight: 900;
}

.hero-row {
  grid-template-columns: repeat(3, 1fr);
}

.hero-pill {
  min-height: 66px;
  padding: 10px 12px;
  border-radius: 20px;
  background: #f3f6fb;
}

.hero-pill b {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  color: var(--primary);
  font-weight: 900;
}

.hero-pill span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.25;
}

.section-title {
  margin: 18px 4px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.section-title h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  color: var(--title);
  font-weight: 900;
}

.section-title span {
  color: var(--muted);
  font-size: 15px;
}

.kpi-grid,
.menu-grid,
.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi {
  min-height: 76px;
  padding: 16px;
  text-align: left;
}

.kpi strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--primary);
  font-weight: 900;
}

.kpi span {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.kpi.todo strong {
  color: var(--warning);
}

.kpi.doing strong {
  color: var(--primary);
}

.kpi.done strong {
  color: var(--success);
}

.kpi.risk strong {
  color: var(--danger);
}

.menu-item {
  min-height: 76px;
  padding: 16px;
  text-align: left;
}

.menu-item b {
  display: block;
  margin-bottom: 4px;
  color: var(--title);
  font-size: 19px;
  line-height: 1.25;
}

.menu-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  white-space: nowrap;
  font-size: 17px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.tab.active {
  background: var(--primary);
  color: #fff;
}

.card {
  width: 100%;
  margin-bottom: 10px;
  padding: 20px;
  text-align: left;
}

.card-head,
.line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card h3 {
  margin: 0;
  color: var(--title);
  font-size: 20px;
  line-height: 1.3;
}

.card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.tag.todo {
  color: var(--warning);
  background: var(--soft-yellow);
}

.tag.doing {
  color: var(--primary);
  background: var(--soft-blue);
}

.tag.vat {
  color: var(--vat);
  background: var(--soft-purple);
}

.tag.done {
  color: var(--success);
  background: var(--soft-green);
}

.tag.risk {
  color: var(--danger);
  background: var(--soft-red);
}

.detail-item {
  min-height: 92px;
  padding: 16px;
  border-radius: 20px;
  background: #f5f6f8;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 8px;
}

.detail-item b {
  color: var(--title);
  font-size: 19px;
  line-height: 1.25;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
  margin-top: 18px;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--primary);
}

.timeline {
  padding: 8px 18px;
}

.timeline li {
  list-style: none;
  padding: 16px 0;
  color: var(--muted);
  font-size: 16px;
}

.timeline li::before {
  content: none;
}

.timeline b {
  display: block;
  color: var(--title);
  font-size: 18px;
  margin-bottom: 6px;
}

.form-card {
  padding: 20px;
}

.actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.actions .primary-btn,
.actions .secondary-btn,
.actions .danger-btn {
  width: auto;
}

.bottom-bar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 382px);
  height: 84px;
  background: rgba(255, 255, 255, 0.96);
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  z-index: 4;
  transform: translateX(-50%);
}

.nav-2 {
  grid-template-columns: repeat(2, 1fr);
}

.nav-3 {
  grid-template-columns: repeat(3, 1fr);
}

.nav-4 {
  grid-template-columns: repeat(4, 1fr);
}

.nav-5 {
  grid-template-columns: repeat(5, 1fr);
}

.nav-btn {
  min-width: 0;
  min-height: 68px;
  border-radius: 24px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 14px;
  font-weight: 800;
}

.nav-btn b {
  font-size: 28px;
  line-height: 1;
}

.nav-btn b svg {
  width: 28px;
  height: 28px;
}

.nav-btn.active {
  color: #2563eb;
  background: #eaf3ff;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  font-size: 16px;
  z-index: 5;
  animation: toast 1.6s var(--ease) forwards;
}

@keyframes toast {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  16%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.empty-state {
  padding: 24px;
  text-align: center;
}

.empty-state p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 12px;
  margin-bottom: 16px;
}

.search-row .primary-btn {
  min-width: 92px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot.todo {
  background: var(--warning);
}

.dot.doing {
  background: var(--primary);
}

.dot.done {
  background: var(--success);
}

.dot.risk {
  background: var(--danger);
}

@media (min-width: 760px) {
  .app {
    margin: 0 auto;
  }

  .content {
    padding: 20px 16px 122px;
  }

  .login {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 44px;
    padding-inline: 40px;
  }

  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body {
    font-size: 17px;
  }

  .content {
    padding: 18px 16px 122px;
  }

  .login {
    padding: 28px 16px;
  }

  .hero {
    padding: 20px;
  }

  .kpi-grid,
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .actions,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .card-head {
    align-items: flex-start;
  }

  .nav-btn span {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Merchandiser pages: light mini-program style */
.merch-page {
  --m-bg: #f6f8fc;
  --m-card: #ffffff;
  --m-blue: #2563eb;
  --m-title: #111827;
  --m-text: #374151;
  --m-muted: #6b7280;
  --m-success: #16a34a;
  --m-warning: #f59e0b;
  --m-danger: #ef4444;
  --m-border: #eef1f6;
  --m-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  color: var(--m-text);
}

.merch-page svg,
.nav-btn svg {
  width: 1em;
  height: 1em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.merch-page .merch-header,
.merch-page .merch-section,
.merch-page .merch-order-card,
.merch-page .merch-info-card,
.merch-page .merch-overview-card,
.merch-page .merch-progress-card,
.merch-page .merch-vat-card,
.merch-page .merch-feedback-card,
.merch-page .merch-form-card,
.merch-page .merch-feedback-stats {
  background: var(--m-card);
  border-radius: 20px;
  box-shadow: var(--m-shadow);
}

.merch-header {
  min-height: 76px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.merch-header p,
.merch-blue-card p,
.merch-order-card p,
.merch-vat-card p,
.merch-feedback-card p,
.merch-overview-card p {
  margin: 0;
  color: var(--m-muted);
  font-size: 13px;
  line-height: 1.45;
}

.merch-header h1 {
  margin: 3px 0 0;
  color: var(--m-title);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 600;
}

.merch-avatar {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: #eaf3ff;
  color: var(--m-blue);
  font-size: 18px;
  font-weight: 700;
}

.merch-home-head {
  min-height: 64px;
  margin-bottom: 8px;
  padding: 2px 8px 0;
  display: block;
}

.merch-home-head h1 {
  margin: 0;
  color: var(--m-title);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
}

.merch-home-head p {
  margin: 0 0 6px;
  color: var(--m-muted);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 500;
}

.merch-home-head .date-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}

.merch-home-head .date-line svg {
  width: 16px;
  height: 16px;
}

.home-avatar {
  margin-top: 4px;
  background: #fff;
  box-shadow: var(--m-shadow);
}

.merch-section {
  padding: 18px;
  margin-bottom: 14px;
}

.home-card {
  border-radius: 24px;
  padding: 12px;
  margin-bottom: 10px;
}

.merch-todo-panel {
  background: var(--m-card);
}

.merch-todo-panel .merch-todo-grid {
  gap: 8px;
}

.merch-todo-panel .merch-section-title h2,
.merch-todo-panel .merch-section-title span {
  color: var(--m-title);
}

.merch-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.merch-section-title h2 {
  margin: 0;
  color: var(--m-title);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
}

.merch-section-title span {
  color: var(--m-muted);
  font-size: 12px;
}

.section-link {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--m-blue);
  font-size: 14px;
  font-weight: 600;
}

.section-link svg {
  width: 16px;
  height: 16px;
}

.merch-todo-grid,
.merch-action-grid,
.merch-query-grid,
.merch-quick-grid,
.merch-blue-grid,
.merch-order-grid,
.merch-info-card,
.merch-feedback-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.merch-todo-card {
  height: 64px;
  padding: 8px;
  border: 1px solid var(--m-border);
  border-radius: 18px;
  background: #fff;
  text-align: left;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
}

.merch-todo-card strong {
  display: block;
  color: var(--item-color);
  font-size: 22px;
  line-height: 1.05;
  font-weight: 700;
}

.merch-todo-card b {
  display: block;
  color: var(--m-title);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
}

.merch-todo-card em {
  color: var(--m-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.todo-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--item-color) 10%, #fff);
  color: var(--item-color);
  display: grid;
  place-items: center;
}

.todo-icon svg {
  width: 22px;
  height: 22px;
}

.merch-search-row {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 10px;
  margin-bottom: 10px;
}

.merch-query-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.merch-query-grid button {
  min-height: 54px;
  padding: 0 8px;
  border-radius: 16px;
  background: #f7faff;
  color: var(--m-title);
  font-size: 13px;
  font-weight: 600;
}

.merch-quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.merch-quick-grid button {
  height: 62px;
  padding: 9px 8px 8px;
  border: 1px solid var(--m-border);
  border-radius: 18px;
  background: #fff;
  text-align: center;
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
}

.merch-quick-grid b {
  display: block;
  color: var(--m-title);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
}

.merch-quick-grid span {
  width: 24px;
  height: 24px;
  color: var(--item-color);
  display: grid;
  place-items: center;
}

.merch-quick-grid span svg {
  width: 22px;
  height: 22px;
}

.merch-quick-grid i {
  position: absolute;
  right: 8px;
  bottom: 20px;
  color: var(--m-muted);
  font-style: normal;
}

.merch-quick-grid i svg {
  width: 13px;
  height: 13px;
}

.merch-mini-card {
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f7faff;
  text-align: left;
}

.merch-mini-card + .merch-mini-card {
  margin-top: 10px;
}

.merch-mini-card b {
  display: block;
  color: var(--m-title);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

.merch-mini-card span {
  display: block;
  margin-top: 4px;
  color: var(--m-muted);
  font-size: 12px;
  line-height: 1.35;
}

.merch-timeline {
  display: grid;
}

.timeline-item {
  min-height: 44px;
  padding: 0;
  display: grid;
  grid-template-columns: 44px 14px 1fr;
  gap: 8px;
  align-items: center;
  background: transparent;
  text-align: left;
  position: relative;
}

.timeline-item + .timeline-item {
  margin-top: 6px;
}

.timeline-item time {
  color: var(--m-muted);
  font-size: 12px;
  line-height: 20px;
}

.timeline-mark {
  width: 14px;
  height: 44px;
  position: relative;
}

.timeline-mark::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 23px;
  bottom: -15px;
  width: 1px;
  background: var(--m-border);
}

.timeline-item:last-child .timeline-mark::before {
  display: none;
}

.timeline-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--item-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--item-color) 12%, transparent);
}

.timeline-copy b {
  display: block;
  color: var(--m-title);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

.timeline-copy em {
  display: block;
  margin-top: 3px;
  color: var(--m-muted);
  font-size: 11.5px;
  line-height: 1.3;
  font-style: normal;
}

.merch-search-row input,
.merch-form-card input,
.merch-form-card select,
.merch-form-card textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--m-border);
  border-radius: 14px;
  background: #fbfcff;
  color: var(--m-title);
  padding: 9px 12px;
  outline: none;
  font-size: 13px;
}

.merch-search-row button,
.merch-action-grid button,
.merch-progress-card button,
.merch-feedback-card button,
.merch-submit,
.merch-fixed-button,
.merch-bottom-tabs button {
  min-height: 40px;
  border-radius: 14px;
  background: var(--m-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.merch-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.merch-tabs::-webkit-scrollbar {
  display: none;
}

.merch-tabs button {
  height: 34px;
  padding: 0 14px;
  border-radius: 14px;
  background: #fff;
  color: var(--m-muted);
  border: 1px solid var(--m-border);
  font-size: 13px;
  font-weight: 600;
}

.merch-tabs button.active {
  background: #eaf3ff;
  color: var(--m-blue);
  border-color: #d8e9ff;
}

.merch-list-head {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.merch-filter-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.merch-filter-line span {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--m-border);
  color: var(--m-muted);
  font-size: 12px;
}

.merch-list-head .merch-search-row {
  margin-bottom: 0;
}

.merch-filter-btn {
  min-height: 40px;
  border-radius: 14px;
  background: var(--m-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.merch-order-card {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  text-align: left;
}

.merch-order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.merch-order-top h3,
.merch-progress-card h3,
.merch-vat-card h3,
.merch-feedback-card h3 {
  margin: 0;
  color: var(--m-title);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
}

.merch-order-grid {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #f8faff;
}

.merch-order-grid span,
.merch-info-card span,
.merch-blue-grid span {
  color: var(--m-muted);
  font-size: 12px;
}

.merch-order-grid b,
.merch-info-card b,
.merch-blue-grid b {
  display: block;
  margin-top: 3px;
  color: var(--m-title);
  font-size: 13px;
  font-weight: 600;
}

.merch-progress-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.merch-progress-row strong {
  color: var(--m-blue);
  font-size: 16px;
  text-align: right;
}

.merch-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf2fb;
}

.merch-progress i {
  display: block;
  height: 100%;
  background: var(--m-blue);
}

.merch-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.merch-tag.doing,
.merch-tag.ship,
.merch-tag.todo,
.merch-tag.vat {
  color: var(--m-blue);
  background: #eaf3ff;
}

.merch-tag.done {
  color: var(--m-success);
  background: #ecfdf3;
}

.merch-tag.risk {
  color: var(--m-danger);
  background: #fff0ef;
}

.merch-blue-card {
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: var(--m-blue);
  color: #fff;
  box-shadow: var(--m-shadow);
}

.merch-blue-card p,
.merch-blue-card span,
.merch-blue-card b {
  color: rgba(255, 255, 255, 0.88);
}

.merch-blue-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.merch-blue-top h2 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 20px;
}

.merch-blue-top span {
  font-size: 28px;
  font-weight: 700;
}

.merch-action-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.merch-action-grid button {
  min-height: 44px;
  font-size: 13px;
}

.merch-info-card,
.merch-overview-card {
  padding: 14px;
  margin-bottom: 12px;
}

.merch-overview-card p {
  margin-top: 10px;
}

.merch-bottom-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.merch-bottom-tabs button {
  background: #eaf3ff;
  color: var(--m-blue);
}

.merch-progress-card {
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 58px 78px;
  align-items: center;
  gap: 10px;
}

.merch-progress-card strong {
  color: var(--m-blue);
  font-size: 18px;
}

.merch-progress-card button,
.merch-feedback-card button {
  min-height: 36px;
  font-size: 13px;
}

.progress-record-page {
  padding: 0 0 24px;
}

.progress-order-summary,
.progress-record-list-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.progress-order-summary span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 6px;
}

.progress-order-summary strong {
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
  color: #111827;
}

.progress-order-summary p {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.progress-record-head,
.progress-record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-record-head {
  margin-bottom: 14px;
}

.progress-record-head h2 {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
  color: #111827;
}

.progress-record-head > span:not(.progress-record-status) {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}

.progress-record-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  text-align: left;
  border-top: 1px solid #edf1f7;
  background: transparent;
}

.progress-record-item:first-of-type {
  border-top: 0;
}

.progress-record-item svg {
  width: 18px;
  height: 18px;
  color: #9aa3b2;
}

.progress-record-top h3 {
  min-width: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  color: #111827;
}

.progress-record-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.progress-record-status.done {
  background: #e8f8ef;
  color: #16a34a;
}

.progress-record-status.doing {
  background: #eaf2ff;
  color: #1d64ff;
}

.progress-record-status.warn {
  background: #fff7e8;
  color: #f59e0b;
}

.progress-record-status.risk {
  background: #ffecec;
  color: #ef4444;
}

.progress-record-subtitle,
.progress-record-meta,
.progress-record-note {
  margin-top: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #6b7280;
}

.progress-record-qty {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  color: #111827;
}

.progress-record-detail-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px 12px;
  padding-top: 4px;
}

.progress-record-detail-grid span {
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
}

.progress-record-detail-grid strong {
  font-size: 16px;
  font-weight: 900;
  color: #111827;
}

.progress-record-remark {
  padding: 14px;
  border-radius: 14px;
  background: #f5f6f8;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.65;
  color: #374151;
}

.content.no-tab:has(.record-page) {
  padding: 0;
  background: #f5f6f8;
}

.record-page {
  min-height: 100vh;
  background: #f5f6f8;
  padding: 0 14px 120px;
  box-sizing: border-box;
}

.record-topbar {
  position: relative;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: env(safe-area-inset-top);
}

.record-topbar h1 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
  text-align: center;
}

.record-topbar .record-back-button {
  left: 0;
  top: calc(env(safe-area-inset-top) + 11px);
}

.record-summary-card,
.record-list-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.record-summary-card {
  min-height: 96px;
  box-sizing: border-box;
}

.record-summary-card span {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.record-summary-card strong {
  display: block;
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.record-summary-card p {
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.record-list-card {
  margin-top: 14px;
}

.record-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.record-section-title {
  margin: 0;
  color: #111827;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.record-count {
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.record-item {
  position: relative;
  width: 100%;
  display: block;
  padding: 15px 30px 15px 0;
  border-bottom: 1px solid #edf1f7;
  background: transparent;
  text-align: left;
}

.record-item:last-child {
  border-bottom: 0;
}

.record-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-title {
  min-width: 0;
  margin: 0;
  color: #111827;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
}

.record-time {
  margin-top: 6px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.record-subtitle {
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.record-quantity {
  margin-top: 10px;
}

.record-quantity p {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.5;
}

.record-meta {
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.record-arrow {
  position: absolute;
  right: 0;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-arrow svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.8;
}

.merch-vat-card {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 54px 1fr 36px;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.merch-product-card,
.merch-product-hero,
.merch-upload-card {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  background: var(--m-card);
  box-shadow: var(--m-shadow);
  text-align: left;
}

.merch-product-card h3,
.merch-product-hero h2,
.merch-upload-card h3 {
  margin: 0;
  color: var(--m-title);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
}

.merch-product-card p,
.merch-product-hero p,
.merch-upload-card p {
  margin: 4px 0 0;
  color: var(--m-muted);
  font-size: 13px;
}

.merch-product-image {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 16px;
  background: #edf4ff;
}

.merch-product-image.large {
  width: 92px;
  height: 92px;
  border-radius: 18px;
}

.merch-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merch-product-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--m-blue);
  font-size: 20px;
  font-weight: 700;
}

.merch-product-grid {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.merch-product-grid span {
  color: var(--m-muted);
  font-size: 12px;
}

.merch-product-grid b,
.merch-product-hero strong {
  color: var(--m-blue);
  font-size: 14px;
  font-weight: 700;
}

.merch-product-hero {
  grid-template-columns: 92px 1fr;
  margin-top: 0;
}

.merch-product-hero button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--m-blue);
  font-size: 12px;
  font-weight: 600;
}

.merch-product-hero span {
  display: block;
  margin-top: 3px;
  color: var(--m-muted);
  font-size: 12px;
}

.content:has(.product-search-page) {
  padding: 0 0 108px;
  background: #f5f7fb;
}

.product-search-page {
  min-height: 100%;
  background: #f5f7fb;
}

.product-search-hero {
  position: relative;
  overflow: hidden;
  padding: 24px 22px 28px;
  background: linear-gradient(135deg, #1269ff 0%, #1d64ff 56%, #35a7ff 100%);
  color: #fff;
}

.product-search-hero::before,
.product-search-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.product-search-hero::before {
  right: -96px;
  top: 56px;
  width: 340px;
  height: 150px;
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transform: rotate(-10deg);
}

.product-search-hero::after {
  right: -58px;
  bottom: -70px;
  width: 280px;
  height: 150px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  transform: rotate(-18deg);
}

.product-search-hero .page-title,
.product-search-hero .page-subtitle,
.product-search-bar {
  position: relative;
  z-index: 1;
}

.header-add-button {
  position: absolute;
  right: 20px;
  top: 28px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.product-search-hero .header-add-button,
.query-header .header-add-button {
  position: absolute;
  right: 20px;
  top: 28px;
  z-index: 3;
}

.page-back-button {
  position: absolute;
  left: 20px;
  top: 28px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.page-back-button svg,
.page-back-button .back-button-icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-back-button.light {
  color: #ffffff;
}

.page-back-button.dark {
  color: #111827;
}

.product-search-hero .page-title {
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 900;
}

.history-head {
  position: relative;
}

.product-search-hero .page-subtitle {
  margin: 16px 0 18px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.product-search-hero .page-subtitle svg {
  width: 16px;
  height: 16px;
}

.product-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 70px;
  gap: 8px;
  align-items: center;
}

.product-search-field {
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.product-search-field svg {
  width: 20px;
  height: 20px;
  color: #8b95a7;
}

.product-search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
}

.product-search-field input::placeholder {
  color: #9aa3b2;
}

.product-search-button,
.product-filter-button {
  height: 48px;
  min-width: 0;
  padding: 0 8px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.product-search-button {
  background: #1d64ff;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.product-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #fff;
  color: #1d64ff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.product-filter-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}

.product-search-panel {
  position: relative;
  z-index: 2;
  margin-top: -2px;
  padding: 18px 22px 28px;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  background: #f7f9fd;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.04);
}

.product-search-tabs {
  grid-auto-columns: minmax(74px, max-content);
  gap: 11px;
  margin-bottom: 20px;
}

.product-search-tabs button {
  height: 40px;
  min-width: 74px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.product-search-tabs button.active {
  background: linear-gradient(135deg, #1d4fff 0%, #1677ff 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 100, 255, 0.22);
}

.product-result-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-search-page .merch-product-card {
  position: relative;
  min-height: 150px;
  margin: 0;
  padding: 20px 44px 20px 16px;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.product-search-page .merch-product-card::after {
  content: "›";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b95a7;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

.product-search-page .merch-product-image {
  width: 96px;
  height: 100px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eaf3ff 0%, #f8fbff 100%);
}

.product-search-page .merch-product-placeholder {
  color: #1d64ff;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
}

.product-search-page .merch-order-top {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.product-search-page .merch-product-card h3 {
  color: #111827;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
}

.product-search-page .merch-tag {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: #eaf2ff;
  color: #1d64ff;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
}

.product-search-page .merch-product-card p {
  margin-top: 8px;
  color: #111827;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
}

.product-search-page .merch-product-grid {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
}

.product-search-page .merch-product-grid span {
  color: #7b8494;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
}

.product-search-page .merch-product-grid span + span::before {
  content: "·";
  margin: 0 8px;
  color: #9aa3b2;
}

.product-search-page .merch-product-grid b {
  flex-basis: 100%;
  margin-top: 4px;
  color: #1d64ff;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.content:has(.vat-search-page) {
  padding: 0 0 108px;
  background: #f5f7fb;
}

.vat-search-page {
  min-height: 100%;
  background: #f5f7fb;
}

.vat-search-hero {
  padding: 22px 22px 16px;
}

.vat-search-hero .page-title {
  font-size: 28px;
}

.vat-search-hero .page-subtitle {
  margin: 14px 0 16px;
}

.vat-search-bar {
  grid-template-columns: minmax(0, 1fr) 64px 72px;
}

.vat-search-bar .product-search-field {
  height: 46px;
  border-radius: 13px;
}

.vat-search-bar .product-search-button,
.vat-search-bar .product-filter-button {
  height: 46px;
  border-radius: 13px;
}

.vat-search-panel {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 18px 12px 26px;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  background: #f7f9fd;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.04);
}

.vat-search-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  margin-bottom: 14px;
}

.vat-search-tabs button {
  height: 40px;
  min-width: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.vat-search-tabs button.active {
  background: linear-gradient(135deg, #1d4fff 0%, #1677ff 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 100, 255, 0.22);
}

.vat-result-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.merch-history-list p,
.merch-log-list article {
  margin: 0;
  padding: 10px 0;
}

.merch-history-list p + p,
.merch-log-list article + article {
  border-top: 1px solid var(--m-border);
}

.merch-history-list p {
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--m-muted);
  font-size: 12px;
}

.merch-history-list b {
  color: var(--m-blue);
  font-size: 13px;
}

.merch-history-list em {
  color: var(--m-muted);
  font-style: normal;
  text-align: right;
}

.merch-log-list h3 {
  margin: 0 0 6px;
  color: var(--m-title);
  font-size: 14px;
}

.merch-log-list p {
  margin: 3px 0;
  color: var(--m-muted);
  font-size: 12px;
}

.merch-upload-card {
  grid-template-columns: 92px 1fr;
  margin-top: 0;
}

.merch-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.merch-upload-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--m-blue);
  font-size: 12px;
  font-weight: 600;
}

.merch-vat-card > span {
  color: var(--m-blue);
  font-size: 13px;
  font-weight: 600;
}

.merch-thumb {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #eef1f6;
  color: var(--m-muted);
  font-size: 13px;
}

.merch-fixed-button,
.merch-submit {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
}

.merch-feedback-stats {
  padding: 14px;
  margin-bottom: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.merch-feedback-stats span {
  color: var(--m-muted);
  font-size: 12px;
  text-align: center;
}

.merch-feedback-stats b {
  display: block;
  color: var(--m-blue);
  font-size: 20px;
  line-height: 1.1;
}

.merch-feedback-card {
  padding: 14px;
  margin-top: 12px;
}

.merch-feedback-card > p {
  margin-top: 10px;
  color: var(--m-text);
  font-size: 13px;
}

.merch-feedback-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}

.merch-feedback-meta span {
  color: var(--m-muted);
  font-size: 12px;
}

.merch-form-card {
  padding: 14px;
}

.merch-register-card,
.merch-profile-card {
  padding: 14px;
  margin-bottom: 12px;
  background: var(--m-card);
  border-radius: 20px;
  box-shadow: var(--m-shadow);
}

.merch-register-card {
  display: grid;
  gap: 10px;
}

.merch-register-card button {
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f7faff;
  text-align: left;
}

.merch-register-card b {
  display: block;
  color: var(--m-title);
  font-size: 15px;
  font-weight: 600;
}

.merch-register-card span {
  display: block;
  margin-top: 3px;
  color: var(--m-muted);
  font-size: 12px;
}

.merch-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merch-profile-card h2 {
  margin: 0;
  color: var(--m-title);
  font-size: 18px;
  font-weight: 600;
}

.merch-profile-card p {
  margin: 4px 0 0;
  color: var(--m-muted);
  font-size: 13px;
}

.merch-profile-card > span {
  min-height: 28px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--m-success);
  font-size: 12px;
  font-weight: 600;
}

.profile-message-card {
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: var(--m-card);
  box-shadow: var(--m-shadow);
}

.profile-message-card > h2 {
  margin: 0 0 16px;
  color: var(--m-title);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.profile-message-section + .profile-message-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #edf1f7;
}

.profile-message-section h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 900;
}

.profile-message-list {
  display: grid;
  gap: 8px;
}

.profile-message-item {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.profile-message-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.profile-message-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.6;
}

.profile-message-icon.blue {
  color: #2563eb;
  background: #eff6ff;
}

.profile-message-icon.green {
  color: #16a34a;
  background: #ecfdf5;
}

.profile-message-icon.red {
  color: #ef4444;
  background: #fef2f2;
}

.profile-message-icon.purple {
  color: #7c3aed;
  background: #f5f3ff;
}

.profile-message-copy {
  min-width: 0;
}

.profile-message-copy b {
  display: block;
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 900;
}

.profile-message-copy em {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.3;
  font-style: normal;
  font-weight: 700;
}

.profile-message-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

.profile-message-arrow {
  color: #8a94a6;
}

.profile-message-arrow svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.8;
}

.profile-logout-btn {
  width: 100%;
  height: 50px;
  margin: 4px 0 20px;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  color: #ef4444;
  box-shadow: var(--m-shadow);
  font-size: 16px;
  font-weight: 900;
}

.merch-form-card label {
  display: block;
  margin-bottom: 12px;
  color: var(--m-text);
  font-size: 13px;
  font-weight: 600;
}

.merch-form-card input,
.merch-form-card select,
.merch-form-card textarea {
  display: block;
  margin-top: 7px;
  font-weight: 400;
}

.merch-form-card textarea {
  min-height: 82px;
  resize: none;
}

@media (max-width: 520px) {
  .merch-page .merch-header,
  .merch-page .merch-section,
  .merch-page .merch-order-card,
  .merch-page .merch-info-card,
  .merch-page .merch-overview-card,
  .merch-page .merch-progress-card,
  .merch-page .merch-vat-card,
  .merch-page .merch-feedback-card,
  .merch-page .merch-form-card,
  .merch-page .merch-feedback-stats {
    border-radius: 20px;
  }

  .merch-action-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .merch-action-grid button {
    padding: 0;
  }
}

/* Mobile app login */
.login {
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  padding: env(safe-area-inset-top) 0 max(0px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  align-content: unset;
  justify-content: flex-start;
  gap: 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 21%, rgba(255, 255, 255, 0.92) 0 18%, rgba(247, 251, 255, 0) 46%),
    linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
}

.login svg {
  width: 1em;
  height: 1em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-ornament {
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(29, 100, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.login-ornament::before,
.login-ornament::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(29, 100, 255, 0.07);
  border-radius: inherit;
}

.login-ornament::after {
  inset: 28px;
}

.login-ornament-right {
  top: 118px;
  right: -172px;
}

.login-ornament-left {
  left: -188px;
  bottom: 104px;
}

.login-main {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 20px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.login-brand {
  margin-top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: 108px;
  height: 108px;
  display: block;
  object-fit: contain;
}

.login h1 {
  margin: 28px 0 0;
  color: #111827;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 800;
  text-align: center;
}

.login p {
  margin: 12px 0 0;
  max-width: none;
  color: #7b8494;
  font-size: 20px;
  line-height: 1.3;
  text-align: center;
}

.login-card {
  width: calc(100% - 48px);
  max-width: 380px;
  margin-top: 44px;
  padding: 28px 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 56px rgba(37, 99, 235, 0.10), 0 8px 24px rgba(15, 23, 42, 0.04);
  position: relative;
  z-index: 3;
}

.login-field {
  position: relative;
}

.login-field + .login-field {
  margin-top: 28px;
}

.login-field label {
  display: block;
  margin-bottom: 14px;
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 600;
}

.role-dropdown {
  position: relative;
}

.role-select,
.password-control {
  width: 100%;
  height: 58px;
  border: 1px solid #d8e1f0;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.role-select {
  padding: 0 18px;
  color: #111827;
  text-align: left;
}

.role-dropdown.open .role-select,
.role-select:focus-visible,
.password-control:focus-within {
  border-color: #1d64ff;
  box-shadow: 0 0 0 3px rgba(29, 100, 255, 0.10);
  outline: none;
}

.login-field-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-right: 18px;
  color: #1d64ff;
  display: grid;
  place-items: center;
  font-size: 28px;
}

.password-control .login-field-icon {
  color: #8b95a7;
  font-size: 26px;
  margin-left: 18px;
  margin-right: 16px;
}

.role-select strong {
  flex: 1;
  min-width: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

.role-arrow {
  flex: 0 0 auto;
  color: #111827;
  font-size: 26px;
  transition: transform 160ms var(--ease);
}

.role-dropdown.open .role-arrow {
  transform: rotate(180deg);
}

.role-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.13);
  z-index: 10;
}

.role-menu button {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  background: transparent;
  color: #374151;
  text-align: left;
  font-size: 17px;
  font-weight: 600;
}

.role-menu button.selected {
  background: #eef5ff;
  color: #1d64ff;
}

.password-control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: #111827;
  font-size: 18px;
}

.password-control input::placeholder {
  color: #a8b0bf;
}

.password-eye {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-right: 8px;
  border-radius: 12px;
  background: transparent;
  color: #8b95a7;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.login-options {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.remember-role,
.forgot-password {
  min-height: 30px;
  padding: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  font-weight: 500;
}

.remember-role {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #6b7280;
}

.remember-role span {
  width: 22px;
  height: 22px;
  border: 1px solid #c7d1e1;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}

.remember-role span.checked {
  border-color: #1d64ff;
  background: linear-gradient(135deg, #1d4fff 0%, #1677ff 100%);
  box-shadow: 0 6px 14px rgba(29, 100, 255, 0.24);
}

.forgot-password {
  color: #1d64ff;
}

.login-submit {
  width: 100%;
  height: 58px;
  margin-top: 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4fff 0%, #1677ff 100%);
  color: #fff;
  box-shadow: 0 13px 24px rgba(29, 79, 255, 0.28);
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.login-footer {
  flex-shrink: 0;
  width: 100%;
  height: 48px;
  margin-top: 0;
  padding: 0 16px;
  color: #8b95a7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 13px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.login-footer svg {
  width: 17px;
  height: 17px;
}

.login-footer i {
  width: 1px;
  height: 14px;
  background: #8b95a7;
  opacity: 0.65;
}

@media (max-width: 390px) {
  .login h1 {
    font-size: 38px;
  }

  .login p {
    font-size: 19px;
  }

  .login-card {
    width: calc(100% - 32px);
    padding: 24px 18px;
  }
}

@media (max-height: 760px) {
  .login-main {
    padding-top: 10px;
  }

  .login h1 {
    margin-top: 22px;
    font-size: 34px;
  }

  .login p {
    margin-top: 10px;
    font-size: 18px;
  }

  .login-card {
    margin-top: 32px;
    padding: 24px 22px;
  }

  .login-field + .login-field {
    margin-top: 24px;
  }

  .login-field label {
    margin-bottom: 12px;
    font-size: 17px;
  }

  .role-select,
  .password-control {
    height: 56px;
  }

  .login-options {
    margin-top: 18px;
  }

  .login-submit {
    height: 56px;
    margin-top: 24px;
    font-size: 23px;
  }

  .login-footer {
    height: 42px;
  }
}

/* Clerk home and history pages */
.content:has(.clerk-dashboard),
.content:has(.history-page),
.content:has(.clerk-form-page) {
  padding: 24px 24px 110px;
  background: #f5f6f8;
  overflow-x: hidden;
}

.clerk-dashboard,
.history-page,
.clerk-form-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  color: #111827;
}

.clerk-home-head h1,
.history-head h1 {
  margin: 0;
  color: #111827;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
}

.clerk-home-head .date-line,
.history-head p {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
}

.clerk-home-head .date-line svg,
.history-head p svg {
  width: 18px;
  height: 18px;
}

.clerk-section-card {
  margin-top: 14px;
  padding: 18px 16px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.clerk-todo-panel {
  padding: 14px;
}

.clerk-todo-panel .clerk-section-title {
  margin-bottom: 10px;
}

.clerk-section-title {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.clerk-section-title h2 {
  margin: 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.15;
  font-weight: 800;
}

.clerk-section-title .section-link,
.clerk-section-title button {
  min-height: 24px;
  background: transparent;
  color: #1d64ff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

.clerk-section-title button svg {
  width: 15px;
  height: 15px;
}

.clerk-todo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.clerk-todo-card {
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid #e5eaf3;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.clerk-todo-card .todo-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--item-color) 12%, #fff);
  color: var(--item-color);
  flex: 0 0 auto;
}

.clerk-todo-card .todo-icon svg {
  width: 20px;
  height: 20px;
}

.clerk-todo-card b {
  display: block;
  color: #111827;
  font-size: 13.5px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
}

.clerk-todo-card .todo-copy {
  min-width: 0;
}

.clerk-todo-card strong {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 2px;
  color: var(--item-color);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.clerk-todo-card em {
  color: #6b7280;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.clerk-query-grid,
.clerk-add-grid {
  display: grid;
  gap: 10px;
}

.clerk-query-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clerk-add-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clerk-query-grid button,
.clerk-add-grid button {
  border: 1px solid #e5eaf3;
  border-radius: 16px;
  background: #fff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
}

.clerk-query-grid button {
  height: 62px;
  flex-direction: column;
  font-size: 14px;
}

.clerk-add-grid button {
  height: 62px;
  gap: 8px;
  font-size: 15px;
}

.clerk-query-grid span,
.clerk-add-grid span {
  color: var(--item-color);
  display: grid;
  place-items: center;
}

.clerk-query-grid span svg,
.clerk-add-grid span svg {
  width: 22px;
  height: 22px;
}

.clerk-timeline {
  display: grid;
  gap: 14px;
}

.clerk-timeline .timeline-item {
  min-height: 28px;
  grid-template-columns: 48px 18px 1fr;
  gap: 8px;
}

.clerk-timeline .timeline-item time {
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}

.clerk-timeline .timeline-mark {
  width: 18px;
  height: 28px;
}

.clerk-timeline .timeline-mark::before {
  left: 8px;
  top: 19px;
}

.clerk-timeline .timeline-mark::after {
  left: 4.5px;
  top: 9px;
  width: 9px;
  height: 9px;
}

.clerk-timeline .timeline-copy b {
  color: #111827;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
}

.history-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 0 16px;
  scrollbar-width: none;
}

.history-tabs::-webkit-scrollbar {
  display: none;
}

.history-tab {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px solid #e5eaf3;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.history-tab.active {
  border-color: transparent;
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  color: #fff;
  box-shadow: 0 12px 28px rgba(29, 100, 255, 0.18);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  width: 100%;
  min-height: 94px;
  padding: 14px 16px;
  border: 1px solid #e5eaf3;
  border-radius: 18px;
  background: #fff;
  display: grid;
  grid-template-columns: 52px 28px 1fr 18px;
  align-items: center;
  text-align: left;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.history-time {
  color: #111827;
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
}

.history-line {
  width: 16px;
  align-self: stretch;
  position: relative;
}

.history-line::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 30px;
  bottom: 0;
  width: 1px;
  background: #e5eaf3;
}

.history-line::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 21px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--history-color);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--history-color) 12%, transparent);
}

.history-item:last-child .history-line::before {
  display: none;
}

.history-item.blue {
  --history-color: #2563eb;
}

.history-item.green {
  --history-color: #16a34a;
}

.history-item.purple {
  --history-color: #8b5cf6;
}

.history-item.red {
  --history-color: #ef4444;
}

.history-main {
  min-width: 0;
}

.history-type {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--history-color);
  background: color-mix(in srgb, var(--history-color) 12%, #fff);
  font-size: 13px;
  line-height: 26px;
  font-weight: 700;
}

.history-type i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--history-color);
  font-style: normal;
}

.history-type i svg {
  width: 18px;
  height: 18px;
}

.history-code {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 800;
}

.history-content {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.25;
}

.history-arrow {
  color: #6b7280;
  font-size: 22px;
}

.history-arrow svg {
  width: 22px;
  height: 22px;
}

/* Recent activity page */
.content:has(.recent-activities-page) {
  padding: 14px 24px 110px;
  background: #f5f6f8;
  overflow-x: hidden;
}

.recent-activities-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  color: #111827;
}

.recent-head p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}

.recent-tabs {
  margin: 18px -2px 14px;
  padding: 0 2px 2px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.recent-tabs::-webkit-scrollbar {
  display: none;
}

.recent-tab {
  flex: 0 0 auto;
  min-width: 72px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid #e0e6ef;
  border-radius: 22px;
  background: #fff;
  color: #111827;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
}

.recent-tab.active {
  border-color: transparent;
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 100, 255, 0.2);
}

.recent-list {
  display: grid;
  gap: 14px;
}

.recent-item {
  --recent-color: #1d64ff;
  min-height: 118px;
  width: 100%;
  padding: 18px 16px;
  border: 0;
  border-radius: 24px;
  display: grid;
  grid-template-columns: 58px 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  background: #fff;
  text-align: left;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.recent-item.dye {
  --recent-color: #8b5cf6;
}

.recent-item.arrival {
  --recent-color: #16a34a;
}

.recent-item.shipping {
  --recent-color: #1d64ff;
}

.recent-item.exception {
  --recent-color: #ef4444;
}

.recent-time {
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}

.recent-line {
  height: 82px;
  position: relative;
}

.recent-line::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: #e5eaf3;
}

.recent-line::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 18px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--recent-color);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--recent-color) 14%, transparent);
}

.recent-item:last-child .recent-line::before {
  display: none;
}

.recent-main {
  min-width: 0;
}

.recent-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.recent-title-row strong {
  min-width: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-type-badge {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}

.activity-type-badge.dye {
  background: #f1eaff;
  color: #8b5cf6;
}

.activity-type-badge.arrival {
  background: #e8f8ef;
  color: #16a34a;
}

.activity-type-badge.shipping {
  background: #eaf2ff;
  color: #1d64ff;
}

.activity-type-badge.exception {
  background: #ffecec;
  color: #ef4444;
}

.recent-action {
  display: block;
  margin-top: 9px;
  color: var(--recent-color);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 800;
}

.recent-operator {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.recent-operator svg {
  width: 16px;
  height: 16px;
  color: #9aa3b2;
}

.recent-arrow {
  color: rgba(107, 114, 128, 0.62);
}

.recent-arrow svg {
  width: 20px;
  height: 20px;
}

.recent-empty {
  margin-top: 80px;
  text-align: center;
  color: #9aa3b2;
  font-size: 15px;
}

.status-badge.dye {
  border: 0;
  border-radius: 10px;
  background: #f1eaff;
  color: #8b5cf6;
}

.status-badge.shipping {
  border: 0;
  border-radius: 10px;
  background: #eaf2ff;
  color: #1d64ff;
}

.status-badge.exception {
  border: 0;
  border-radius: 10px;
  background: #ffecec;
  color: #ef4444;
}

.bottom-bar {
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(calc(100% - 56px), 380px);
  height: 72px;
  padding: 6px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.nav-btn {
  min-height: 60px;
  border-radius: 22px;
  font-size: 12px;
  color: #6b7280;
}

.nav-btn.active {
  color: #1d64ff;
  background: #eaf2ff;
}

.nav-btn b svg {
  width: 24px;
  height: 24px;
}

.clerk-form-page .merch-form-card {
  margin-top: 28px;
  padding: 22px;
  border-radius: 24px;
}

.clerk-form-page .merch-submit {
  min-height: 58px;
  margin-top: 18px;
  border-radius: 18px;
  font-size: 20px;
}

.content.no-tab:has(.order-create-page) {
  padding: 16px 16px 112px;
  background: #f5f6f8;
  overflow-x: hidden;
}

.order-create-page {
  padding-bottom: 24px;
}

.order-create-subtitle {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
}

.order-create-subtitle svg {
  width: 18px;
  height: 18px;
  color: #1d64ff;
}

.order-form-card {
  margin-top: 14px;
  padding: 20px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.order-form-card:first-of-type {
  margin-top: 0;
}

.order-form-card h2 {
  margin: 0 0 18px;
  color: #111827;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 900;
}

.order-form-card label {
  display: block;
  margin-top: 14px;
  color: #374151;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}

.order-form-card label:first-of-type {
  margin-top: 0;
}

.order-form-card input,
.order-form-card select,
.order-form-card textarea {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  outline: 0;
  background: #f3f6fb;
  color: #111827;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(216, 225, 240, 0.72);
}

.order-form-card input:focus,
.order-form-card select:focus,
.order-form-card textarea:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #1d64ff;
}

.order-form-card textarea {
  height: 96px;
  min-height: 96px;
  padding: 12px 14px;
  resize: none;
}

.order-form-card input::placeholder,
.order-form-card textarea::placeholder {
  color: #a8b0bf;
  font-weight: 600;
}

.combined-field {
  margin-top: 16px;
}

.field-label {
  margin-bottom: 10px;
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 12px;
  align-items: end;
}

.input-box,
.select-box {
  height: 48px;
  border-radius: 16px;
  border: 1px solid #dbe3f0;
  background: #f7f9fc;
  padding: 0 14px;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}

.select-box {
  min-width: 0;
}

@media (max-width: 360px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.system-fields {
  margin-top: 16px;
  padding: 12px;
  border-radius: 16px;
  display: grid;
  gap: 10px;
  background: #f7faff;
}

.system-fields span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.system-fields em {
  color: #6b7280;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.system-fields strong {
  min-width: 0;
  color: #111827;
  font-size: 14px;
  text-align: right;
  font-weight: 900;
}

.order-items-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.order-info-card {
  margin-top: 0;
}

.order-info-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.order-info-card-head h2 {
  margin: 0;
}

.order-item-remove {
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: #fff1f2;
  color: #ef4444;
  font-size: 13px;
  font-weight: 900;
}

.order-info-row {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.order-info-row:first-of-type {
  margin-top: 0;
}

.order-info-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-info-row.quantity-unit-row {
  grid-template-columns: 1.85fr 1fr;
}

.order-info-row label,
.order-info-card .order-item-remark {
  min-width: 0;
  margin-top: 0;
}

.order-info-card .order-item-remark {
  margin-top: 14px;
}

.order-add-item-card {
  width: 100%;
  min-height: 58px;
  margin-top: 14px;
  border-radius: 22px;
  background: #fff;
  color: #1d64ff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.order-add-item-card span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px dashed rgba(29, 100, 255, 0.55);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.order-add-item-card strong {
  font-size: 16px;
  font-weight: 900;
}

.submit-bar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 20;
  width: min(calc(100% - 32px), 398px);
  transform: translateX(-50%);
}

.submit-button {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  background: #1d64ff;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(29, 100, 255, 0.22);
}

.order-search-card {
  margin-top: 18px;
  height: 58px;
  padding: 0 16px;
  border-radius: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.order-search-icon {
  width: 24px;
  height: 24px;
  color: #8b95a7;
  display: grid;
  place-items: center;
}

.order-search-icon svg {
  width: 22px;
  height: 22px;
}

.order-search-card input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 16px;
  font-weight: 600;
}

.order-search-card input::placeholder {
  color: #a8b0bf;
}

.content:has(.order-list-page) {
  padding: 16px 16px 112px;
  background: #f5f6f8;
  overflow-x: hidden;
}

.order-list-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  color: #111827;
}

.order-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 72px;
  gap: 10px;
  margin-top: 4px;
}

.order-search-input {
  min-width: 0;
  height: 48px;
  border-radius: 18px;
  border: 1px solid #dbe3ef;
  background: #fff;
  padding: 0 16px;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  outline: 0;
}

.order-search-input::placeholder {
  color: #a8b0bf;
  font-weight: 600;
}

.order-search-button,
.order-filter-button {
  height: 48px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 800;
}

.order-search-button {
  border: 0;
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  color: #fff;
}

.order-filter-button {
  position: relative;
  border: 1px solid #1d64ff;
  background: #fff;
  color: #1d64ff;
}

.order-filter-button.has-filter::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1d64ff;
}

.order-status-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-top: 18px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.order-status-tabs::-webkit-scrollbar {
  display: none;
}

.order-status-tab {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px solid #e5eaf3;
  background: #fff;
  color: #6b7280;
  font-size: 15px;
  font-weight: 700;
}

.order-status-tab.active {
  border-color: transparent;
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  color: #fff;
}

.order-card-list {
  margin-top: 4px;
}

.order-card {
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  text-align: left;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.order-code {
  display: block;
  color: #111827;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
}

.order-customer {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.3;
  font-style: normal;
  font-weight: 700;
}

.order-status-badge {
  flex-shrink: 0;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}

.badge-blue {
  background: #eaf2ff;
  color: #1d64ff;
}

.badge-orange {
  background: #fff4e5;
  color: #f59e0b;
}

.badge-purple {
  background: #f1eaff;
  color: #8b5cf6;
}

.badge-green {
  background: #e8f8ef;
  color: #16a34a;
}

.badge-red {
  background: #ffecec;
  color: #ef4444;
}

.order-info-box {
  display: block;
  margin-top: 16px;
  border-radius: 18px;
  background: #f7f9fc;
  padding: 14px 16px;
}

.order-main-info {
  display: block;
  color: #111827;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
}

.order-sub-info {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.order-progress-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #eaf0f8;
  overflow: hidden;
}

.order-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d4fff, #1677ff);
}

.order-progress-text {
  width: 46px;
  text-align: right;
  color: #1d64ff;
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
}

.filter-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
}

.filter-sheet {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(100%, 430px);
  height: 82vh;
  max-height: 85vh;
  min-height: 75vh;
  padding: 12px 20px 112px;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  background: #fff;
  z-index: 60;
  overflow-y: auto;
  transform: translateX(-50%);
}

.filter-drag-bar {
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: #d1d5db;
  margin: 0 auto 18px;
}

.filter-header {
  position: relative;
  text-align: center;
  margin-bottom: 24px;
}

.filter-title {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
}

.filter-close {
  position: absolute;
  right: 0;
  top: -4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f6fb;
  color: #111827;
  font-size: 24px;
  line-height: 1;
}

.filter-section {
  margin-top: 26px;
}

.filter-section-title {
  margin: 0 0 14px;
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
}

.filter-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-option {
  height: 44px;
  min-width: 72px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid #e5eaf3;
  background: #fff;
  color: #374151;
  font-size: 15px;
  font-weight: 700;
}

.filter-option.active {
  border-color: #1d64ff;
  background: #eaf2ff;
  color: #1d64ff;
}

.filter-date-range {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  gap: 8px;
  align-items: center;
  color: #6b7280;
}

.filter-date-range input {
  height: 42px;
  border-radius: 14px;
  border: 1px solid #e5eaf3;
  padding: 0 10px;
  background: #f7f9fc;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.filter-search-input {
  width: 100%;
  height: 46px;
  border-radius: 16px;
  border: 0;
  background: #f3f6fb;
  padding: 0 14px;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 0;
  outline: 0;
}

.filter-range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.filter-list-item {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e5eaf3;
  color: #374151;
  font-size: 15px;
  font-weight: 700;
}

.filter-list-item.active {
  border-color: #1d64ff;
  background: #eaf2ff;
  color: #1d64ff;
}

.filter-actions {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(100%, 430px);
  padding: 12px 20px calc(18px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #fff;
  z-index: 70;
  transform: translateX(-50%);
}

.filter-reset-button,
.filter-confirm-button {
  height: 52px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 900;
}

.filter-reset-button {
  background: #f3f4f6;
  color: #374151;
}

.filter-confirm-button {
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  color: #fff;
}

.product-filter-button.has-filter {
  background: #eaf2ff;
  color: #1d64ff;
  box-shadow: inset 0 0 0 1px #1d64ff;
}

.product-filter-button.has-filter::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a3c;
}

.order-home-card {
  margin-top: 16px;
}

.order-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-action-grid button {
  min-height: 86px;
  border-radius: 18px;
  background: #f7faff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px #e3eaf5;
}

.order-action-grid span {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #eaf2ff;
  color: #1d64ff;
}

.order-action-grid svg {
  width: 24px;
  height: 24px;
}

.order-update-list {
  display: grid;
  gap: 10px;
}

.order-update-item {
  width: 100%;
  min-height: 72px;
  padding: 14px;
  border-radius: 16px;
  background: #f7faff;
  color: #111827;
  text-align: left;
  box-shadow: inset 0 0 0 1px #e3eaf5;
}

.order-update-item strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.order-update-item span {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

/* Alipay-inspired clerk home */
.content:has(.alipay-home) {
  padding: 0 0 118px;
  background: #f5f6f8;
  overflow-x: hidden;
}

.alipay-home {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #f5f6f8;
  padding-bottom: 4px;
}

.home-header {
  position: relative;
  margin: 0;
  min-height: 240px;
  padding: 30px 24px 72px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #1677ff 0%, #1d64ff 55%, #3aa0ff 100%);
  border-bottom-left-radius: 34px;
  border-bottom-right-radius: 34px;
  color: #fff;
  overflow: hidden;
}

.home-header::before {
  content: "";
  position: absolute;
  inset: -40% -12% auto 20%;
  height: 180px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  transform: rotate(-12deg);
}

.home-header::after {
  content: "";
  position: absolute;
  right: 36px;
  top: 120px;
  width: 72px;
  height: 72px;
  opacity: 0.16;
  background-image: radial-gradient(circle, #fff 2px, transparent 3px);
  background-size: 18px 18px;
}

.home-header-glow {
  position: absolute;
  inset: auto -60px -80px auto;
  width: 220px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  filter: blur(2px);
  pointer-events: none;
}

.home-title {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 800;
}

.home-date {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
}

.home-date svg {
  width: 20px;
  height: 20px;
}

.home-summary {
  position: relative;
  z-index: 1;
  margin: 20px 0 18px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
}

.home-summary strong {
  color: #ffe66d;
  font-size: 26px;
  font-weight: 900;
}

.home-content {
  position: relative;
  z-index: 2;
  padding: 0 16px;
}

.quick-panel,
.todo-section,
.activity-section {
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.quick-panel {
  position: relative;
  z-index: 3;
  margin: -52px 0 0;
  padding: 24px 20px 28px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09);
}

.quick-panel .panel-header {
  margin-bottom: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.panel-edit,
.panel-link {
  min-height: 26px;
  background: transparent;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
}

.panel-link {
  color: #1d64ff;
}

.panel-link svg {
  width: 15px;
  height: 15px;
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.function-item {
  min-width: 0;
  background: transparent;
  color: #111827;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
}

.function-item b {
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.function-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--item-color);
}

.function-icon-wrap.order,
.function-icon-wrap.blue {
  background: #eaf2ff;
}

.function-icon-wrap.dye,
.function-icon-wrap.purple {
  background: #f1eaff;
}

.function-icon-wrap.product,
.function-icon-wrap.green {
  background: #e8f8ef;
}

.function-icon-wrap.inventory {
  background: #e6f8fb;
}

.function-icon-wrap svg {
  width: 31px;
  height: 31px;
}

.todo-section,
.activity-section {
  margin-top: 18px;
  padding: 20px 20px;
}

.todo-section {
  padding: 20px 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.todo-item {
  min-height: 72px;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.todo-item.blue {
  background: linear-gradient(135deg, #f0f6ff 0%, #f8fbff 100%);
}

.todo-item.purple {
  background: linear-gradient(135deg, #f5efff 0%, #fbf8ff 100%);
}

.todo-item.green {
  background: linear-gradient(135deg, #effaf3 0%, #f9fffb 100%);
}

.todo-item.red {
  background: linear-gradient(135deg, #fff1f1 0%, #fffafa 100%);
}

.todo-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--item-color);
}

.todo-icon-wrap.blue {
  background: rgba(29, 100, 255, 0.1);
}

.todo-icon-wrap.purple {
  background: rgba(139, 92, 246, 0.12);
}

.todo-icon-wrap.green {
  background: rgba(22, 163, 74, 0.12);
}

.todo-icon-wrap.red {
  background: rgba(239, 68, 68, 0.12);
}

.todo-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.todo-content {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}

.todo-label {
  display: block;
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
}

.todo-count-row {
  margin-top: 5px;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.todo-number {
  display: inline-block;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.todo-number.blue {
  color: #1d64ff;
}

.todo-number.purple {
  color: #8b5cf6;
}

.todo-number.green {
  color: #16a34a;
}

.todo-number.red {
  color: #ef4444;
}

.todo-unit {
  color: #6b7280;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.todo-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: rgba(107, 114, 128, 0.45);
  transform: translateY(-50%);
}

.todo-arrow svg {
  width: 16px;
  height: 16px;
}

.activity-list {
  display: grid;
}

.activity-item {
  width: 100%;
  min-height: 68px;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background: transparent;
  text-align: left;
}

.activity-item + .activity-item {
  border-top: 1px solid #eef2f7;
}

.activity-time {
  width: 62px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf2ff;
  color: #1d64ff;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}

.activity-dot {
  display: none;
}

.activity-title {
  display: block;
  color: #111827;
  font-size: 17px;
  line-height: 1.28;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-desc {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.4;
}

.screen:has(.alipay-home) .bottom-bar {
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(calc(100% - 48px), 382px);
  height: 78px;
  padding: 8px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(14px);
}

.screen:has(.alipay-home) .nav-btn {
  min-height: 62px;
  border-radius: 24px;
  gap: 4px;
  font-size: 13px;
}

.screen:has(.alipay-home) .nav-btn b svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 400px) {
  .content:has(.alipay-home) {
    padding: 0 0 112px;
  }

  .home-header {
    min-height: 232px;
    padding: 28px 18px 70px;
  }

  .home-title {
    font-size: 30px;
  }

  .home-date {
    font-size: 16px;
  }

  .home-summary {
    margin-top: 16px;
    margin-bottom: 18px;
    font-size: 18px;
  }

  .home-summary strong {
    font-size: 22px;
  }

  .home-content {
    padding-inline: 14px;
  }

  .quick-panel,
  .todo-section,
  .activity-section {
    border-radius: 22px;
  }

  .quick-panel {
    margin-top: -46px;
    padding: 22px 18px 26px;
  }

  .function-grid {
    gap: 10px;
  }

  .function-icon-wrap {
    width: 60px;
    height: 60px;
  }

  .function-item {
    gap: 10px;
    font-size: 15px;
  }

  .function-icon-wrap svg {
    width: 28px;
    height: 28px;
  }

  .todo-item {
    min-height: 70px;
    padding: 12px;
    gap: 10px;
  }

  .todo-icon-wrap {
    width: 44px;
    height: 44px;
  }

  .todo-label {
    font-size: 13.5px;
  }

  .todo-number {
    font-size: 24px;
  }

  .activity-item {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
  }

  .activity-time {
    width: 60px;
  }
}

@media (max-width: 400px) {
  .content:has(.clerk-dashboard),
  .content:has(.history-page),
  .content:has(.clerk-form-page) {
    padding: 22px 18px 106px;
  }

  .clerk-home-head h1,
  .history-head h1 {
    font-size: 27px;
  }

  .clerk-section-card {
    padding: 16px 14px;
  }

  .clerk-todo-card {
    padding: 9px 10px;
    gap: 8px;
  }

  .clerk-todo-card .todo-icon {
    width: 36px;
    height: 36px;
  }

  .clerk-todo-card b,
  .clerk-query-grid button {
    font-size: 13px;
  }

  .clerk-todo-card strong {
    font-size: 22px;
  }

  .clerk-add-grid button {
    font-size: 14px;
  }

  .history-item {
    grid-template-columns: 48px 24px 1fr 18px;
    padding: 13px 14px;
  }

  .content:has(.recent-activities-page) {
    padding: 14px 18px 106px;
  }

  .recent-tab {
    min-width: 68px;
    padding-inline: 16px;
    font-size: 15px;
  }

  .recent-item {
    grid-template-columns: 50px 20px minmax(0, 1fr) 16px;
    padding: 16px 14px;
    gap: 8px;
  }

  .recent-time {
    font-size: 16px;
  }

  .recent-title-row strong {
    font-size: 17px;
  }

  .recent-action {
    font-size: 15px;
  }
}

/* Compact app density for all non-login work pages */
.content:not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)) {
  padding: 14px 14px 104px;
  overflow-x: hidden;
}

.content.no-tab:not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)) {
  padding-bottom: 24px;
}

.topbar {
  min-height: 52px;
  padding: 8px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right));
  grid-template-columns: 44px 1fr 44px;
}

.topbar h2 {
  font-size: 17px;
  font-weight: 800;
}

.icon-btn {
  width: 36px;
  height: 36px;
  font-size: 21px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.topbar .back-button {
  width: 40px;
  height: 40px;
}

.hero {
  padding: 16px;
  border-radius: 20px;
}

.hero .meta {
  font-size: 13px;
}

.hero h1 {
  margin: 5px 0 12px;
  font-size: 25px;
}

.hero-row,
.kpi-grid,
.menu-grid,
.detail-grid,
.actions {
  gap: 8px;
}

.hero-pill {
  min-height: 54px;
  padding: 9px 10px;
  border-radius: 16px;
}

.hero-pill b {
  font-size: 22px;
}

.hero-pill span {
  margin-top: 3px;
  font-size: 12px;
}

.section-title {
  margin: 14px 2px 8px;
  align-items: center;
}

.section-title h3 {
  font-size: 20px;
}

.section-title span {
  font-size: 12px;
}

.kpi,
.menu-item,
.card,
.form-card,
.timeline,
.empty-state {
  border-radius: 18px;
}

.kpi {
  min-height: 64px;
  padding: 12px;
}

.kpi strong {
  margin-bottom: 4px;
  font-size: 28px;
}

.kpi span {
  font-size: 13px;
}

.menu-item {
  min-height: 64px;
  padding: 12px;
}

.menu-item b {
  margin-bottom: 3px;
  font-size: 16px;
}

.menu-item span {
  font-size: 12px;
}

.tabs {
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.tab {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 17px;
  font-size: 13px;
}

.card {
  margin-bottom: 8px;
  padding: 14px;
}

.card h3 {
  font-size: 17px;
}

.card p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.tag {
  min-height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.detail-item {
  min-height: 64px;
  padding: 12px;
  border-radius: 16px;
}

.detail-item span {
  margin-bottom: 5px;
  font-size: 12px;
}

.detail-item b {
  font-size: 15px;
}

.progress {
  height: 8px;
  margin-top: 14px;
}

.timeline {
  padding: 4px 12px;
}

.timeline li {
  padding: 10px 0;
  font-size: 13px;
}

.timeline b {
  margin-bottom: 4px;
  font-size: 14px;
}

.form-card {
  padding: 14px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  margin-bottom: 6px;
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
.search-row input {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
}

.field textarea {
  min-height: 86px;
}

.role-btn,
.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 44px;
  border-radius: 14px;
  font-size: 15px;
}

.actions {
  margin-top: 12px;
}

.search-row {
  grid-template-columns: 1fr 76px;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row .primary-btn {
  min-width: 76px;
}

.empty-state {
  padding: 16px;
}

.empty-state p {
  margin-bottom: 12px;
  font-size: 13px;
}

.toast {
  bottom: 94px;
  padding: 10px 14px;
  font-size: 13px;
}

.merch-page {
  font-size: 14px;
}

.merch-page .merch-header,
.merch-page .merch-section,
.merch-page .merch-order-card,
.merch-page .merch-info-card,
.merch-page .merch-overview-card,
.merch-page .merch-progress-card,
.merch-page .merch-vat-card,
.merch-page .merch-feedback-card,
.merch-page .merch-form-card,
.merch-page .merch-feedback-stats,
.merch-product-card,
.merch-product-hero,
.merch-upload-card,
.merch-register-card,
.merch-profile-card {
  border-radius: 18px;
}

.merch-header {
  min-height: 60px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.merch-header h1 {
  font-size: 16px;
}

.merch-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  font-size: 16px;
}

.merch-home-head {
  min-height: 56px;
  padding-inline: 2px;
}

.merch-home-head h1 {
  font-size: 22px;
}

.merch-home-head p {
  font-size: 13px;
}

.merch-section {
  padding: 14px;
  margin-bottom: 10px;
}

.home-card {
  border-radius: 20px;
  padding: 10px;
}

.merch-section-title {
  margin-bottom: 10px;
}

.merch-section-title h2 {
  font-size: 16px;
}

.section-link {
  font-size: 13px;
}

.merch-todo-grid,
.merch-action-grid,
.merch-query-grid,
.merch-quick-grid,
.merch-blue-grid,
.merch-order-grid,
.merch-info-card,
.merch-feedback-stats {
  gap: 8px;
}

.merch-order-card,
.merch-feedback-card,
.merch-info-card,
.merch-overview-card,
.merch-progress-card,
.merch-form-card {
  padding: 12px;
  margin-bottom: 10px;
}

.merch-order-top {
  gap: 8px;
}

.merch-order-grid {
  margin-top: 9px;
  padding: 10px;
  border-radius: 14px;
}

.merch-blue-card {
  padding: 14px;
  border-radius: 18px;
}

.merch-blue-top {
  margin-bottom: 10px;
}

.merch-blue-top h2 {
  font-size: 18px;
}

.merch-blue-top span {
  font-size: 24px;
}

.merch-action-grid {
  gap: 7px;
}

.merch-action-grid button,
.merch-progress-card button,
.merch-feedback-card button,
.merch-submit,
.merch-fixed-button,
.merch-bottom-tabs button {
  min-height: 40px;
  border-radius: 13px;
  font-size: 13px;
}

.merch-progress-card {
  grid-template-columns: 1fr 50px 70px;
  gap: 8px;
}

.merch-vat-card {
  margin-top: 10px;
  padding: 10px;
  grid-template-columns: 48px 1fr 30px;
  gap: 10px;
}

.merch-thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.merch-product-card,
.merch-product-hero,
.merch-upload-card {
  margin-top: 10px;
  padding: 10px;
  grid-template-columns: 64px 1fr;
  gap: 10px;
}

.merch-product-image {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.merch-product-image.large {
  width: 82px;
  height: 82px;
  border-radius: 16px;
}

.merch-product-hero,
.merch-upload-card {
  grid-template-columns: 82px 1fr;
}

.merch-product-grid {
  grid-template-columns: repeat(2, max-content);
  gap: 6px 10px;
}

.merch-register-card,
.merch-profile-card {
  padding: 12px;
  margin-bottom: 10px;
}

.merch-register-card button {
  min-height: 52px;
  padding: 10px 12px;
}

.merch-form-card label {
  margin-bottom: 10px;
  font-size: 12.5px;
}

.merch-form-card input,
.merch-form-card select,
.merch-form-card textarea {
  min-height: 40px;
  margin-top: 6px;
  font-size: 13px;
}

@media (max-width: 400px) {
  .content:not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)) {
    padding: 12px 12px 100px;
  }

  .hero h1 {
    font-size: 23px;
  }

  .section-title h3 {
    font-size: 19px;
  }

  .menu-item b,
  .card h3 {
    font-size: 16px;
  }
}

/* Arrival confirmation list */
.screen:has(.arrival-page) {
  background: #f5f6f8;
}

.screen:has(.arrival-page) .topbar {
  min-height: 66px;
  padding: 10px max(24px, env(safe-area-inset-left)) 8px max(24px, env(safe-area-inset-right));
  grid-template-columns: 48px 1fr 48px;
  background: #f5f6f8;
}

.screen:has(.arrival-page) .topbar h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  color: #111827;
}

.screen:has(.arrival-page) .icon-btn {
  width: 48px;
  height: 48px;
  background: #fff;
  color: #111827;
  font-size: 30px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.content:has(.arrival-page) {
  padding: 0 16px 116px;
  overflow-x: hidden;
  background: #f5f6f8;
}

.arrival-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  color: #111827;
}

.arrival-subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

.arrival-tabs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  border: 1px solid #e3e8f2;
  border-radius: 22px;
  background: #f3f5fa;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.arrival-tab {
  height: 52px;
  border-radius: 18px;
  background: transparent;
  color: #111827;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
}

.arrival-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  box-shadow: 0 10px 24px rgba(29, 100, 255, 0.2);
}

.arrival-list {
  margin-top: 10px;
}

.arrival-card {
  width: 100%;
  margin-top: 12px;
  padding: 22px 20px;
  border-radius: 22px;
  background: #fff;
  display: block;
  text-align: left;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.arrival-card:first-child {
  margin-top: 0;
}

.arrival-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.arrival-card-title {
  min-width: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.arrival-card-summary {
  display: block;
  margin-top: 14px;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
}

.status-badge {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 16px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.pending {
  color: #f59e0b;
  background: #fff7eb;
  border: 1px solid #f6d7a7;
}

.status-badge.done {
  color: #16a34a;
  background: #edf9ef;
  border: 1px solid #b7e4c0;
}

.task-list-page .task-segment {
  grid-template-columns: repeat(var(--tab-count), minmax(0, 1fr));
  margin-top: 12px;
}

.task-list-page .arrival-tab {
  white-space: nowrap;
}

.task-list-page .task-card-list {
  margin-top: 12px;
}

.task-list-page .task-list-card {
  min-height: 104px;
  padding: 22px 20px 20px;
}

.task-list-page .arrival-card-title {
  padding-right: 4px;
}

.task-list-page .arrival-card-summary {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
}

.status-badge.doing {
  color: #1d64ff;
  background: #eaf2ff;
  border: 1px solid #c7dcff;
}

.status-badge.risk {
  color: #ef4444;
  background: #fff0f0;
  border: 1px solid #ffcaca;
}

.status-badge.neutral {
  color: #4b5563;
  background: #f1f3f6;
  border: 1px solid #e5e7eb;
}

.status-badge.repair {
  color: #8b5cf6;
  background: #f3ecff;
  border: 1px solid #ddc8ff;
}

.merch-vat-list-page {
  max-width: 430px;
}

.merch-vat-list-page .merch-vat-segment {
  grid-template-columns: repeat(var(--tab-count), minmax(0, 1fr));
  margin-top: 12px;
}

.merch-vat-list {
  margin-top: 12px;
}

.merch-vat-list-page .merch-vat-detail-card {
  position: relative;
  width: 100%;
  min-height: 156px;
  margin-top: 14px;
  padding: 22px 46px 22px 20px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.merch-vat-list-page .merch-vat-detail-card:first-child {
  margin-top: 0;
}

.merch-vat-list-page .merch-vat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merch-vat-list-page .merch-vat-card-head strong {
  min-width: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
}

.merch-vat-list-page .merch-vat-order,
.merch-vat-list-page .merch-vat-main,
.merch-vat-list-page .merch-vat-meta {
  display: block;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
}

.merch-vat-list-page .merch-vat-order {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
  color: #374151;
}

.merch-vat-list-page .merch-vat-order span {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.merch-vat-list-page .merch-vat-order em {
  color: #8a94a6;
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
}

.merch-vat-list-page .merch-vat-order i {
  width: 1px;
  height: 14px;
  background: #e5e7eb;
  flex: 0 0 auto;
}

.merch-vat-list-page .merch-vat-main {
  max-width: 100%;
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.merch-vat-list-page .merch-vat-meta {
  color: #6b7280;
  font-size: 15px;
  font-weight: 700;
}

.merch-vat-list-page .merch-vat-arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: #8a94a6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.merch-vat-list-page .merch-vat-arrow svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.6;
}

.content:has(.arrival-form-page) {
  padding: 0 14px 28px;
  background: #f5f6f8;
}

.screen:has(.arrival-form-page) .topbar {
  height: 76px;
  padding: 12px 20px 12px;
  background: #f5f6f8;
}

.screen:has(.arrival-form-page) .topbar h2 {
  color: #111827;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
}

.screen:has(.arrival-form-page) .icon-btn,
.screen:has(.arrival-form-page) .back-button {
  width: 46px;
  height: 46px;
  background: #fff;
  color: #111827;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.arrival-form-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  color: #111827;
}

.arrival-form-card {
  background: #fff;
  border-radius: 24px;
  padding: 26px 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.sample-create-page {
  display: grid;
  gap: 18px;
  padding-bottom: 28px;
}

.sample-form-card {
  padding: 24px 20px;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.055);
}

.sample-form-card h2 {
  margin: 0 0 22px;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 950;
}

.sample-form-field {
  display: grid;
  gap: 12px;
}

.sample-form-field + .sample-form-field {
  margin-top: 26px;
}

.sample-form-field > span {
  color: #111827;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.sample-customer-select {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  background: #f1f4f8;
  padding: 0 16px;
  text-align: left;
}

.sample-customer-select strong {
  min-width: 0;
  color: #111827;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-customer-select svg {
  width: 22px;
  height: 22px;
  color: #8a94a6;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.sample-remark-wrap {
  position: relative;
  display: block;
}

.sample-remark-wrap textarea {
  width: 100%;
  min-height: 128px;
  border: 0;
  border-radius: 18px;
  background: #f1f4f8;
  padding: 16px 16px 34px;
  color: #111827;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  resize: none;
  box-sizing: border-box;
}

.sample-remark-wrap b {
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: #9ca3af;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}

.sample-item-list {
  display: grid;
  gap: 18px;
}

.sample-detail-card {
  padding: 18px 16px 16px;
  border: 1px solid #edf1f7;
  border-radius: 22px;
  background: #ffffff;
}

.sample-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sample-detail-head strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 950;
}

.sample-remove-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #f1f4f8;
  color: #6b7280;
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
}

.sample-detail-row {
  display: grid;
  grid-template-columns: 1.08fr 1.08fr 0.9fr;
  gap: 10px;
}

.sample-field {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.sample-field > span:first-child {
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
}

.sample-field input {
  min-width: 0;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: #f1f4f8;
  color: #111827;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  padding: 0 12px;
  box-sizing: border-box;
}

.sample-field input::placeholder,
.sample-remark-wrap textarea::placeholder {
  color: #9ca3af;
  font-weight: 600;
}

.sample-quantity-control {
  position: relative;
  display: block;
}

.sample-quantity-control input {
  padding-right: 32px;
}

.sample-quantity-control b {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
}

.sample-add-btn {
  width: 100%;
  height: 52px;
  margin-top: 22px;
  border: 1.5px dashed #8fb4ff;
  border-radius: 18px;
  background: #f7fbff;
  color: #2563eb;
  font-size: 17px;
  line-height: 1;
  font-weight: 950;
}

.sample-save-btn {
  width: 100%;
  height: 58px;
  margin-top: 8px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #1d64ff 0%, #1677ff 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(29, 100, 255, 0.22);
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
}

.content:has(.sample-detail-page) {
  padding: 0 14px 122px;
  background: #f5f6f8;
  overflow-x: hidden;
}

.screen:has(.sample-detail-page) {
  background: #f5f6f8;
}

.screen:has(.sample-detail-page) .topbar {
  min-height: 76px;
  padding: 12px 20px 12px;
  grid-template-columns: 48px 1fr 48px;
  background: #f5f6f8;
  backdrop-filter: none;
}

.screen:has(.sample-detail-page) .topbar h2 {
  color: #111827;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 950;
}

.screen:has(.sample-detail-page) .back-button {
  width: 48px;
  height: 48px;
  background: transparent;
  color: #111827;
  box-shadow: none;
}

.screen:has(.sample-detail-page) .icon-btn {
  width: 48px;
  height: 48px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.sample-detail-page {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding-top: 14px;
}

.sample-detail-info-card {
  padding: 26px 20px 24px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.065);
}

.sample-detail-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
}

.sample-detail-info-head h1 {
  min-width: 0;
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 950;
  letter-spacing: 0;
}

.sample-status-badge {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 17px;
  line-height: 1;
  font-weight: 950;
}

.sample-status-badge.pending {
  background: #fff1d9;
  color: #f59e0b;
}

.sample-status-badge.processed {
  background: #eaf2ff;
  color: #2563eb;
}

.sample-status-badge.done {
  background: #e8f8ee;
  color: #16a34a;
}

.sample-detail-row-two,
.sample-detail-row-three {
  display: grid;
  border-bottom: 1px solid #e5e7eb;
}

.sample-detail-row-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 28px;
}

.sample-detail-row-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 26px 0;
}

.sample-detail-row-two .sample-detail-field + .sample-detail-field,
.sample-detail-row-three .sample-detail-field + .sample-detail-field {
  border-left: 1px solid #e5e7eb;
}

.sample-detail-field {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 0 20px;
  text-align: left;
}

.sample-detail-field:first-child {
  padding-left: 0;
}

.sample-detail-field:last-child {
  padding-right: 0;
}

.sample-detail-field span,
.sample-detail-time span {
  color: #687285;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.sample-detail-field strong,
.sample-detail-time strong {
  min-width: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-detail-time {
  display: grid;
  gap: 14px;
  padding: 26px 0 32px;
}

.sample-detail-edit-btn {
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #1d64ff 0%, #1677ff 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(29, 100, 255, 0.22);
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
}

.arrival-form-row {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.arrival-form-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.arrival-form-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arrival-form-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.arrival-form-field.full + .arrival-form-row,
.arrival-form-row + .arrival-form-field.full {
  margin-top: 28px;
}

.arrival-form-field > span {
  color: #111827;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.required-mark {
  color: #ff2323;
  font-style: normal;
  font-weight: 900;
}

.arrival-form-field input,
.arrival-form-field select,
.arrival-form-field textarea,
.arrival-form-control {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: #f0f2f6;
  color: #111827;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 500;
}

.arrival-form-field input,
.arrival-form-field select {
  height: 56px;
  padding: 0 16px;
}

.arrival-form-control {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.arrival-form-control input,
.arrival-form-control select {
  background: transparent;
  padding-right: 42px;
}

.arrival-form-control select {
  appearance: none;
}

.arrival-form-control b {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a94a6;
  pointer-events: none;
}

.arrival-form-control svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.arrival-remark-wrap {
  position: relative;
}

.arrival-form-field textarea {
  min-height: 104px;
  resize: none;
  padding: 16px 16px 34px;
}

.arrival-remark-wrap small {
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: #7b8494;
  font-size: 15px;
  font-weight: 500;
}

.arrival-form-submit {
  width: 100%;
  height: 60px;
  margin-top: 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(29, 100, 255, 0.22);
}

@media (max-width: 380px) {
  .arrival-form-card {
    padding: 24px 16px;
  }

  .arrival-form-row.cols-3 {
    gap: 10px;
  }

  .arrival-form-field > span {
    font-size: 15px;
  }

  .arrival-form-field input,
  .arrival-form-field select,
  .arrival-form-field textarea,
  .arrival-form-control {
    font-size: 16px;
  }
}

.create-arrival-task-wrap {
  position: fixed;
  left: 50%;
  bottom: max(112px, calc(env(safe-area-inset-bottom) + 112px));
  width: min(calc(100% - 48px), 386px);
  z-index: 4;
  transform: translateX(-50%);
}

.create-arrival-task-btn {
  width: 100%;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1d4fff, #1677ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(29, 100, 255, 0.22);
}

.create-arrival-task-btn span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #1d64ff;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.bottom-bar.arrival-bottom-bar {
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(calc(100% - 48px), 386px);
  height: 86px;
  padding: 8px;
  border-radius: 28px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.bottom-bar.arrival-bottom-bar .nav-btn {
  min-height: 70px;
  border-radius: 22px;
  gap: 6px;
  font-size: 14px;
}

.bottom-bar.arrival-bottom-bar .nav-btn b svg {
  width: 30px;
  height: 30px;
}

@media (max-width: 400px) {
  .screen:has(.arrival-page) .topbar h2 {
    font-size: 24px;
  }

  .content:has(.arrival-page) {
    padding-inline: 14px;
  }

  .arrival-tab {
    font-size: 17px;
  }

  .arrival-card {
    padding: 20px 16px;
  }

  .arrival-card-title {
    font-size: 18px;
  }

  .arrival-card-summary {
    font-size: 15px;
  }
}

/* Arrival detail viewing page */
.screen:has(.arrival-detail-page),
.screen:has(.typed-detail-page),
.screen:has(.clean-detail-page) {
  background: #f5f6f8;
}

.screen:has(.arrival-detail-page) .topbar,
.screen:has(.typed-detail-page) .topbar,
.screen:has(.clean-detail-page) .topbar {
  min-height: 66px;
  padding: 10px max(18px, env(safe-area-inset-left)) 8px max(18px, env(safe-area-inset-right));
  grid-template-columns: 48px 1fr 48px;
  background: #f5f6f8;
}

.screen:has(.arrival-detail-page) .topbar h2,
.screen:has(.typed-detail-page) .topbar h2,
.screen:has(.clean-detail-page) .topbar h2 {
  color: #111827;
  text-align: center;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.screen:has(.arrival-detail-page) .icon-btn,
.screen:has(.typed-detail-page) .icon-btn,
.screen:has(.arrival-detail-page) .back-button,
.screen:has(.typed-detail-page) .back-button,
.screen:has(.clean-detail-page) .icon-btn,
.screen:has(.clean-detail-page) .back-button {
  width: 48px;
  height: 48px;
  background: #fff;
  color: #111827;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.content.no-tab:has(.arrival-detail-page),
.content.no-tab:has(.typed-detail-page),
.content.no-tab:has(.clean-detail-page) {
  padding: 0 16px 32px;
  overflow-x: hidden;
  background: #f5f6f8;
}

.arrival-detail-page,
.typed-detail-page,
.clean-detail-page {
  min-height: calc(100vh - 66px);
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 8px 0 0;
  color: #111827;
}

.clean-detail-card {
  margin-top: 16px;
  padding: 22px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.sales-customer-detail-page {
  padding-top: 8px;
  padding-bottom: 112px;
}

.customer-hero-card {
  position: relative;
  overflow: hidden;
  padding: 24px 20px 16px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 78%, rgba(255, 255, 255, 0.18) 0 22%, transparent 23%),
    linear-gradient(135deg, #0f63ff 0%, #2684ff 48%, #1d5cff 100%);
  box-shadow: 0 18px 38px rgba(29, 100, 255, 0.22);
}

.customer-hero-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #ffffff;
}

.customer-hero-head span {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 900;
}

.customer-hero-head b {
  min-height: 32px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.customer-hero-card h1 {
  position: relative;
  z-index: 1;
  margin: 22px 0 10px;
  color: #ffffff;
  font-size: 44px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
}

.customer-location,
.customer-salesman {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 900;
}

.customer-salesman {
  margin-top: 6px;
  font-size: 17px;
}

.customer-salesman strong {
  color: #ffffff;
}

.customer-hero-links {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.customer-hero-mini-card {
  width: 100%;
  min-height: 84px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 12px 92px 12px 14px;
  border: 0;
  border-radius: 20px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.customer-mini-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: #2563eb;
}

.customer-mini-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
}

.customer-mini-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.customer-mini-copy strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 950;
}

.customer-mini-copy em {
  min-width: 0;
  width: calc(100% + 76px);
  color: #5b6474;
  font-size: 13px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-mini-more {
  position: absolute;
  right: 14px;
  top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #2563eb;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.customer-mini-more svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #b8c0cc;
  stroke-width: 2.8;
}

.customer-action-card,
.customer-feedback-card {
  margin-top: 16px;
  padding: 22px 20px;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.customer-action-card h2,
.customer-feedback-card h2 {
  margin: 0;
  color: #111827;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 950;
}

.customer-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.customer-action-row button {
  min-width: 0;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 16px;
  line-height: 1;
  font-weight: 950;
}

.customer-action-row svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
}

.customer-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.customer-card-title-row button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.customer-card-title-row svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #b8c0cc;
  stroke-width: 2.8;
}

.customer-feedback-card > strong {
  display: block;
  margin-bottom: 12px;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 950;
}

.customer-feedback-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.customer-feedback-content p {
  margin: 0;
  color: #374151;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 700;
}

.customer-feedback-content time {
  flex: 0 0 auto;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 800;
}

.clean-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.clean-detail-title-row h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.clean-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.clean-status-badge.done {
  background: #e8f8ef;
  color: #16a34a;
}

.clean-status-badge.risk {
  background: #ffecec;
  color: #ef4444;
}

.clean-status-badge.pending {
  background: #fff4e3;
  color: #f59e0b;
}

.clean-detail-list {
  border-top: 1px solid #edf1f7;
}

.clean-detail-row {
  display: grid;
  align-items: start;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid #edf1f7;
}

.clean-detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.clean-detail-row.cols-1 {
  grid-template-columns: 1fr;
}

.clean-detail-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clean-detail-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clean-detail-field {
  min-width: 0;
}

.clean-detail-field span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
}

.clean-detail-field strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
  word-break: break-word;
}

.clean-detail-note {
  margin-top: 4px;
  border-top: 1px solid #edf1f7;
  padding-top: 14px;
  color: #374151;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 600;
}

.clean-detail-edit-btn,
.clean-detail-two-actions button {
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #1d64ff;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(29, 100, 255, 0.18);
}

.clean-detail-edit-btn {
  width: 100%;
  margin-top: 18px;
}

.clean-detail-edit-btn.disabled,
.clean-detail-edit-btn:disabled {
  background: #e5eaf2;
  color: #8a94a6;
  box-shadow: none;
}

.clean-detail-two-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.status-row {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-size: 16px;
  line-height: 1.3;
}

.status-row .status-badge.done {
  height: 30px;
  padding: 0 14px;
  border-radius: 10px;
  background: #e8f8ef;
  color: #16a34a;
  border: 0;
  font-size: 16px;
  font-weight: 800;
}

.detail-card {
  margin-top: 20px;
  padding: 22px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.detail-section-title {
  margin: 0 0 22px;
  color: #111827;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.arrival-detail-card {
  margin-top: 16px;
}

.arrival-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.arrival-detail-title-row .detail-section-title {
  margin-bottom: 0;
}

.arrival-detail-title-row .status-badge.done {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #e8f8ef;
  color: #16a34a;
  font-size: 14px;
  line-height: 30px;
  font-weight: 900;
}

.arrival-detail-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arrival-detail-grid {
  display: grid;
  gap: 12px;
}

.arrival-detail-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.arrival-detail-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arrival-detail-field {
  min-width: 0;
  border-radius: 16px;
  background: #f5f6f8;
  padding: 13px 12px;
}

.arrival-detail-field span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
}

.arrival-detail-field strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
  word-break: break-word;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.info-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: baseline;
  gap: 12px;
}

.info-label {
  color: #6b7280;
  font-size: 17px;
  line-height: 1.3;
}

.info-value {
  color: #111827;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo-thumb {
  display: block;
  border: 0;
  width: 100%;
  aspect-ratio: 1.3;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.photo-thumb-yarn {
  background:
    radial-gradient(circle at 18% 28%, #23406f 0 9px, transparent 10px),
    radial-gradient(circle at 42% 18%, #172c58 0 10px, transparent 11px),
    radial-gradient(circle at 64% 35%, #1f3a68 0 9px, transparent 10px),
    radial-gradient(circle at 82% 22%, #253f6d 0 8px, transparent 9px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 2px, transparent 2px 16px),
    linear-gradient(135deg, #344b70, #10284f 55%, #566b86);
}

.photo-thumb-sheet {
  position: relative;
  background:
    linear-gradient(90deg, rgba(13, 37, 76, .18) 0 1px, transparent 1px 22px),
    linear-gradient(0deg, rgba(13, 37, 76, .16) 0 1px, transparent 1px 18px),
    linear-gradient(135deg, #1d3765, #071b3c);
}

.photo-thumb-sheet::before {
  content: "宏盛染厂\\APB-9821\\A40支 / 2,400米\\A06-18";
  white-space: pre;
  position: absolute;
  inset: 16% 20%;
  padding: 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font-size: 9px;
  line-height: 1.5;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.photo-thumb-sheet::after {
  content: "已核对";
  position: absolute;
  right: 18%;
  bottom: 17%;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
  transform: rotate(-4deg);
}

.photo-count {
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.35;
}

.remark-box {
  border-radius: 14px;
  background: #f5f6f8;
  padding: 16px;
  color: #111827;
  font-size: 16px;
  line-height: 1.6;
}

.task-edit-btn {
  width: 100%;
  height: 44px;
  margin: 18px 0 0;
  border: 0;
  border-radius: 14px;
  background: #1d64ff;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(29, 100, 255, 0.18);
}

@media (max-width: 400px) {
  .screen:has(.arrival-detail-page) .topbar h2,
  .screen:has(.typed-detail-page) .topbar h2,
  .screen:has(.clean-detail-page) .topbar h2 {
    font-size: 22px;
  }

  .content.no-tab:has(.arrival-detail-page),
  .content.no-tab:has(.typed-detail-page),
  .content.no-tab:has(.clean-detail-page) {
    padding-inline: 14px;
  }

  .detail-section-title {
    font-size: 22px;
  }

  .info-row {
    grid-template-columns: 84px 1fr;
  }

  .info-label {
    font-size: 16px;
  }

  .info-value {
    font-size: 17px;
  }

  .arrival-detail-grid {
    gap: 10px;
  }

  .arrival-detail-field {
    padding: 12px 10px;
  }

  .arrival-detail-field strong {
    font-size: 16px;
  }

  .clean-detail-row {
    gap: 10px;
  }

  .clean-detail-field strong {
    font-size: 16px;
  }

  .clean-detail-field span {
    font-size: 12.5px;
  }
}

/* Dye vat and repair vat detail pages */
.screen:has(.vat-detail-page),
.screen:has(.vat-log-page) {
  background: #f5f6f8;
}

.app:has(.dye-vat-detail-page),
.app:has(.repair-vat-detail-page) {
  width: 100%;
  max-width: none;
}

.content.no-tab:has(.vat-detail-page) {
  padding: 0 0 96px;
  background: #f5f6f8;
  overflow-x: hidden;
}

.content.no-tab:has(.dye-vat-detail-page):not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)),
.content.no-tab:has(.repair-vat-detail-page):not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)) {
  padding: 0 0 24px;
}

.vat-detail-page {
  min-height: 100vh;
  background: #f5f6f8;
  color: #111827;
}

.vat-detail-page svg,
.vat-log-page svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vat-hero {
  position: relative;
  overflow: hidden;
  padding: calc(18px + env(safe-area-inset-top)) 24px 94px;
  border-bottom-left-radius: 34px;
  border-bottom-right-radius: 34px;
  background: linear-gradient(135deg, #1677ff 0%, #1d64ff 58%, #38a7ff 100%);
  color: #fff;
  box-shadow: 0 16px 30px rgba(29, 100, 255, 0.20);
}

.vat-hero::before,
.vat-hero::after,
.vat-hero-shape {
  content: "";
  position: absolute;
  pointer-events: none;
}

.vat-hero::before {
  right: -74px;
  bottom: -70px;
  width: 300px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(-18deg);
}

.vat-hero::after {
  left: -36px;
  bottom: 48px;
  width: 118%;
  height: 120px;
  border-top: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  transform: rotate(8deg);
}

.vat-hero-shape {
  right: -20px;
  top: 86px;
  width: 260px;
  height: 130px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(-22deg);
}

.vat-detail-topbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 44px;
}

.vat-detail-topbar h1 {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 900;
}

.vat-round-btn,
.vat-menu-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vat-round-btn {
  line-height: 1;
  font-weight: 300;
}

.vat-back-button {
  width: 44px;
  height: 44px;
}

.vat-menu-btn {
  letter-spacing: 5px;
  font-size: 28px;
  padding-left: 5px;
}

.vat-hero-main {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  min-height: 132px;
}

.vat-main-code {
  margin: 0;
  color: #fff;
  font-size: 38px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.vat-subtitle {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
}

.vat-hero-meta {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vat-hero-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.vat-hero-meta-row span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
}

.vat-hero-meta-row strong {
  color: #fff;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 900;
}

.vat-status-pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  margin-top: 12px;
  padding: 0 16px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: none;
}

.vat-header-action {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 116px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.vat-header-action svg {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.vat-detail-content {
  position: relative;
  z-index: 2;
  max-width: 430px;
  margin: -72px auto 0;
  padding: 0 12px;
}

.dye-vat-detail-page .vat-detail-content,
.repair-vat-detail-page .vat-detail-content {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: -72px 0 0;
  padding: 0 16px 28px;
}

.vat-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.vat-card + .vat-card {
  margin-top: 18px;
}

.vat-update-card,
.vat-info-card,
.vat-summary-card,
.vat-finished-card {
  padding: 22px 18px;
}

.vat-card-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.vat-card-title-row h2 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
}

.vat-update-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vat-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vat-update-head > span {
  color: #6b7280;
  font-size: 15px;
  white-space: nowrap;
}

.vat-more-link {
  border: 0;
  background: transparent;
  color: #1d64ff;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.vat-more-link svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.vat-update-list {
  margin-top: 22px;
}

.vat-update-row {
  position: relative;
  display: grid;
  grid-template-columns: 74px 26px minmax(82px, 1fr) auto;
  align-items: center;
  min-height: 58px;
  gap: 10px;
  border-bottom: 1px solid #e5eaf2;
  color: #111827;
}

.dye-vat-detail-page .vat-update-row {
  grid-template-columns: 58px 22px minmax(72px, 1fr) max-content;
  gap: 8px;
}

.vat-update-row:last-child {
  border-bottom: 0;
}

.vat-update-row time {
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
}

.dye-vat-detail-page .vat-update-row time {
  font-size: 17px;
}

.vat-update-row strong {
  color: #111827;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 800;
}

.dye-vat-detail-page .vat-update-row strong {
  font-size: 17px;
}

.vat-update-row b {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  text-align: right;
}

.dye-vat-detail-page .vat-update-row b {
  font-size: 16px;
  white-space: nowrap;
}

.vat-update-row b.blue {
  color: #1d64ff;
}

.arrival-add-btn {
  font-size: 30px;
  line-height: 1;
}

.vat-update-row b.green {
  color: #16a34a;
}

.vat-update-row b.orange {
  color: #f59e0b;
}

.vat-update-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1d64ff;
  box-shadow: 0 0 0 6px rgba(29, 100, 255, 0.10);
}

.vat-update-dot.done {
  background: #16a34a;
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
}

.vat-update-dot.active {
  background: #1d64ff;
  box-shadow: 0 0 0 6px rgba(29, 100, 255, 0.14);
}

.vat-update-row:not(:last-child) .vat-update-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  width: 1px;
  height: 56px;
  background: #d8e1ef;
  transform: translateX(-50%);
}

.vat-info-table {
  margin-top: 22px;
}

.vat-info-head,
.vat-info-row {
  display: grid;
  grid-template-columns: 1fr 1.55fr 1fr;
  align-items: center;
  gap: 10px;
}

.vat-info-head {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.2;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5eaf2;
}

.vat-info-row {
  min-height: 45px;
  border-bottom: 1px solid #e5eaf2;
}

.vat-info-row:last-child {
  border-bottom: 0;
}

.vat-info-row span {
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
}

.vat-info-row strong {
  color: #4b5563;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 600;
}

.vat-info-row b {
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
  text-align: right;
}

.vat-simple-info-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.vat-simple-info-item {
  min-width: 0;
}

.vat-simple-info-label {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
}

.vat-simple-info-value {
  display: block;
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
  word-break: break-word;
}

.vat-simple-info-remark {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #edf1f7;
}

.vat-simple-info-remark .vat-simple-info-value {
  color: #374151;
  font-size: 16px;
  font-weight: 700;
}

.vat-finished-grid {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #edf1f7;
}

.vat-finished-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 4px;
}

.vat-finished-grid.three {
  grid-template-columns: 1.2fr .8fr .8fr;
}

.vat-finished-item {
  min-width: 0;
}

.vat-finished-card .vat-simple-info-remark {
  margin-top: 0;
  padding-top: 16px;
  border-top: 0;
}

.vat-finished-card .vat-simple-info-remark .vat-simple-info-value {
  white-space: normal;
}

.vat-summary-text {
  margin: 14px 0 0;
  color: #4b5563;
  font-size: 17px;
  line-height: 1.55;
}

.vat-checkin-card {
  cursor: pointer;
}

.vat-checkin-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.vat-checkin-summary p {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vat-checkin-summary span {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.2;
}

.vat-checkin-summary strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
}

.vat-checkin-summary p:last-child {
  grid-column: 1 / -1;
}

.vat-photo-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.repair-reason-grid {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px 14px;
  margin-top: 18px;
  color: #111827;
}

.repair-reason-grid span {
  color: #6b7280;
  font-size: 16px;
}

.repair-reason-grid strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.45;
}

.repair-result-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: #f5f6f8;
  color: #111827;
  font-size: 17px;
  line-height: 1.55;
}

.repair-result-box strong,
.repair-result-box span {
  display: block;
}

.repair-result-box strong {
  font-weight: 900;
  color: #111827;
}

.repair-result-box span {
  margin-top: 8px;
  color: #6b7280;
  font-size: 16px;
  font-weight: 700;
}

.vat-bottom-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  max-width: 430px;
  margin: 18px auto 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: linear-gradient(180deg, rgba(245, 246, 248, 0), #f5f6f8 22%);
}

.vat-bottom-actions.single {
  grid-template-columns: 1fr;
}

.vat-secondary-btn,
.vat-primary-btn {
  height: 52px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 900;
}

.vat-secondary-btn {
  border: 1px solid #d8e1f0;
  background: #fff;
  color: #1d64ff;
}

.vat-primary-btn {
  border: 0;
  background: linear-gradient(135deg, #1d4fff 0%, #1677ff 100%);
  color: #fff;
  box-shadow: 0 10px 18px rgba(29, 100, 255, 0.22);
}

.content.no-tab:has(.vat-log-page) {
  padding: 18px 16px 32px;
  background: #f5f6f8;
}

.vat-log-page {
  max-width: 430px;
  margin: 0 auto;
}

.vat-log-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vat-log-list p {
  margin: 0;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5eaf2;
}

.vat-log-list p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.vat-log-list time {
  color: #6b7280;
  font-size: 15px;
}

.vat-log-list strong {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.vat-log-list span {
  grid-column: 2;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.45;
}

.content:has(.product-search-page):not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)) {
  padding: 0 0 108px;
}

.content:has(.vat-search-page):not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)) {
  padding: 0 0 108px;
}

.content:has(.query-page):not(:has(.clerk-dashboard)):not(:has(.history-page)):not(:has(.clerk-form-page)) {
  padding: 0 0 108px;
  background: #f5f7fb;
  overflow-x: hidden;
}

.query-page {
  width: 100%;
  max-width: none;
  min-height: 100%;
  margin: 0;
  background: #f5f7fb;
  color: #111827;
}

.query-page.order-list-page,
.query-page.stock-board-page {
  max-width: none;
  margin: 0;
}

.query-header {
  position: relative;
  overflow: hidden;
  padding: 26px 18px 30px;
  background: linear-gradient(135deg, #1269ff 0%, #1d64ff 56%, #35a7ff 100%);
  color: #fff;
}

.query-header::before,
.query-header::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.query-header::before {
  right: -96px;
  top: 56px;
  width: 340px;
  height: 150px;
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transform: rotate(-10deg);
}

.query-header::after {
  right: -58px;
  bottom: -70px;
  width: 280px;
  height: 150px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  transform: rotate(-18deg);
}

.query-title,
.query-subtitle,
.query-search-row {
  position: relative;
  z-index: 1;
}

.query-title {
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 900;
}

.query-subtitle {
  margin: 18px 0 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.query-subtitle svg {
  width: 16px;
  height: 16px;
}

.query-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 68px;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.query-search-input {
  min-width: 0;
  height: 48px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.query-search-input.stock-search {
  margin: 0;
  height: 48px;
  border: 0;
  padding: 0 12px;
}

.query-search-input svg {
  width: 20px;
  height: 20px;
  color: #8b95a7;
  flex-shrink: 0;
}

.query-search-input input,
.query-search-input .order-search-input,
.query-search-input.stock-search input {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
}

.query-search-input input::placeholder {
  color: #9aa3b2;
  font-weight: 600;
}

.query-search-button,
.query-filter-button {
  height: 48px;
  min-width: 0;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
  padding: 0 8px;
}

.query-search-button {
  border: 0;
  background: #1d64ff;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.query-header.inventory-header {
  min-height: 190px;
  padding: calc(env(safe-area-inset-top, 0px) + 30px) 20px 34px;
}

.inventory-header .query-subtitle {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

.inventory-header .query-subtitle svg,
.inventory-header .page-back-button svg,
.inventory-header .page-back-button .back-button-icon {
  color: #ffffff;
  stroke: currentColor;
}

.inventory-header .query-search-row {
  grid-template-columns: minmax(0, 1fr) 64px 72px;
  gap: 10px;
  margin-top: 16px;
}

.inventory-header .query-search-button,
.inventory-header .query-filter-button {
  width: 100%;
}

.inventory-header .inventory-add-button {
  background: #ffffff;
  color: #1d64ff;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.query-filter-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: #fff;
  color: #1d64ff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.query-filter-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}

.query-filter-button.has-filter::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1d64ff;
}

.query-panel {
  position: relative;
  z-index: 2;
  margin-top: -2px;
  padding: 18px 22px 120px;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  background: #f7f9fd;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.04);
}

.query-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 11px;
  overflow-x: auto;
  margin: 0 0 20px;
  padding: 0 18px 2px 0;
  scrollbar-width: none;
  scroll-padding-inline: 0 18px;
}

.query-tabs::-webkit-scrollbar {
  display: none;
}

.query-tab,
.query-tabs button {
  height: 40px;
  min-width: 78px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.query-tab.active,
.query-tabs button.active {
  background: linear-gradient(135deg, #1d4fff 0%, #1677ff 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 100, 255, 0.22);
}

.query-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.query-card {
  position: relative;
  width: 100%;
  min-height: 138px;
  margin: 0;
  padding: 18px 42px 18px 14px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 0;
  border-radius: 22px;
  background: #fff;
  text-align: left;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.query-card-thumb {
  width: 82px;
  height: 96px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #eaf3ff 0%, #f8fbff 100%);
  color: #1d64ff;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.query-card-content {
  min-width: 0;
  display: block;
}

.query-card-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b95a7;
}

.query-card-arrow svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.sales-customer-page .sales-customer-card,
.sales-sample-page .sales-sample-card {
  min-height: auto;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
  gap: 0;
  padding: 18px 48px 18px 18px;
  text-align: left;
}

.sales-query-card-content {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  text-align: left;
}

.sales-customer-name,
.sales-sample-no,
.sales-query-title {
  display: block;
  min-width: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-query-main {
  display: block;
  min-width: 0;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
  text-align: left;
  word-break: normal;
  overflow-wrap: anywhere;
}

.sales-query-meta {
  display: block;
  min-width: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  text-align: left;
  word-break: normal;
  overflow-wrap: anywhere;
}

.sales-query-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #ea580c;
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.sales-sample-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sales-sample-title-row .order-status-badge {
  flex: 0 0 auto;
}

.sales-customer-page,
.sales-sample-page {
  background: #f4f7fb;
}

.sales-customer-page .sales-query-header,
.sales-sample-page .sales-query-header {
  min-height: 228px;
  padding: 34px 16px 36px;
  background:
    radial-gradient(circle at 92% 74%, rgba(255, 255, 255, 0.14) 0 22%, transparent 23%),
    linear-gradient(135deg, #0666ff 0%, #1477ff 48%, #31a7ff 100%);
}

.sales-customer-page .sales-query-header::before,
.sales-sample-page .sales-query-header::before {
  right: -88px;
  top: 80px;
  width: 360px;
  height: 170px;
  border-top-color: rgba(255, 255, 255, 0.20);
}

.sales-customer-page .sales-query-header .page-back-button,
.sales-sample-page .sales-query-header .page-back-button {
  left: 24px;
  top: 36px;
  width: 42px;
  height: 42px;
  color: #ffffff;
}

.sales-customer-page .sales-query-header .header-add-button,
.sales-sample-page .sales-query-header .header-add-button {
  right: 24px;
  top: 36px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font-size: 31px;
  font-weight: 400;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.sales-customer-page .query-title,
.sales-sample-page .query-title {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 950;
}

.sales-customer-page .query-subtitle,
.sales-sample-page .query-subtitle {
  margin: 30px 0 24px;
  gap: 10px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 950;
}

.sales-customer-page .query-subtitle svg,
.sales-sample-page .query-subtitle svg,
.sales-customer-page .query-search-input svg,
.sales-sample-page .query-search-input svg,
.sales-customer-page .query-filter-button svg,
.sales-sample-page .query-filter-button svg,
.sales-customer-page .query-card-arrow svg,
.sales-sample-page .query-card-arrow svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sales-customer-page .query-subtitle svg,
.sales-sample-page .query-subtitle svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
  stroke-width: 2.8;
}

.sales-customer-page .query-search-row,
.sales-sample-page .query-search-row {
  grid-template-columns: minmax(0, 1fr) 64px 76px;
  gap: 10px;
}

.sales-customer-page .query-search-input,
.sales-sample-page .query-search-input {
  height: 58px;
  padding: 0 15px;
  gap: 10px;
  border-radius: 19px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.sales-customer-page .query-search-input svg,
.sales-sample-page .query-search-input svg {
  width: 24px;
  height: 24px;
  color: #737c8c;
  stroke-width: 2.7;
}

.sales-customer-page .query-search-input input,
.sales-sample-page .query-search-input input {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.sales-customer-page .query-search-input input::placeholder,
.sales-sample-page .query-search-input input::placeholder {
  color: #8a94a6;
  font-weight: 800;
}

.sales-customer-page .query-search-button,
.sales-sample-page .query-search-button,
.sales-customer-page .query-filter-button,
.sales-sample-page .query-filter-button {
  height: 58px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 950;
}

.sales-customer-page .query-search-button,
.sales-sample-page .query-search-button {
  background: linear-gradient(135deg, #1b63ff 0%, #0f5dff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 12px 26px rgba(8, 83, 220, 0.22);
}

.sales-customer-page .query-filter-button,
.sales-sample-page .query-filter-button {
  gap: 6px;
  background: #ffffff;
  color: #1767f2;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.sales-customer-page .query-filter-button svg,
.sales-sample-page .query-filter-button svg {
  width: 20px;
  height: 20px;
  color: #1767f2;
  stroke-width: 2.8;
}

.sales-customer-page .sales-query-panel,
.sales-sample-page .sales-query-panel {
  margin-top: 0;
  padding: 26px 20px 126px;
  border-radius: 0;
  background: #f4f7fb;
  box-shadow: none;
}

.sales-sample-page .query-tabs {
  gap: 12px;
  margin-bottom: 24px;
  padding-right: 0;
}

.sales-sample-page .query-tab {
  height: 46px;
  min-width: 96px;
  padding: 0 22px;
  border-radius: 19px;
  color: #5f6878;
  font-size: 17px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.sales-sample-page .query-tab.active {
  background: linear-gradient(135deg, #1c64ff 0%, #0f63ff 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(29, 100, 255, 0.24);
}

.sales-customer-page .sales-card-list,
.sales-sample-page .sales-card-list {
  gap: 16px;
}

.sales-customer-page .sales-customer-card,
.sales-sample-page .sales-sample-card {
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.065);
}

.sales-customer-page .sales-customer-card {
  min-height: 120px;
  padding: 24px 54px 24px 22px;
}

.sales-sample-page .sales-sample-card {
  min-height: 178px;
  padding: 24px 54px 24px 22px;
}

.sales-customer-page .sales-query-card-content,
.sales-sample-page .sales-query-card-content {
  gap: 12px;
}

.sales-customer-page .sales-customer-name,
.sales-sample-page .sales-sample-no {
  font-size: 25px;
  line-height: 1.18;
  font-weight: 950;
}

.sales-sample-page .sales-query-title {
  font-size: 23px;
  line-height: 1.2;
  font-weight: 950;
}

.sales-customer-page .sales-query-meta,
.sales-sample-page .sales-query-meta {
  color: #687285;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 850;
}

.sales-customer-page .sales-query-meta em {
  min-height: 28px;
  margin-left: 6px;
  padding: 0 12px;
  background: #fff1e8;
  color: #f05a1f;
  font-size: 15px;
  font-weight: 950;
}

.sales-customer-page .sales-customer-brief {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}

.sales-customer-page .sales-customer-brief > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-customer-page .sales-customer-brief em {
  flex: 0 0 auto;
  margin-left: 0;
}

.sales-sample-page .order-status-badge {
  min-height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 950;
}

.sales-customer-page .query-card-arrow,
.sales-sample-page .query-card-arrow {
  right: 24px;
  color: #7a8494;
}

.sales-customer-page .query-card-arrow svg,
.sales-sample-page .query-card-arrow svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.8;
}

.sales-profile-title {
  padding: 6px 4px 14px;
}

.sales-profile-title h1 {
  margin: 0;
  color: var(--m-title);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 900;
}

.query-page--order .order-card-list,
.query-page--stock .stock-update-list {
  margin-top: 0;
}

.query-page--order .order-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  min-height: 152px;
  padding: 16px 40px 16px 12px;
}

.query-page--order .order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.query-page--order .order-card-thumb {
  width: 68px;
  height: 82px;
  font-size: 24px;
}

.query-page--order .order-code {
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
}

.query-page--order .order-customer {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.35;
  font-style: normal;
  font-weight: 700;
}

.query-page--order .order-info-box {
  display: block;
  margin-top: 9px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.query-page--order .order-main-info {
  display: block;
  font-size: 14px;
  line-height: 1.45;
}

.query-page--order .order-sub-info {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.query-page--order .order-progress-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.query-page--order .order-progress-text {
  font-size: 15px;
}

.query-page--order .order-total-card {
  min-height: 124px;
}

.query-page--order .order-total-card.order-brief-card {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  padding: 16px;
}

.query-page--order .order-brief-card .order-card-content {
  gap: 12px;
}

.query-page--order .order-brief-card .order-card-header {
  align-items: baseline;
}

.query-page--order .order-brief-card .order-customer {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #344054;
  font-size: 15px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.query-page--order .order-brief-items {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #e9edf3;
}

.query-page--order .order-brief-item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr) minmax(76px, 0.95fr);
  gap: 10px;
  padding: 11px 0;
}

.query-page--order .order-brief-item + .order-brief-item {
  border-top: 1px dashed #e9edf3;
}

.query-page--order .order-brief-item > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.query-page--order .order-brief-item small {
  color: #98a2b3;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
}

.query-page--order .order-brief-item strong {
  overflow: hidden;
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.query-page--order .order-brief-item > span:last-child {
  text-align: right;
}

.query-page--order .order-brief-card .order-progress-track {
  width: 100%;
  height: 7px;
  margin: 0;
}

.order-status-badge.badge-gray {
  color: #4b5563;
  background: #f1f3f6;
}

.screen:has(.order-summary-page) {
  background: #f5f6f8;
}

.screen:has(.order-summary-page) .topbar {
  min-height: 78px;
  padding: 18px max(24px, env(safe-area-inset-left)) 14px max(24px, env(safe-area-inset-right));
  background: #f5f6f8;
  backdrop-filter: none;
}

.screen:has(.order-summary-page) .topbar h2 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
  color: #111827;
}

.screen:has(.order-summary-page) .topbar .back-button {
  width: 42px;
  height: 42px;
}

.screen:has(.order-summary-page) .topbar .back-button svg,
.screen:has(.order-summary-page) .topbar .back-button .back-button-icon {
  width: 31px;
  height: 31px;
  stroke-width: 2.7;
}

.screen:has(.order-summary-page) .content.no-tab {
  padding: 8px 0 38px;
}

.order-summary-close {
  width: 48px;
  height: 48px;
  border: 0;
  background: #fff;
  color: #111827;
  font-size: 30px;
  font-weight: 500;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.order-summary-page {
  padding: 0 0 28px;
  background: #f5f6f8;
}

.order-summary-hero-card {
  position: relative;
  margin: 0 16px;
  min-height: 226px;
  padding: 26px 16px 24px;
  border-radius: 26px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #1d64ff 0%, #1677ff 58%, #0d56e8 100%);
  box-shadow: 0 18px 38px rgba(29, 100, 255, 0.20);
  box-sizing: border-box;
}

.order-summary-hero-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -58px;
  width: 230px;
  height: 145px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  transform: rotate(-18deg);
}

.order-summary-hero-card > * {
  position: relative;
  z-index: 1;
}

.order-summary-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-summary-hero-head strong {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.order-summary-hero-status,
.order-summary-item-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  font-weight: 900;
}

.order-summary-hero-status {
  min-height: 32px;
  padding: 0 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-size: 14px;
}

.order-summary-hero-card h1 {
  margin: 18px 0 8px;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 900;
}

.order-summary-hero-main {
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.96);
  font-weight: 900;
}

.order-summary-hero-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 0.72fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 25px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.order-summary-hero-meta span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.order-summary-hero-meta i {
  width: 1px;
  height: 19px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.22);
}

.order-summary-hero-remark {
  margin: 22px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.95);
  font-size: 14.5px;
  line-height: 1.35;
  font-weight: 800;
}

.order-summary-list-card {
  margin: 16px 16px 0;
  padding: 23px 16px 22px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

.order-summary-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 19px;
}

.order-summary-section-title h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.order-summary-count {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
}

.order-summary-detail-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 0;
}

.order-summary-detail-card {
  position: relative;
  width: 100%;
  min-height: 146px;
  padding: 20px 48px 21px 18px;
  border: 1px solid #e3eaf5;
  border-radius: 22px;
  background: #fff;
  text-align: left;
  box-sizing: border-box;
}

.order-summary-detail-card .query-card-arrow {
  right: 14px;
}

.order-detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-detail-card-head strong {
  font-size: 19px;
  line-height: 1.25;
  color: #111827;
  font-weight: 900;
}

.order-detail-card-head em {
  font-style: normal;
}

.order-summary-item-status {
  min-height: 28px;
  padding: 0 13px;
  font-size: 13px;
}

.order-summary-item-status.blue {
  color: #1d64ff;
  background: #eaf2ff;
}

.order-summary-item-status.orange {
  color: #f59e0b;
  background: #fff3dd;
}

.order-summary-item-status.gray {
  color: #4b5563;
  background: #f1f3f6;
}

.order-summary-item-status.red {
  color: #ef4444;
  background: #ffecec;
}

.order-summary-item-status.green {
  color: #16a34a;
  background: #e8f8ef;
}

.order-detail-card-main,
.order-detail-card-meta {
  display: block;
}

.order-detail-card-main {
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.45;
  color: #111827;
  font-weight: 800;
}

.order-detail-card-meta {
  display: grid;
  grid-template-columns: auto 1px auto 1px auto;
  align-items: center;
  justify-content: start;
  gap: 13px;
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
  font-weight: 700;
}

.order-detail-card-meta b {
  min-width: 0;
  font: inherit;
  white-space: nowrap;
  text-align: left;
}

.order-detail-card-meta i {
  width: 1px;
  height: 20px;
  flex: 0 0 auto;
  background: #e4e9f2;
}

.order-summary-detail-card .query-card-arrow {
  right: 18px;
  color: #6b7280;
}

.order-summary-detail-card .query-card-arrow svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.8;
}

.order-detail-note {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  font-weight: 700;
}

.order-log-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-log-list li {
  padding: 12px 0;
  border-bottom: 1px solid #edf1f7;
  color: #374151;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.order-log-list li:last-child {
  border-bottom: none;
}

.inventory-create-page {
  min-height: 100vh;
  padding: 14px 14px 118px;
  background: #f5f6f8;
  box-sizing: border-box;
}

.inventory-form-card {
  margin: 0;
  padding: 18px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.inventory-form-card h2 {
  margin: 0 0 18px;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.inventory-form-card .form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
}

.inventory-form-card .field-label {
  color: #4b5563;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
}

.inventory-form-card .input-box {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border: 0;
  border-radius: 14px;
  background: #f3f5f8;
  color: #111827;
  padding: 0 14px;
  font-size: 16px;
  line-height: normal;
  font-weight: 800;
  outline: none;
}

.inventory-form-card .select-box {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8a94a6 50%),
    linear-gradient(135deg, #8a94a6 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 12px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.inventory-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inventory-form-card textarea.input-box {
  min-height: 104px;
  padding: 12px 14px 28px;
  resize: none;
  line-height: 1.5;
}

.inventory-product-field {
  z-index: 3;
}

.inventory-product-suggest {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  max-height: 150px;
  overflow-y: auto;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.inventory-product-suggest.open {
  display: block;
}

.inventory-product-suggest button {
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f7;
  background: transparent;
  text-align: left;
}

.inventory-product-suggest button:last-child {
  border-bottom: 0;
}

.inventory-product-suggest strong {
  display: block;
  color: #111827;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 900;
}

.inventory-product-suggest span,
.inventory-suggest-empty span {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
}

.inventory-suggest-empty {
  padding: 12px;
}

.inventory-suggest-empty strong {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.inventory-remark-field {
  margin-bottom: 0;
}

.inventory-remark-count {
  position: absolute;
  right: 12px;
  bottom: 9px;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 800;
}

.inventory-submit-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: 398px;
  margin: 0 auto;
}

.inventory-submit-bar .submit-button {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: #1d64ff;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
}

.inventory-close-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.vat-progress-plus {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.vat-progress-update-page {
  padding-bottom: 28px;
}

.vat-progress-update-list {
  display: grid;
  gap: 14px;
}

.vat-progress-update-card,
.tracker-vat-split-card,
.repair-progress-card {
  position: relative;
  padding: 16px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.vat-progress-update-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-right: 34px;
}

.vat-progress-update-title h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.vat-progress-update-title span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.progress-card-remove {
  position: absolute;
  top: -4px;
  right: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #f3f5f8;
  color: #6b7280;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.vat-progress-update-card .progress-finished-fields {
  display: none;
}

.vat-progress-update-card[data-status="成品"] .progress-running-fields,
.vat-progress-update-card[data-status="完成"] .progress-running-fields,
.vat-progress-update-card[data-status="已完成"] .progress-running-fields,
.vat-progress-update-card[data-status="成品"] .progress-running-remark,
.vat-progress-update-card[data-status="完成"] .progress-running-remark,
.vat-progress-update-card[data-status="已完成"] .progress-running-remark {
  display: none;
}

.vat-progress-update-card[data-status="成品"] .progress-finished-fields,
.vat-progress-update-card[data-status="完成"] .progress-finished-fields,
.vat-progress-update-card[data-status="已完成"] .progress-finished-fields {
  display: block;
}

.vat-progress-update-card .progress-finished-fields {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e9edf3;
  border-radius: 16px;
  background: #fff;
}

.vat-progress-update-card .progress-finished-fields > h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 16px;
  font-weight: 850;
}

.finished-remark-field {
  margin-top: 10px;
}

.vat-add-progress-card {
  width: 100%;
  height: 48px;
  margin: 14px 0;
  border: 1px dashed #8fb4ff;
  border-radius: 16px;
  background: #eff6ff;
  color: #1d64ff;
  font-size: 16px;
  font-weight: 900;
}

.vat-add-progress-card.repair {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.progress-preview {
  display: block;
  margin-top: 6px;
  color: #2563eb;
  font-size: 13px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 800;
}

.repair-progress-card {
  border: 1px solid #ede9fe;
}

.tracker-vat-split-card {
  padding-top: 20px;
}

.tracker-vat-split-card > .progress-card-remove {
  top: 10px;
  right: 10px;
}

.vat-progress-update-page .vat-progress-update-list {
  gap: 18px;
}

.vat-progress-update-page .vat-progress-update-card,
.vat-progress-update-page .repair-progress-card {
  padding: 20px;
  border-radius: 24px;
}

.vat-progress-update-page .vat-progress-update-title {
  margin-bottom: 18px;
}

.vat-progress-update-page .arrival-form-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 18px;
}

.vat-progress-update-page .arrival-form-field > span {
  display: block;
  margin-bottom: 10px;
  color: #111827;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.vat-progress-update-page .arrival-form-field input,
.vat-progress-update-page .arrival-form-field select,
.vat-progress-update-page .arrival-form-field textarea {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border: 0;
  border-radius: 16px;
  background: #f1f4f8;
  padding: 0 14px;
  color: #111827;
  font-size: 16px;
  line-height: normal;
  font-weight: 800;
}

.vat-progress-update-page .arrival-form-field textarea {
  min-height: 96px;
  padding: 14px;
  line-height: 1.5;
  resize: none;
}

.vat-progress-update-page .progress-preview {
  margin-top: 8px;
  margin-bottom: 6px;
  color: #2563eb;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 800;
}

.vat-progress-update-page .progress-running-fields .arrival-form-field {
  margin-bottom: 20px;
}

.vat-progress-update-page .vat-add-progress-card {
  margin: 18px 0 0;
}

.vat-progress-update-page .vat-add-progress-card.repair {
  margin-top: 12px;
}

.vat-progress-update-page .vat-add-progress-card.repair + .arrival-form-submit {
  margin-top: 22px;
}

.tracker-confirm-remark {
  width: 100%;
  min-height: 92px;
  margin: 12px 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 16px;
  background: #f3f5f8;
  padding: 12px 14px;
  color: #111827;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 800;
  resize: none;
}

.tracker-dye-progress {
  margin-top: 14px;
}

.tracker-dye-progress span,
.tracker-dye-progress strong {
  display: block;
}

.tracker-dye-progress span {
  color: #6b7280;
  font-size: 14px;
  font-weight: 800;
}

.tracker-dye-progress strong {
  margin-top: 4px;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.tracker-dye-progress i {
  display: block;
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf2;
}

.tracker-dye-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1d64ff;
}

.tracker-vat-split-list {
  display: grid;
  gap: 12px;
}

.tracker-vat-confirm-list {
  display: grid;
  gap: 10px;
}

.tracker-vat-confirm-list p {
  margin: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf1f7;
}

.tracker-vat-confirm-list p:last-child {
  border-bottom: 0;
}

.tracker-vat-confirm-list strong {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.tracker-vat-confirm-list span {
  color: #6b7280;
  font-size: 14px;
  font-weight: 800;
}

.query-page--vat .vat-search-panel {
  padding: 18px 12px 26px;
}

.query-page--vat .vat-search-tabs {
  display: grid;
  grid-auto-flow: unset;
  grid-auto-columns: unset;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  margin-bottom: 14px;
}

.query-page--vat .vat-search-tabs button {
  min-width: 0;
  padding: 0 6px;
}

.query-page--vat .vat-result-list {
  gap: 0;
}

.query-page--stock .stock-panel-head {
  margin: 0 0 14px;
}

.query-page--stock .stock-update-item {
  min-height: 152px;
  border: 0;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.query-page--stock .stock-card-thumb {
  background: linear-gradient(135deg, #eaf3ff 0%, #f8fbff 100%);
  align-self: center;
}

.query-page--stock .stock-card-content strong {
  display: block;
  color: #111827;
  font-size: 18px;
  line-height: 1.22;
  font-weight: 900;
}

.query-page--stock .stock-card-content em {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
  font-style: normal;
  font-weight: 800;
}

.query-page--stock .stock-card-content span {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.query-page--stock .stock-card-content span i {
  display: block;
  margin-bottom: 2px;
  color: #8b95a7;
  font-style: normal;
  font-weight: 700;
}

.query-page--stock .stock-card-content b {
  color: #111827;
  font-weight: 900;
}

.query-page--stock .stock-change-line b,
.stock-history-page .stock-change-line b {
  display: block;
}

.query-page--stock .stock-live-line b {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.query-page--stock .stock-card-content b.up {
  color: #16a34a;
}

.query-page--stock .stock-card-content b.down {
  color: #ef4444;
}

@media (max-width: 400px) {
  .product-search-hero {
    padding: 22px 20px 26px;
  }

  .header-add-button {
    right: 20px;
    top: 28px;
  }

  .query-header {
    padding: 24px 12px 28px;
  }

  .query-header.inventory-header {
    min-height: 190px;
    padding: calc(env(safe-area-inset-top, 0px) + 28px) 16px 34px;
  }

  .query-search-row {
    grid-template-columns: minmax(0, 1fr) 58px 66px;
    gap: 7px;
  }

  .inventory-header .query-search-row {
    grid-template-columns: minmax(0, 1fr) 58px 66px;
    gap: 8px;
    margin-top: 16px;
  }

  .query-search-button,
  .query-filter-button {
    font-size: 14px;
  }

  .query-panel {
    padding: 16px 20px 120px;
  }

  .query-tabs {
    grid-auto-columns: max-content;
    gap: 8px;
    padding-right: 18px;
  }

  .query-tabs button,
  .query-tab {
    min-width: 72px;
    padding: 0 14px;
  }

  .query-card {
    min-height: 132px;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 38px 16px 12px;
  }

  .query-card-thumb {
    width: 76px;
    height: 90px;
    font-size: 25px;
  }

  .query-page--vat .vat-search-tabs {
    gap: 7px;
  }

  .query-page--vat .vat-search-tabs button {
    height: 38px;
    font-size: 13px;
  }

  .product-search-bar {
    grid-template-columns: minmax(0, 1fr) 58px 66px;
    gap: 7px;
  }

  .product-search-button,
  .product-filter-button {
    font-size: 14px;
  }

  .product-search-panel {
    padding: 16px 20px 26px;
  }

  .product-search-tabs {
    grid-auto-columns: minmax(66px, max-content);
    gap: 8px;
  }

  .product-search-tabs button {
    min-width: 66px;
    padding: 0 14px;
  }

  .product-search-page .merch-product-card {
    min-height: 138px;
    grid-template-columns: 82px 1fr;
    gap: 14px;
    padding: 18px 40px 18px 14px;
  }

  .product-search-page .merch-product-image {
    width: 82px;
    height: 96px;
  }

  .product-search-page .merch-product-card p {
    font-size: 18px;
  }

  .vat-search-hero {
    padding: 20px 12px 16px;
  }

  .vat-search-bar {
    grid-template-columns: minmax(0, 1fr) 58px 66px;
    gap: 7px;
  }

  .vat-search-tabs {
    gap: 7px;
  }

  .vat-search-tabs button {
    height: 38px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .vat-hero {
    padding-inline: 20px;
    padding-bottom: 86px;
  }

  .vat-detail-content {
    padding-inline: 12px;
    margin-top: -64px;
  }

  .vat-main-code {
    font-size: 34px;
  }

  .vat-subtitle {
    font-size: 18px;
  }

  .vat-header-action {
    min-width: 104px;
    height: 42px;
    font-size: 16px;
  }

  .vat-card-title-row h2 {
    font-size: 22px;
  }

  .vat-update-row {
    grid-template-columns: 60px 20px minmax(70px, 1fr) auto;
    gap: 8px;
  }

  .vat-update-row time,
  .vat-update-row b {
    font-size: 16px;
  }

  .vat-update-row strong,
  .vat-info-row span {
    font-size: 17px;
  }

  .vat-info-head,
  .vat-info-row {
    grid-template-columns: .85fr 1.35fr .9fr;
  }

  .vat-info-row strong,
  .vat-info-row b {
    font-size: 16px;
  }
}

.content.no-tab:has(.ref-detail-page) {
  padding: 0 !important;
  background: #f4f6f9;
}

.workspace:has(.ref-detail-page) {
  display: block;
  background: #f4f6f9;
}

.app:has(.ref-detail-page) {
  width: 100%;
  max-width: none;
}

input,
textarea,
select,
[contenteditable="true"],
.search-input,
.search-bar input,
.stock-search input,
.product-search-field input,
.query-search-input input,
.query-search-input .order-search-input,
.order-search-card input,
.order-search-input,
.filter-date-range input,
.filter-search-input,
.merch-search-row input,
.merch-form-card input,
.merch-form-card select,
.merch-form-card textarea,
.field input,
.field select,
.field textarea,
.search-row input,
.password-control input,
.order-form-card input,
.order-form-card select,
.order-form-card textarea,
.arrival-form-field input,
.arrival-form-field select,
.arrival-form-field textarea,
.arrival-form-control input,
.arrival-form-control select,
.input-box,
.select-box,
.price-modal-form input,
.price-modal-form select,
.price-modal-form textarea {
  font-size: 16px !important;
  line-height: normal !important;
}

.order-card-list,
.vat-result-list,
.product-result-list,
.stock-update-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.query-page--order .order-total-card,
.vat-search-page .merch-vat-card,
.product-search-page .merch-product-card,
.query-page--stock .stock-update-item {
  position: relative;
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  color: #111827;
  text-align: left;
}

.query-page--order .order-total-card .query-card-thumb,
.vat-search-page .merch-thumb,
.product-search-page .merch-product-image,
.query-page--stock .stock-card-thumb {
  display: none !important;
}

.query-page--order .query-card-arrow,
.vat-search-page .query-card-arrow,
.product-search-page .query-card-arrow,
.query-page--stock .query-card-arrow {
  width: 22px;
  height: 22px;
  color: #8a94a6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: end;
  font-size: 0;
  background: transparent;
}

.query-page--order .query-card-arrow svg,
.vat-search-page .query-card-arrow svg,
.product-search-page .query-card-arrow svg,
.query-page--stock .query-card-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.8;
}

.query-page--order .order-card-content,
.vat-search-page .merch-vat-card-body,
.product-search-page .merch-product-card-body,
.query-page--stock .stock-card-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.query-page--order .order-card-header,
.vat-search-page .merch-order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.query-page--order .order-code,
.vat-search-page .merch-vat-card h3,
.product-search-page .merch-product-card h3,
.query-page--stock .stock-update-item strong {
  margin: 0;
  color: #111827;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0;
}

.query-page--order .order-customer,
.vat-search-page .merch-vat-card p,
.product-search-page .merch-product-card p,
.query-page--stock .stock-update-item em {
  margin: 0;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 700;
}

.query-page--order .order-info-box {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed #e5eaf2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.query-page--order .order-main-info {
  color: #111827;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
}

.query-page--order .order-sub-info {
  color: #8a94a6;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.query-page--order .order-status-badge,
.vat-search-page .merch-tag {
  flex: 0 0 auto;
  min-width: 56px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
}

.query-page--order .order-status-badge.badge-blue,
.vat-search-page .merch-tag.vat {
  background: #eaf2ff;
  color: #1d64ff;
}

.query-page--order .order-status-badge.badge-red,
.vat-search-page .merch-tag.risk {
  background: #fff1f2;
  color: #dc2626;
}

.query-page--order .order-status-badge.badge-green,
.vat-search-page .merch-tag.done {
  background: #ecfdf3;
  color: #16a34a;
}

.query-page--order .order-status-badge.badge-orange,
.vat-search-page .merch-tag.todo {
  background: #fff7ed;
  color: #ea580c;
}

.vat-search-page .merch-tag.doing,
.vat-search-page .merch-tag.ship {
  background: #eaf2ff;
  color: #1d64ff;
}

.vat-search-page .merch-vat-card p + p,
.query-page--stock .stock-change-line {
  padding-top: 8px;
  border-top: 1px dashed #e5eaf2;
}

.product-search-page .merch-product-card {
  grid-template-columns: minmax(0, 1fr) 22px;
}

.product-search-page .merch-product-card .merch-order-top {
  align-items: center;
}

.product-search-page .merch-product-card p {
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.product-search-page .merch-product-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.product-search-page .merch-product-grid span {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.product-search-page .merch-product-grid span + span::before {
  content: "·";
  margin-right: 6px;
  color: #c4cad4;
}

.product-search-page .merch-product-grid b {
  flex-basis: 100%;
  margin-top: 2px;
  color: #1d64ff;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 900;
}

.query-page--stock .stock-change-line,
.query-page--stock .stock-live-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.query-page--stock .stock-change-line i,
.query-page--stock .stock-live-line i {
  color: #8a94a6;
  font-style: normal;
}

.query-page--stock .stock-change-line b,
.query-page--stock .stock-live-line b {
  text-align: left;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 900;
}

.query-page--stock .stock-change-line b.up {
  color: #16a34a;
}

.query-page--stock .stock-change-line b.down {
  color: #dc2626;
}

.query-page--stock .stock-live-line b {
  color: #111827;
}

.bottom-bar,
.screen:has(.alipay-home) .bottom-bar,
.bottom-bar.arrival-bottom-bar {
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(calc(100% - 48px), 382px);
  height: 78px;
  padding: 8px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(14px);
}

.nav-btn,
.screen:has(.alipay-home) .nav-btn,
.bottom-bar.arrival-bottom-bar .nav-btn {
  min-height: 62px;
  border-radius: 24px;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
}

.nav-btn b,
.screen:has(.alipay-home) .nav-btn b,
.bottom-bar.arrival-bottom-bar .nav-btn b {
  line-height: 1;
}

.nav-btn b svg,
.screen:has(.alipay-home) .nav-btn b svg,
.bottom-bar.arrival-bottom-bar .nav-btn b svg {
  width: 28px;
  height: 28px;
}

.nav-btn span,
.screen:has(.alipay-home) .nav-btn span,
.bottom-bar.arrival-bottom-bar .nav-btn span {
  font-size: 13px;
  line-height: 1.1;
}

.nav-btn.active,
.screen:has(.alipay-home) .nav-btn.active,
.bottom-bar.arrival-bottom-bar .nav-btn.active {
  color: #1d64ff;
  background: #eaf2ff;
}

.merch-vat-list-page .merch-vat-detail-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}

.merch-vat-list-page .merch-vat-card-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.merch-vat-list-page .merch-vat-card-head {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.merch-vat-list-page .merch-vat-card-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.merch-vat-list-page .merch-vat-order,
.merch-vat-list-page .merch-vat-main,
.merch-vat-list-page .merch-vat-meta {
  width: 100%;
  text-align: left;
  margin: 0;
}

.merch-vat-list-page .merch-vat-order {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  color: #6b7280;
}

.merch-vat-list-page .merch-vat-order i {
  width: 1px;
  height: 13px;
  background: #d1d5db;
}

.merch-vat-list-page .merch-vat-main {
  color: #111827;
  font-weight: 900;
}

.merch-vat-list-page .merch-vat-arrow {
  position: static;
  transform: none;
  justify-self: end;
  align-self: center;
  color: #8a94a6;
}

.order-related-vat-section .detail-card-title span {
  color: #1d64ff;
  font-size: 15px;
  font-weight: 900;
}

.order-related-vat-summary {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f5f8ff;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6b7280;
  font-size: 15px;
  font-weight: 800;
}

.order-related-vat-summary strong {
  color: #111827;
  font-weight: 900;
}

.order-related-vat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-related-vat-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid #e5eaf3;
  border-radius: 18px;
  background: #fff;
  text-align: left;
}

.order-related-vat-card.repair {
  border-color: #f4c7b8;
  background: #fffaf8;
  box-shadow: inset 4px 0 0 #f97316;
}

.order-related-vat-card.repair .order-related-vat-head strong {
  color: #c2410c;
}

.order-related-vat-head {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.order-related-vat-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.order-related-vat-line,
.order-related-vat-main,
.order-related-vat-meta {
  grid-column: 1;
  display: block;
  text-align: left;
}

.order-related-vat-line,
.order-related-vat-meta {
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
}

.order-related-vat-main {
  color: #111827;
  font-size: 16px;
  font-weight: 900;
}

.order-related-vat-card .query-card-arrow {
  grid-column: 2;
  grid-row: 1 / span 4;
  justify-self: end;
  align-self: center;
  color: #8a94a6;
}

/* Reusable compact form system: order creation */
.order-form-screen {
  --form-primary: #1677ff;
  --form-ink: #111827;
  --form-muted: #667085;
  --form-placeholder: #98a2b3;
  --form-line: #e9edf3;
  --form-danger: #ff3b30;
  --form-bg: #f6f7fb;
  background: var(--form-bg);
  overflow: hidden;
}

.order-form-page {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--form-bg);
  color: var(--form-ink);
}

.order-form-header {
  position: relative;
  z-index: 20;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  background: rgba(246, 247, 251, 0.96);
  border-bottom: 1px solid rgba(233, 237, 243, 0.78);
  backdrop-filter: blur(12px);
}

.order-form-header h1 {
  margin: 0;
  color: var(--form-ink);
  font-size: 18px;
  line-height: 1.2;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0;
}

.order-header-action {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--form-ink);
}

.order-header-action:focus-visible,
.recognition-main:focus-visible,
.recognition-actions button:focus-visible,
.compact-form-row.clickable:focus-visible,
.inline-picker-button:focus-visible,
.double-select:focus-visible,
.order-add-line-button:focus-visible,
.save-order-button:focus-visible,
.order-bottom-sheet button:focus-visible,
.order-bottom-sheet input:focus-visible,
.order-bottom-sheet textarea:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.24);
  outline-offset: 2px;
}

.order-header-action svg {
  width: 26px;
  height: 26px;
}

.order-header-close {
  background: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}

.order-form-scroll {
  height: calc(100svh - 56px - env(safe-area-inset-top));
  padding: 12px 16px calc(100px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  overscroll-behavior: contain;
  scroll-padding: 20px 0 calc(118px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.recognition-card,
.compact-form-section {
  width: 100%;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}

.recognition-card {
  min-height: 104px;
  padding: 14px 14px 12px;
  display: grid;
  grid-template-rows: minmax(48px, 1fr) 32px;
  gap: 8px;
}

.recognition-main {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 10px;
  background: transparent;
  text-align: left;
}

.recognition-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #edf5ff;
  color: var(--form-primary);
}

.recognition-icon svg,
.recognition-edit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recognition-copy {
  min-width: 0;
  padding-top: 2px;
  color: var(--form-placeholder);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recognition-copy.has-content {
  color: var(--form-ink);
}

.recognition-edit {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--form-muted);
}

.recognition-actions {
  display: flex;
  justify-content: flex-end;
}

.recognition-actions button {
  min-width: 76px;
  height: 32px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--form-primary);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
}

.compact-form-section {
  margin-top: 12px;
  overflow: hidden;
}

.compact-section-header,
.order-item-card-header {
  min-height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--form-line);
}

.compact-section-header h2,
.order-item-card-header h2 {
  min-width: 0;
  margin: 0;
  color: var(--form-ink);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
}

.compact-section-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.compact-section-header h2 i {
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--form-primary);
}

.compact-section-body {
  padding: 0 16px;
}

.compact-form-row-wrap {
  border-bottom: 1px solid var(--form-line);
}

.compact-form-row-wrap:last-child {
  border-bottom: 0;
}

.compact-form-row {
  width: 100%;
  min-height: 52px;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--form-ink);
  text-align: left;
}

.compact-form-row.multiline {
  min-height: 58px;
  align-items: start;
  padding: 11px 0 9px;
}

.form-row-label {
  color: var(--form-muted);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 400;
}

.form-row-label em {
  margin-left: 3px;
  color: var(--form-danger);
  font-size: 13px;
  font-style: normal;
}

.form-row-control {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.form-row-display {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.form-row-value,
.form-row-placeholder {
  min-width: 0;
  overflow: hidden;
  color: var(--form-ink);
  font-size: 15px;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.form-row-placeholder {
  color: var(--form-placeholder);
  font-weight: 400;
}

.form-row-display.readonly .form-row-value {
  color: #344054;
}

.form-row-arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #98a2b3;
}

.form-row-arrow svg,
.inline-picker-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-row-control input,
.form-row-control textarea {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--form-ink);
  font-size: 16px;
  line-height: 1.35;
  text-align: right;
  font-weight: 500;
  box-shadow: none;
}

.form-row-control textarea {
  height: 36px;
  min-height: 36px;
  max-height: 108px;
  padding: 7px 0 3px;
  resize: none;
  overflow-y: auto;
}

.form-row-control input::placeholder,
.form-row-control textarea::placeholder {
  color: var(--form-placeholder);
  font-weight: 400;
  opacity: 1;
}

.form-row-control input:focus,
.form-row-control textarea:focus {
  box-shadow: inset 0 -2px 0 var(--form-primary);
}

.form-row-control.with-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 4px;
}

.inline-picker-button {
  width: 28px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: #98a2b3;
}

.compact-form-row-wrap.has-error {
  border-bottom-color: rgba(255, 59, 48, 0.5);
}

.form-row-error {
  display: block;
  margin: -3px 0 7px 106px;
  color: var(--form-danger);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
}

.order-items-stack {
  margin-top: 0;
  gap: 0;
}

.order-item-card {
  margin-top: 12px;
}

.order-item-card-header {
  gap: 10px;
}

.order-index {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--form-primary);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
}

.order-item-card-header h2 {
  flex: 1;
  font-size: 16px;
}

.delete-order-item {
  min-width: 64px;
  height: 36px;
  padding: 0 4px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  background: transparent;
  color: var(--form-danger);
  font-size: 13px;
  font-weight: 500;
}

.delete-order-item svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-double-row {
  grid-template-columns: 70px minmax(70px, 1fr) 1px 38px 58px;
  gap: 8px;
}

.double-divider {
  width: 1px;
  height: 24px;
  background: var(--form-line);
}

.double-label {
  color: var(--form-muted);
  font-size: 14px;
}

.double-select {
  min-width: 0;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  background: transparent;
  color: var(--form-ink);
  font-size: 15px;
  font-weight: 500;
}

.double-select span,
.double-select svg {
  width: 16px;
  height: 16px;
  color: #98a2b3;
}

.double-select svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-paired-input-row {
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
}

.compact-paired-input-row > i {
  width: 1px;
  height: 34px;
  align-self: center;
  background: var(--form-line);
}

.compact-paired-input-row label,
.compact-paired-input-row .compact-pair-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--form-muted);
  font-size: 14px;
}

.compact-paired-input-row label > span:first-child {
  white-space: nowrap;
}

.compact-paired-input-row label em,
.compact-paired-input-row .compact-pair-field em,
.inventory-roll-label em {
  margin-left: 2px;
  color: var(--form-danger);
  font-style: normal;
}

.compact-split-field-row .compact-pair-field {
  grid-template-columns: 62px minmax(0, 1fr);
}

.compact-split-field-row .compact-pair-field > span:first-child {
  white-space: nowrap;
}

.compact-paired-input-row input {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--form-ink);
  font-size: 16px;
  text-align: right;
  font-weight: 500;
}

.compact-paired-input-row input:focus {
  box-shadow: inset 0 -2px 0 var(--form-primary);
}

.paired-error {
  margin-left: 0;
  text-align: right;
}

.compact-inline-select {
  min-width: 0;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  background: transparent;
  color: var(--form-ink);
}

.compact-inline-select b {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.compact-inline-select b.placeholder {
  color: var(--form-placeholder);
  font-weight: 400;
}

.compact-inline-select svg,
.compact-pair-control button svg,
.inventory-unit-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: #98a2b3;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-pair-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.compact-pair-control.with-picker {
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 2px;
}

.compact-pair-control button {
  width: 26px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
}

.inventory-quantity-row {
  grid-template-columns: 44px minmax(54px, 1fr) 54px 1px 36px minmax(48px, .75fr);
  gap: 7px;
}

.inventory-quantity-row > input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--form-ink);
  font-size: 16px;
  text-align: right;
  font-weight: 500;
}

.inventory-quantity-row > input:focus {
  box-shadow: inset 0 -2px 0 var(--form-primary);
}

.inventory-quantity-row > i {
  width: 1px;
  height: 24px;
  background: var(--form-line);
}

.inventory-unit-button {
  min-width: 0;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  background: transparent;
  color: var(--form-ink);
  font-size: 15px;
  font-weight: 500;
}

.inventory-roll-label {
  color: var(--form-muted);
  font-size: 14px;
  white-space: nowrap;
}

.inventory-compact-remark .form-row-control {
  position: relative;
  padding-bottom: 16px;
}

.inventory-compact-remark .form-row-control textarea {
  min-height: 52px;
  padding-right: 2px;
}

.inventory-compact-remark .inventory-remark-count {
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--form-placeholder);
  font-size: 11px;
  line-height: 1;
}

.order-add-line-button {
  width: 100%;
  height: 52px;
  margin-top: 12px;
  border: 1.5px dashed rgba(22, 119, 255, 0.62);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #fff;
  color: var(--form-primary);
  font-size: 15px;
  font-weight: 600;
}

.order-add-line-button span {
  font-size: 21px;
  line-height: 1;
}

.fixed-bottom-action {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 1000;
  width: 100%;
  max-width: 430px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--form-line);
  background: rgba(246, 247, 251, 0.96);
  box-sizing: border-box;
  backdrop-filter: blur(10px);
}

.save-order-button {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(90deg, #2d7dff, #176bff);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.2);
}

.save-order-button:disabled {
  cursor: wait;
  background: #b8c6db;
  box-shadow: none;
}

.button-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: order-spin 0.7s linear infinite;
}

@keyframes order-spin {
  to { transform: rotate(360deg); }
}

.order-sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(17, 24, 39, 0.42);
}

.order-bottom-sheet {
  width: 100%;
  max-width: 430px;
  max-height: min(84svh, 760px);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: #fff;
  color: var(--form-ink);
  box-shadow: 0 -12px 40px rgba(17, 24, 39, 0.14);
  animation: order-sheet-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes order-sheet-in {
  from { transform: translateY(22px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 5px;
  border-radius: 3px;
  display: block;
  background: #d0d5dd;
}

.sheet-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-header h2 {
  margin: 0;
  color: var(--form-ink);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 600;
}

.sheet-header button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: var(--form-ink);
  font-size: 24px;
  line-height: 1;
}

.recognition-input-sheet > textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  border: 1px solid #dfe5ed;
  border-radius: 14px;
  outline: 0;
  resize: vertical;
  background: #f8fafc;
  color: var(--form-ink);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
}

.recognition-input-sheet > textarea:focus {
  border-color: var(--form-primary);
  background: #fff;
}

.recognition-sheet-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 74px 74px minmax(0, 1fr);
  gap: 10px;
}

.recognition-sheet-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recognition-sheet-actions button {
  height: 46px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 600;
}

.sheet-secondary,
.sheet-tertiary {
  background: #f2f4f7;
  color: #475467;
}

.sheet-tertiary {
  color: var(--form-danger);
}

.sheet-primary {
  background: var(--form-primary);
  color: #fff;
}

.result-header {
  align-items: flex-start;
  padding: 5px 0 10px;
}

.result-header p {
  margin: 5px 0 0;
  color: var(--form-muted);
  font-size: 13px;
}

.recognition-base-grid,
.recognition-result-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.recognition-base-grid {
  padding: 12px;
  border-radius: 14px;
  background: #f6f8fb;
}

.recognition-result-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.recognition-result-item {
  position: relative;
  padding: 14px 12px 12px;
  border: 1px solid var(--form-line);
  border-radius: 14px;
}

.recognition-result-item > strong {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf5ff;
  color: var(--form-primary);
  font-size: 12px;
}

.recognition-base-grid label,
.recognition-result-item label {
  min-width: 0;
  color: var(--form-muted);
  font-size: 12px;
  line-height: 1.3;
}

.recognition-base-grid label.wide,
.recognition-result-item label.wide {
  grid-column: 1 / -1;
}

.recognition-base-grid input,
.recognition-result-item input,
.recognition-result-item select {
  width: 100%;
  height: 38px;
  margin-top: 4px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid #dfe5ed;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--form-ink);
  font-size: 16px;
  font-weight: 500;
}

.order-select-search-wrap {
  height: 46px;
  padding: 0 13px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f2f4f7;
}

.order-select-search-wrap svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: #98a2b3;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.order-select-search {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--form-ink);
  font-size: 16px;
}

.order-select-list {
  max-height: min(56svh, 460px);
  margin-top: 10px;
  overflow-y: auto;
}

.compact-select-search-wrap {
  height: 46px;
  padding: 0 13px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f2f4f7;
}

.compact-select-search-wrap svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: #98a2b3;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-select-search {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--form-ink);
  font-size: 16px;
}

.compact-select-list {
  max-height: min(56svh, 460px);
  margin-top: 10px;
  overflow-y: auto;
}

.compact-select-option,
.compact-select-manual {
  width: 100%;
  min-height: 58px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--form-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  color: var(--form-ink);
  text-align: left;
}

.compact-select-option[hidden],
.compact-select-manual[hidden] {
  display: none;
}

.compact-select-option > span,
.compact-select-manual > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.compact-select-option strong,
.compact-select-manual strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.compact-select-option small,
.compact-select-manual small {
  overflow: hidden;
  color: var(--form-muted);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-select-option > i {
  width: 26px;
  flex: 0 0 auto;
  color: var(--form-primary);
  text-align: center;
  font-size: 18px;
  font-style: normal;
}

.compact-select-option.selected strong {
  color: var(--form-primary);
}

.compact-select-manual {
  color: var(--form-primary);
}

.compact-select-manual svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.compact-select-empty {
  display: none;
  padding: 24px 8px 10px;
  color: var(--form-muted);
  text-align: center;
  font-size: 14px;
}

.compact-select-empty.show {
  display: block;
}

.order-select-option {
  width: 100%;
  min-height: 58px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--form-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  color: var(--form-ink);
  text-align: left;
}

.order-select-option[hidden] {
  display: none;
}

.order-select-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.order-select-option strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.order-select-option small {
  overflow: hidden;
  color: var(--form-muted);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-select-option b {
  width: 26px;
  flex: 0 0 auto;
  color: var(--form-primary);
  text-align: center;
  font-size: 18px;
}

.order-select-option.selected strong {
  color: var(--form-primary);
}

.order-choice-dialog {
  width: min(calc(100% - 40px), 360px);
  margin: auto;
  padding: 22px;
  border-radius: 18px;
  display: grid;
  gap: 10px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.2);
}

.order-choice-dialog h2 {
  margin: 0;
  color: var(--form-ink);
  font-size: 19px;
  font-weight: 600;
}

.order-choice-dialog p {
  margin: 0 0 4px;
  color: var(--form-muted);
  font-size: 14px;
}

.order-choice-dialog button {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: #f2f4f7;
  color: #475467;
  font-size: 15px;
  font-weight: 600;
}

.order-choice-dialog .choice-primary {
  background: var(--form-primary);
  color: #fff;
}

.order-choice-dialog .choice-danger {
  background: #fff1f0;
  color: var(--form-danger);
}

@media (max-width: 375px) {
  .order-form-scroll {
    padding-right: 12px;
    padding-left: 12px;
  }

  .compact-form-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }

  .compact-double-row {
    grid-template-columns: 58px minmax(60px, 1fr) 1px 34px 54px;
    gap: 6px;
  }

  .compact-paired-input-row {
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 9px;
  }

  .compact-paired-input-row label,
  .compact-paired-input-row .compact-pair-field {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 4px;
    font-size: 13px;
  }

  .compact-split-field-row .compact-pair-field {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .inventory-quantity-row {
    grid-template-columns: 40px minmax(48px, 1fr) 50px 1px 32px minmax(44px, .72fr);
    gap: 5px;
  }

  .form-row-error {
    margin-left: 90px;
  }

  .recognition-sheet-actions {
    grid-template-columns: 64px 64px minmax(0, 1fr);
    gap: 8px;
  }
}

/* iOS WebView/Safari 会在聚焦小于 16px 的表单控件时自动放大页面。 */
@media (max-width: 767px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-form-screen,
  .order-bottom-sheet,
  .button-spinner {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
