:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #1f2937;
  background: #e9eef5;
  --blue: #2563eb;
  --green: #22a35a;
  --orange: #f59e0b;
  --red: #ef4444;
  --line: #dce3eb;
  --muted: #6b7280;
  --soft: #f6f8fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.material-symbols-rounded {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone {
  position: relative;
  width: min(100%, 390px);
  height: min(844px, calc(100vh - 36px));
  min-height: 720px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(31, 41, 55, .12);
  border-radius: 22px;
  box-shadow: 0 18px 52px rgba(15, 23, 42, .18);
}

.statusbar {
  height: 34px;
  flex: 0 0 34px;
  padding: 8px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.statusbar span:last-child {
  display: flex;
  gap: 2px;
}

.statusbar .material-symbols-rounded {
  font-size: 12px;
}

.content {
  flex: 1;
  overflow: auto;
  padding: 12px 12px 84px;
  background: linear-gradient(#fff 0 46px, #f4f7fb 46px);
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 6px 14px;
}

.app-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.app-header p {
  margin: 7px 0 0;
  max-width: 270px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sync-pill,
.small-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #caead8;
  border-radius: 8px;
  color: #16864a;
  background: #f0fdf6;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.sync-pill span {
  color: #5c6b73;
  font-weight: 500;
}

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

.mode-card {
  min-height: 164px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color .2s, background .2s;
}

.mode-card.is-active.mode-blue {
  border-color: var(--blue);
  background: #f7faff;
}

.mode-card.is-active.mode-green {
  border-color: var(--green);
  background: #f7fef9;
}

.mode-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mode-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--blue);
}

.mode-green .mode-icon {
  background: #eaf8ef;
  color: var(--green);
}

.mode-check {
  color: #9aa4b2;
}

.is-active.mode-blue .mode-check {
  color: var(--blue);
}

.is-active.mode-green .mode-check {
  color: var(--green);
}

.mode-card > strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
  line-height: 1.2;
}

.mode-card > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.mode-divider {
  height: 1px;
  margin: 11px 0;
  background: var(--line);
}

.mode-preview {
  display: grid;
  gap: 5px;
  color: #374151;
  font-size: 12px;
  line-height: 1.4;
}

.mini-result {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-result img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 7px;
  background: #eef2f6;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #e9f9ef;
  color: #16864a;
  font-size: 12px;
  font-weight: 800;
}

.chip-blue {
  background: #eaf2ff;
  color: var(--blue);
}

.chip-orange {
  background: #fff4df;
  color: #b45309;
}

.chip-red {
  background: #fff1f2;
  color: var(--red);
}

.scanner-panel,
.data-block,
.upload-box,
.photo-section,
.hero-product,
.after-hero,
.priority-box,
.info-list,
.list-group {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scanner-panel {
  padding: 14px 12px;
  background: #f8fafc;
}

.scanner-panel > p {
  margin: 0 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.scanner-grid {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  grid-template-rows: 76px 76px;
  align-items: center;
  gap: 8px 12px;
}

.round-tool {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #4b5563;
  font-size: 12px;
}

.round-tool .material-symbols-rounded {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.round-tool:nth-of-type(2),
.round-tool:nth-of-type(4) {
  grid-column: 3;
}

.scan-window {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 3;
  height: 142px;
  border: 1px solid #d6e3f5;
  background: #fff;
  color: var(--blue);
  overflow: hidden;
}

.scan-window strong {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 52px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .78);
  font-size: 15px;
}

.live-scanner {
  position: relative;
  height: 220px;
  margin: 8px 0 12px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #020617;
}

.live-scanner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background:
    linear-gradient(rgba(2, 6, 23, .52), rgba(2, 6, 23, .18) 34%, rgba(2, 6, 23, .18) 66%, rgba(2, 6, 23, .52));
}

.live-mask span {
  width: min(78%, 320px);
  height: 96px;
  border: 3px solid #60a5fa;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(2, 6, 23, .22), inset 0 0 16px rgba(96, 165, 250, .36);
}

.live-close {
  position: absolute;
  right: 10px;
  top: 10px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .72);
  font-size: 13px;
  font-weight: 800;
}

.live-scanner > strong {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, .72);
  font-size: 13px;
  text-align: center;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 72px;
  height: 2px;
  background: #73a9ff;
  box-shadow: 0 0 12px #73a9ff;
}

.corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--blue);
  border-style: solid;
}

.corner-tl { left: 10px; top: 10px; border-width: 4px 0 0 4px; }
.corner-tr { right: 10px; top: 10px; border-width: 4px 4px 0 0; }
.corner-bl { left: 10px; bottom: 10px; border-width: 0 0 4px 4px; }
.corner-br { right: 10px; bottom: 10px; border-width: 0 4px 4px 0; }

