﻿:root {
  --ink: #101613;
  --muted: #66736d;
  --line: #dfe6e1;
  --soft: #f5f7f4;
  --panel: #ffffff;
  --green: #00553f;
  --green-2: #0b7359;
  --gold: #c69214;
  --red: #b42318;
  --blue: #2563eb;
  --shadow: 0 16px 40px rgba(16, 22, 19, 0.10);
  --font-main: "Times New Roman", SimSun, "宋体", serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Times New Roman", serif;
  font-family: var(--font-main);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #edf2ee;
  font-family: var(--font-main);
  overflow-x: hidden;
}

html[lang="zh"] body,
html[lang="zh"] button,
html[lang="zh"] input,
html[lang="zh"] select,
html[lang="zh"] textarea {
  font-family: var(--font-main);
}

body.lang-ur [data-i18n],
body.lang-ur button,
body.lang-ur label,
body.lang-ur input,
body.lang-ur select,
body.lang-ur textarea {
  font-family: var(--font-urdu);
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) minmax(700px, max-content);
  align-items: center;
  gap: 22px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.header-identity {
  display: grid;
  grid-template-columns: max-content minmax(520px, 680px);
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  flex: 0 1 auto;
  justify-self: start;
}

.brand > div:last-child,
.panel-title > div,
.card-head > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--green);
  border: 2px solid var(--gold);
  border-radius: 8px;
  font-weight: 800;
}