.scanner-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.scan-form {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
  margin-bottom: 12px;
}

.scan-input {
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #111827;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.scan-input.full {
  width: 100%;
  margin: 0;
}

.inline-input {
  width: 100%;
  margin: 0;
}

.scan-query {
  min-height: 42px;
  padding: 0;
}

.scan-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.scanner-grid.compact {
  grid-template-columns: 52px 1fr 52px;
  grid-template-rows: 106px;
}

.scanner-grid.compact .scan-window {
  height: 106px;
}

.scanner-grid.compact .scan-window strong {
  margin-top: 38px;
}

.scanner-grid.compact .round-tool:nth-of-type(2) {
  grid-column: 3;
}

.scanner-grid.compact .round-tool {
  grid-row: 1;
}

.scan-message {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 13px;
  font-weight: 700;
}

.image-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #edf2f7;
}

.image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity .18s ease;
}

.image-frame.is-loaded img {
  opacity: 1;
}

.image-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end stretch;
  background: linear-gradient(90deg, #edf2f7 0%, #f8fafc 50%, #edf2f7 100%);
  background-size: 220% 100%;
  animation: image-wait 1.15s linear infinite;
}

.image-loader i {
  height: 3px;
  display: block;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  animation: image-line 1.1s ease-in-out infinite;
}

.image-frame.is-loaded .image-loader,
.image-frame.is-error .image-loader {
  display: none;
}