.brand-name {
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.header-tagline {
  width: 100%;
  min-width: 0;
  max-width: 680px;
  color: var(--green);
  font-size: 17px;
  line-height: 1.18;
  font-weight: 800;
  text-align: center;
  overflow-wrap: normal;
}

.tagline-line {
  display: block;
  white-space: nowrap;
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(390px, 430px) minmax(270px, 310px);
  align-items: center;
  justify-content: end;
  justify-items: stretch;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-actions {
    justify-content: start;
  }
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-box,
.language-tabs {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.account-box {
  gap: 6px;
  padding: 5px 6px 5px 10px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.account-copy {
  display: grid;
  min-width: 130px;
  max-width: 210px;
  line-height: 1.05;
}

.account-copy strong {
  font-size: 14px;
}

.account-copy span {
  color: var(--muted);
  font-size: 11px;
}

.top-btn,
.lang-option {
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green);
  font-weight: 800;
}

.top-btn {
  padding: 6px 12px;
}

.top-btn.primary {
  color: #fff;
  background: var(--green);
}

.language-tabs {
  gap: 6px;
  padding: 5px 9px;
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.language-tabs span {
  color: var(--muted);
  font-weight: 800;
}

.lang-option {
  min-height: 30px;
  padding: 4px 6px;
  border-color: transparent;
  background: transparent;
  direction: ltr;
}

.lang-option.active {
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--green);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--green);
  background: #e7f2ee;
  border: 1px solid #c8dfd6;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0;
  padding: 8px;
  background: rgba(237, 242, 238, 0.94);
  backdrop-filter: blur(10px);
}

.tabs.has-admin {
  grid-template-columns: repeat(5, 1fr);
}

.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.panel {
  margin-bottom: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

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

h1 {
  font-size: 28px;
  line-height: 1.12;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #26322d;
  font-weight: 800;
  font-size: 14px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.visit-time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.visit-time-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.visit-time-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
}

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

.file-picker em {
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.product-photo-field {
  align-self: stretch;
}

.photo-upload-row {
  display: grid;
  grid-template-columns: minmax(210px, 240px) 1fr;
  gap: 14px;
  align-items: stretch;
}

.product-photo-preview {
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.product-photo-preview.warning {
  border-color: #d3a42a;
  background: #fffaf0;
}

.product-photo-preview > span,
.product-photo-preview > strong {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.product-photo-preview > strong {
  color: #6a4300;
}

.product-photo-preview figure {
  margin: 0;
  min-width: 0;
}

.product-photo-preview img {
  width: 100%;
  aspect-ratio: 1.15;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: block;
}

.product-photo-preview figcaption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-photo-choice {
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.main-photo-choice input {
  justify-self: start;
  margin: 0;
}

.main-photo-choice span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-photo-selected img {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 92, 68, .16);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #13221b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.risk-note {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid #d3a42a;
  border-radius: 8px;
  background: #fffaf0;
  color: #2b2b24;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.captcha-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.captcha-line strong {
  display: inline-flex;
  min-width: 58px;
  padding: 4px 8px;
  border: 1px solid #d3a42a;
  border-radius: 6px;
  background: #fffaf0;
  color: #13221b;
  letter-spacing: 1px;
  justify-content: center;
}

.captcha-refresh {
  border: 1px solid var(--green);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  min-height: 30px;
  padding: 4px 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.captcha-refresh:hover {
  background: var(--soft);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.button-row.compact {
  align-items: center;
  margin-top: 8px;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.btn.secondary {
  color: var(--green);
  background: #fff;
}

.btn.small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.88rem;
}

.link-btn {
  text-decoration: none;
}

.btn.warning {
  color: #5b3a00;
  background: #fff7df;
  border-color: #e7c76d;
}

.btn.danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cards {
  display: grid;
  gap: 10px;
}

.shop-page {
  display: grid;
  gap: 14px;
}

.category-shortcuts {
  display: grid;
  gap: 8px;
  margin: 12px 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.category-shortcuts strong {
  color: var(--green);
  font-size: 14px;
}

.category-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #c8dfd6;
  border-radius: 8px;
  background: var(--soft);
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.category-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.shop-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) repeat(2, minmax(120px, 0.65fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.shop-order-lookup {
  margin: 10px 0 14px;
  padding: 10px 14px;
}

.shop-order-lookup-bar {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr) minmax(230px, 0.55fr);
  align-items: center;
  gap: 12px;
}

.shop-order-lookup-copy {
  min-width: 0;
}

.shop-order-lookup-copy h2 {
  margin: 0 0 2px;
  font-size: 21px;
  line-height: 1.08;
}

.shop-order-lookup-copy .subtle {
  margin: 0;
  line-height: 1.2;
}

.shop-order-phone-field {
  display: grid;
  grid-template-columns: max-content minmax(240px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.shop-order-phone-field span {
  color: #26322d;
  font-weight: 800;
  white-space: nowrap;
}

.shop-order-phone-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shop-order-lookup-button {
  width: 100%;
  min-height: 38px;
  white-space: nowrap;
}

.shop-order-lookup .table-wrap {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .shop-order-lookup-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .shop-order-phone-field {
    grid-template-columns: max-content minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .shop-order-phone-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.filter-submit {
  align-self: end;
}

.order-card,
.product-card,
.engineer-card,
.metric-card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.seller-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #c8dfd6;
  border-radius: 8px;
  background: #f6faf8;
}

.seller-strip span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.product-card-body {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(260px, 1.15fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 10px;
}

.product-detail-list {
  display: grid;
  gap: 9px;
  align-content: start;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  min-width: 0;
}

.product-detail-list strong {
  color: var(--muted);
}

.product-gallery {
  min-height: 230px;
  display: grid;
  grid-template-rows: minmax(170px, auto) auto;
  gap: 8px;
  min-width: 0;
}

.product-main-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  padding: 0;
  cursor: pointer;
}

.product-main-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.product-photo-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.photo-count-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.product-gallery-empty {
  min-height: 230px;
  place-items: center;
  border: 1px dashed #c8dfd6;
  border-radius: 8px;
  background: #f8fbf8;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.order-card {
  border-left: 4px solid var(--green);
}

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-title {
  font-weight: 800;
  font-size: 17px;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.money {
  font-weight: 900;
  color: var(--green);
}

.quote-box {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: #15241e;
  font-size: 13px;
  line-height: 1.35;
}

.evidence-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(80px, 0.6fr) minmax(0, 1.8fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
}

.photo-viewer-modal {
  width: min(1180px, calc(100vw - 44px));
}

.photo-viewer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  margin-top: 12px;
}

.photo-viewer-main {
  min-height: 360px;
  max-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.photo-viewer-main img {
  width: 100%;
  height: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
}

.photo-viewer-thumbs {
  display: grid;
  gap: 8px;
  align-content: start;
}

.photo-viewer-thumbs button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.photo-viewer-thumbs button.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 93, 70, 0.12);
}

.photo-viewer-thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f7faf8;
  border-radius: 6px;
}

.evidence-row strong {
  color: var(--green);
}

.evidence-row em {
  font-style: normal;
  color: #293631;
}

.photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
}

.photo-strip img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.evidence-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.evidence-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--green);
}

.evidence-form-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-picker {
  min-height: 38px;
  gap: 8px;
}

.compact-picker .btn {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.evidence-form textarea {
  min-height: 64px;
  resize: vertical;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.inline-check input {
  margin-top: 2px;
  accent-color: var(--green);
}

.merchant-modal {
  width: min(1480px, calc(100vw - 24px));
}

.merchant-portal-layout {
  display: block;
}

.merchant-portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.merchant-upload-panel,
.merchant-products-panel {
  width: 100%;
  min-width: 0;
  font-size: 9px;
}

.merchant-product-form {
  align-items: start;
}

.merchant-section-head,
.product-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.product-photo-edit-field {
  display: grid;
  gap: 8px;
}

.photo-edit-controls {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 14px;
  align-items: end;
}

.photo-edit-controls label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.existing-product-photo-preview {
  min-height: 108px;
}

.product-photo-selected-preview {
  min-height: 86px;
}

.product-admin-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.merchant-product-admin-list {
  display: grid;
  gap: 8px;
}

.merchant-product-index {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.merchant-product-index-heading {
  padding: 0 8px 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.merchant-product-index-row {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-size: 9px;
}

.merchant-product-index-heading,
.merchant-product-index-row {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(220px, 1.6fr) minmax(105px, .55fr) minmax(78px, .45fr) minmax(95px, .55fr) minmax(96px, .45fr) 72px;
  align-items: center;
  gap: 8px;
  font-size: 9px;
}

.merchant-product-index-row.active {
  border-color: var(--green);
  background: #f4fbf7;
  box-shadow: inset 4px 0 0 var(--green);
}

.merchant-product-no {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.merchant-product-main {
  min-width: 0;
}

.merchant-product-main strong,
.merchant-product-main em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-product-main em,
.merchant-product-meta {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.merchant-product-status,
.merchant-product-edit {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
}

.merchant-product-edit {
  background: transparent;
  border: 1px solid var(--green);
}

.merchant-selected-editor {
  display: grid;
  gap: 8px;
  font-size: 9px;
}

.product-admin-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.product-admin-card label,
.product-admin-card .btn,
.product-admin-card input,
.product-admin-card select,
.product-admin-card textarea,
.product-admin-card .subtle,
.product-admin-card strong {
  font-size: 9px;
}

.product-admin-card .form-grid,
.product-admin-card .photo-upload-row,
.product-admin-card .existing-product-photo-preview,
.product-admin-card .product-photo-selected-preview {
  gap: 8px;
}

.product-admin-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.auth-modal.merchant-modal,
.auth-modal.merchant-modal * {
  font-size: 10pt !important;
  line-height: 1.35;
}

.auth-modal.merchant-modal h1,
.auth-modal.merchant-modal h2,
.auth-modal.merchant-modal h3,
.auth-modal.merchant-modal .auth-section-title,
.auth-modal.merchant-modal .card-title,
.auth-modal.merchant-modal strong,
.auth-modal.merchant-modal label,
.auth-modal.merchant-modal button,
.auth-modal.merchant-modal input,
.auth-modal.merchant-modal select,
.auth-modal.merchant-modal textarea,
.auth-modal.merchant-modal table,
.auth-modal.merchant-modal th,
.auth-modal.merchant-modal td,
.auth-modal.merchant-modal .badge,
.auth-modal.merchant-modal .subtle,
.auth-modal.merchant-modal .field-help {
  font-size: 10pt !important;
}

.auth-modal.merchant-modal h1,
.auth-modal.merchant-modal h2,
.auth-modal.merchant-modal h3 {
  margin-top: 0;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.message {
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 14px;
}

.mini-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

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

.admin-section {
  margin-top: 18px;
}

.admin-section h3 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 20px;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-card strong {
  min-width: 0;
  color: #101914;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.admin-card span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-card label {
  display: grid;
  gap: 4px;
  color: #24382f;
  font-size: 12px;
  font-weight: 900;
}

.admin-card input,
.admin-card select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #101914;
  font: inherit;
}

.training-page {
  align-items: start;
}

.training-page .panel {
  font-size: 13px;
}

.training-page .panel-title h1 {
  font-size: 26px;
}

.training-main-panel {
  display: grid;
  gap: 14px;
}

.training-market {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3c36b;
  border-radius: 8px;
  background: #fffaf0;
}

.training-market h2,
.training-income h2 {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 18px;
}

.training-market p,
.training-income p {
  margin: 0;
  color: #2d3d37;
  line-height: 1.42;
}

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

.training-stat {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.training-stat strong {
  display: block;
  color: var(--green);
  font-size: 17px;
  line-height: 1.15;
}

.training-stat span {
  display: block;
  margin-top: 5px;
  color: #2e3c37;
  line-height: 1.35;
}

.training-demand {
  min-width: 0;
}

.training-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.training-table-head-row,
.training-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(100px, 0.75fr) minmax(110px, 0.85fr) minmax(90px, 0.65fr);
}

.training-table-cell,
.training-table-head {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
}

.training-table-cell:nth-child(4),
.training-table-head:nth-child(4) {
  border-right: 0;
}

.training-table-row:last-child .training-table-cell {
  border-bottom: 0;
}

.training-table-head {
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.training-table-cell::before {
  display: none;
}

.training-income {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  padding: 14px;
  color: #173028;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: #fbfcfb;
}

.training-income ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.training-income li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  line-height: 1.35;
}

.training-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.training-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.training-index {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
}

.training-note {
  margin-top: 0;
  padding: 12px 14px;
  color: #173028;
  border: 1px solid #e3c36b;
  border-radius: 8px;
  background: #fffaf0;
  line-height: 1.45;
}

.training-track-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.training-track {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.training-track h3,
.training-card h3 {
  margin: 0 0 4px;
}

.training-track p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.section-label {
  margin: 2px 0 0;
}

.soft-badge {
  display: inline-flex;
  margin-bottom: 8px;
}

.course-list {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 4px 10px;
  margin: 10px 0 0;
}

.course-list dt {
  color: var(--green);
  font-weight: 900;
}

.course-list dd {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.42;
}

.metric-value {
  font-size: 24px;
  font-weight: 900;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  transform: translateX(-50%) translateY(120%);
  max-width: min(520px, calc(100% - 24px));
  padding: 12px 14px;
  color: #fff;
  background: #19231f;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: start center;
  padding: 24px 12px;
  overflow-y: auto;
  background: rgba(16, 22, 19, 0.52);
}

.hidden {
  display: none !important;
}

.auth-modal {
  width: min(640px, 100%);
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-modal-wide {
  width: min(920px, 100%);
}

.product-order-modal {
  width: min(760px, 100%);
}

.auth-modal.merchant-modal {
  width: min(1480px, calc(100vw - 24px));
}

.auth-section-title {
  margin-bottom: 4px;
}

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

.close-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
}

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

.auth-grid .full {
  grid-column: 1 / -1;
}

.product-order-summary,
.pickup-info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.product-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
}

.product-order-summary strong,
.product-order-summary span {
  display: block;
}

.product-order-summary span {
  margin-top: 3px;
  color: var(--muted);
}

.order-method-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.method-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 800;
}

.method-card.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.method-card input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

.pickup-info-card {
  padding: 14px;
}

.pickup-info-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.pickup-info-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

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

.pickup-info-grid > div {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 10px;
  }

  main,
  .view,
  .panel {
    max-width: 100%;
    overflow-x: hidden;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
  }

  .header-identity {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 10px 14px;
  }

  .brand-name {
    white-space: normal;
    font-size: clamp(22px, 8vw, 30px);
  }

  .header-tagline {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-align: left;
    font-size: 15px;
  }

  .tagline-line {
    white-space: normal;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .account-box {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .account-copy {
    min-width: 0;
  }

  .top-btn {
    width: 100%;
    padding-inline: 9px;
  }

  .language-tabs {
    width: 100%;
    justify-content: center;
  }

  .grid,
  .form-grid,
  .checkbox-grid,
  .metrics,
  .admin-card-grid,
  .shop-filter-grid,
  .inline-control,
  .seller-strip,
  .product-card-body,
  .merchant-portal-layout,
  .merchant-product-index-row,
  .product-admin-grid,
  .training-grid,
  .training-track-row,
  .training-market,
  .training-income,
  .training-income ul,
  .evidence-grid,
  .evidence-row {
    grid-template-columns: 1fr;
  }

  .seller-strip {
    display: grid;
  }

  .photo-upload-row {
    grid-template-columns: 1fr;
  }

  .photo-edit-controls {
    grid-template-columns: 1fr;
  }

  .merchant-product-index-row {
    align-items: start;
  }

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

  .product-gallery,
  .product-gallery-empty {
    min-height: 190px;
  }

  .product-main-photo,
  .product-main-photo img {
    min-height: 180px;
  }

  .photo-viewer-modal {
    width: min(96vw, 760px);
  }

  .photo-viewer-grid {
    grid-template-columns: 1fr;
  }

  .photo-viewer-main {
    min-height: 260px;
    max-height: 58vh;
  }

  .photo-viewer-main img {
    max-height: 58vh;
  }

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

  .photo-viewer-thumbs button {
    grid-template-columns: 1fr;
  }

  .training-stat-grid {
    grid-template-columns: 1fr;
  }

  .training-table {
    display: grid;
    gap: 8px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 12px;
  }

  .training-table-head-row {
    display: none;
  }

  .training-table-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .training-table-cell {
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .training-table-cell:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .training-table-cell:first-child {
    grid-column: 1 / -1;
    border-right: 0;
    background: var(--soft);
    font-weight: 900;
  }

  .training-table-row:last-child .training-table-cell,
  .training-table-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .training-table-cell::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    content: attr(data-label);
  }

  .training-table-cell:first-child::before {
    display: none;
  }

  .course-list {
    grid-template-columns: 1fr;
  }

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

  .tab {
    padding: 8px 6px;
    font-size: 13px;
  }

  .panel {
    padding: 14px;
  }

  .panel-title {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-title .badge {
    align-self: flex-start;
  }

  .meta-list {
    grid-template-columns: 1fr;
  }

  .mini-form {
    grid-template-columns: 1fr;
  }

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

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .order-method-toggle,
  .pickup-info-grid {
    grid-template-columns: 1fr;
  }
}