.image-fail {
  position: absolute;
  inset: auto 6px 6px;
  display: none;
  padding: 4px 6px;
  border-radius: 6px;
  color: #991b1b;
  background: rgba(254, 226, 226, .92);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.image-frame.is-error .image-fail {
  display: block;
}

@keyframes image-wait {
  to { background-position: -220% 0; }
}

@keyframes image-line {
  0% { width: 12%; transform: translateX(0); }
  50% { width: 58%; transform: translateX(42%); }
  100% { width: 12%; transform: translateX(88%); }
}

.empty-images {
  display: grid;
  gap: 6px;
  margin: 12px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.empty-images span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.managed-images {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.image-item {
  display: grid;
  grid-template-columns: 72px 1fr 52px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.image-item div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.image-item span,
.image-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.image-item button {
  min-height: 34px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  color: #dc2626;
  background: #fff5f5;
  font-weight: 800;
}

.section-title {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.section-title.static {
  cursor: default;
}

.section-title span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.summary-preview,
.product-preview,
.after-preview {
  width: 100%;
  display: grid;
  padding: 12px;
  text-align: left;
}

.summary-preview {
  gap: 10px;
}

.chain-grid {
  display: grid;
  gap: 0;
}

.chain-grid div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.chain-grid div:first-child {
  border-top: 0;
}

.chain-grid span {
  color: var(--muted);
}

.chain-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-summary-preview {
  grid-template-columns: 86px 1fr;
  gap: 12px;
}

.product-thumb-frame {
  width: 86px;
  height: 86px;
}

dl {
  margin: 0;
}

.summary-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.kv-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.kv-line span,
.kv-grid span {
  color: var(--muted);
  font-weight: 700;
}

.kv-line strong,
.kv-grid strong {
  min-width: 0;
  color: #273142;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.kv-grid div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.summary-tags b {
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 6px;
  color: #334155;
  background: #f1f5f9;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-bar {
  position: sticky;
  top: -12px;
  z-index: 2;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  min-height: 46px;
  margin: -12px -12px 12px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  text-align: center;
}

.detail-bar strong {
  font-size: 18px;
}

.detail-bar button {
  min-height: 36px;
  color: var(--blue);
  font-weight: 800;
}

.hero-product {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 14px;
  padding: 12px;
}

.hero-image-frame {
  width: 122px;
  height: 122px;
}

.hero-product h2,
.after-hero h2 {
  margin: 12px 0 6px;
  font-size: 22px;
  line-height: 1.25;
}

.hero-product p,
.after-hero p {
  margin: 0;
  color: var(--muted);
}

.info-list {
  overflow: hidden;
}

.info-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row span {
  color: var(--muted);
}

.info-row strong {
  font-size: 14px;
  line-height: 1.45;
}

.photo-section {
  padding-bottom: 12px;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}

.photo-grid button {
  display: grid;
  gap: 7px;
  text-align: left;
  font-weight: 700;
}

.grid-image-frame {
  width: 100%;
  aspect-ratio: 1;
}

.primary-line,
.primary-action {
  width: calc(100% - 24px);
  min-height: 44px;
  margin: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
  font-weight: 800;
}

.primary-action {
  margin-top: 12px;
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.primary-action:disabled,
.admin-primary:disabled {
  cursor: wait;
  opacity: .68;
}

.upload-progress,
.admin-progress {
  margin: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.upload-progress div,
.admin-progress div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #1e3a8a;
  font-weight: 900;
}

.upload-progress > i,
.admin-progress > i {
  height: 8px;
  max-width: 100%;
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  transition: width .18s ease;
}

.upload-progress small,
.admin-progress small {
  color: #516174;
  line-height: 1.4;
}

.admin-progress {
  margin: 12px 16px 0;
}

.after-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px;
}

.after-hero span {
  color: var(--muted);
  font-weight: 700;
}

.priority-box {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  overflow: hidden;
}

.priority-box div {
  padding: 12px;
  border-right: 1px solid var(--line);
}

.priority-box div:last-child {
  border-right: 0;
}

.priority-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.priority-box strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.3;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
  padding: 0 6px;
}

.filter-row button,
.upload-types button {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #4b5563;
  background: #fff;
  font-weight: 700;
}

.filter-row button small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
}

.filter-row .active,
.upload-types .active {
  color: var(--blue);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.list-group {
  overflow: hidden;
}

.product-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 6px;
}

.product-search {
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px 1fr 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-search .material-symbols-rounded {
  color: var(--muted);
}

.product-search input {
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  color: #111827;
  font: inherit;
  font-size: 14px;
  background: transparent;
}

.product-search button {
  width: 34px;
  height: 34px;
  color: var(--muted);
}

.product-filter-row {
  margin: 0;
  padding: 0;
}

.product-filter-row button {
  min-height: 34px;
}

.product-tool-note,
.list-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.list-count {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

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

.list-image-frame,
.list-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: var(--blue);
}

.list-row strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}

.list-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.list-row em {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.upload-box {
  padding: 12px;
}

.upload-box .field-label {
  margin: 10px 0 6px;
}

.upload-main {
  width: 100%;
  min-height: 158px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
}

.upload-main .material-symbols-rounded {
  font-size: 42px;
}

.upload-main strong {
  font-size: 20px;
}

.upload-main span {
  color: var(--muted);
  font-size: 13px;
}

.upload-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.upload-quality {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.upload-quality button {
  min-height: 68px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.upload-quality button.active {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.upload-quality strong {
  font-size: 16px;
  line-height: 1.2;
}

.upload-quality span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quality-tip {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.upload-file {
  min-height: 128px;
  margin-top: 12px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
  text-align: center;
  cursor: pointer;
}

.upload-file span {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.upload-file input {
  max-width: 260px;
  color: #374151;
}

.inspection-box {
  display: grid;
  gap: 12px;
}

.latest-inspection {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.latest-inspection strong {
  color: #166534;
  font-size: 15px;
}

.latest-inspection span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inspection-image-frame {
  width: 100%;
  min-height: 150px;
  max-height: 220px;
  margin-top: 4px;
  border-radius: 8px;
  background: #fff;
}

.inspection-history {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.inspection-history div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.inspection-history strong {
  color: var(--ink);
}

.compact-empty {
  padding: 12px;
  min-height: auto;
}

.loading {
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.bottom-nav {
  flex: 0 0 66px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  height: 66px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -8px 22px rgba(15, 23, 42, .08);
}

.bottom-nav button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.bottom-nav .active {
  color: var(--blue);
}

@media (max-width: 430px) {
  .shell {
    padding: 0;
    background: #fff;
  }

  .phone {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px 1fr;
  background: #f4f7fb;
  color: #1f2937;
}

.admin-sidebar {
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.admin-brand {
  display: grid;
  gap: 6px;
  padding: 0 10px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-brand strong {
  font-size: 20px;
}

.admin-brand span {
  color: var(--muted);
  font-size: 13px;
}

.admin-nav {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  color: #4b5563;
  font-weight: 800;
  text-align: left;
}

.admin-nav.active {
  color: var(--blue);
  background: #eff6ff;
}

.admin-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #eef2f7;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

.admin-nav.active .admin-icon,
.phone-link .admin-icon {
  color: var(--blue);
  background: #dbeafe;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.admin-top h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.admin-top p {
  margin: 8px 0 0;
  color: var(--muted);
}

.phone-link {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  text-decoration: none;
  font-weight: 800;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.phone-link.as-button {
  font: inherit;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f7fb;
}

.login-panel {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.login-brand {
  padding: 0 0 18px;
  margin-bottom: 2px;
}

.login-input {
  width: 100%;
  margin: 0;
}

.login-button {
  width: 100%;
  margin-top: 18px;
}

.login-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.login-phone {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
}

.scan-message.error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.password-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  padding: 16px;
}

.password-form .admin-input {
  width: 100%;
  margin: 0;
}

.admin-download {
  min-height: 42px;
  margin: 0 16px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--blue);
  background: #eff6ff;
  text-decoration: none;
  font-weight: 900;
}

.admin-file {
  margin: 16px;
}

.import-template-button {
  margin: 0 16px 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(340px, .95fr);
  gap: 16px;
}

.admin-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.panel-head {
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head strong {
  font-size: 18px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.field-label {
  display: block;
  margin: 16px 16px 8px;
  color: #4b5563;
  font-weight: 800;
}

.admin-input,
.admin-search {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
}

.admin-input {
  width: calc(100% - 32px);
  margin: 0 16px;
}

.admin-search {
  width: min(320px, 100%);
}

.drop-zone {
  min-height: 176px;
  width: calc(100% - 32px);
  margin: 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
}

.file-list {
  display: grid;
  padding: 4px 16px 0;
}

.file-list div {
  display: grid;
  grid-template-columns: 86px 1fr 58px 58px 104px auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.file-list div:last-child {
  border-bottom: 0;
}

.file-list span {
  color: var(--muted);
  font-weight: 800;
}

.file-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mini-upload {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--blue);
  background: #eff6ff;
  font-weight: 900;
  cursor: pointer;
}

.mini-link {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  color: var(--blue);
  background: #f8fbff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.mini-select {
  min-height: 34px;
  width: 104px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #334155;
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 0;
  border-top: 1px solid var(--line);
}

.admin-download.slim {
  margin: 0;
  min-height: 38px;
}

.mini-upload input {
  display: none;
}

.drop-zone .admin-icon {
  width: 54px;
  height: 54px;
  color: var(--blue);
  background: #dbeafe;
  font-size: 24px;
}

.drop-zone strong {
  font-size: 20px;
}

.drop-zone span {
  color: var(--muted);
}

.import-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
}

.admin-primary,
.admin-secondary {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.admin-primary {
  color: #fff;
  background: var(--blue);
}

.admin-secondary {
  border: 1px solid var(--line);
  background: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px;
}

.metric {
  min-height: 96px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-radius: 8px;
  background: #eff6ff;
}

.metric span {
  color: #4b5563;
  font-weight: 800;
}

.metric strong {
  color: var(--blue);
  font-size: 30px;
}

.metric-red {
  background: #fff1f2;
}

.metric-red strong {
  color: var(--red);
}

.metric-orange {
  background: #fff7ed;
}

.metric-orange strong {
  color: #ea580c;
}

.rule-list {
  display: grid;
  padding: 0 16px 16px;
}

.rule-list div,
.product-admin-grid div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.rule-list span,
.product-admin-grid span {
  color: var(--muted);
}

.rule-list strong,
.product-admin-grid strong {
  text-align: right;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.map-item {
  min-height: 54px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.map-item span {
  color: var(--muted);
}

.map-item b {
  color: var(--blue);
}

.map-item strong {
  color: #111827;
}

.admin-table,
.orders-table {
  overflow: auto;
}

.thead,
.trow {
  min-width: 900px;
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.admin-table .thead,
.admin-table .trow {
  grid-template-columns: 136px 130px 1.4fr 70px 70px 70px 70px 80px;
}

.orders-table .thead,
.orders-table .trow {
  grid-template-columns: 150px 140px 130px 1.3fr 120px 100px 90px;
}

.orders-table .image-head {
  grid-template-columns: 150px 1.3fr 120px 130px 1fr 150px;
}

.orders-table .scan-head {
  grid-template-columns: 180px 88px 1.2fr 180px 1fr 150px 92px;
}

.orders-table .inspection-head {
  grid-template-columns: 150px 1.2fr 130px 120px 1.2fr 96px 150px;
}

.inspection-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.inspection-issue {
  background: #fff7ed;
}

.thead {
  min-height: 42px;
  color: #64748b;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.trow {
  min-height: 54px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.scan-pending {
  background: #fff7ed;
}

.scan-pending span:first-child,
.scan-pending span:nth-child(3) {
  color: #9a3412;
  font-weight: 900;
}

.empty-admin {
  padding: 22px 16px;
  color: var(--muted);
  font-weight: 800;
}

.product-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 22px;
  padding: 0 16px 16px;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    display: flex;
    gap: 8px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-brand {
    min-width: 180px;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .admin-nav {
    min-width: 116px;
  }

  .admin-grid,
  .mapping-grid,
  .product-admin-grid {
    grid-template-columns: 1fr;
  }
}
