* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f6f8;
  color: #15171a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: #f26b2e;
  color: #fff;
  height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

button:disabled {
  background: #aeb5c2;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.72;
}

.hidden {
  display: none !important;
}

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

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  border: 1px solid #e7e9ee;
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f26b2e;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 18px;
}

.login-card h1 {
  font-size: 24px;
}

.login-card p {
  color: #707784;
  margin-top: 8px;
  line-height: 1.6;
}

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

.login-error {
  min-height: 20px;
  color: #d9480f;
  font-size: 13px;
  margin-top: 12px;
}

.secondary-btn {
  background: #15171a;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  background: #15171a;
  color: #fff;
  padding: 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f26b2e;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand span {
  display: block;
  color: rgba(255,255,255,0.58);
  font-size: 12px;
  margin-top: 4px;
}

.nav {
  width: 100%;
  background: transparent;
  color: rgba(255,255,255,0.72);
  text-align: left;
  margin-bottom: 8px;
}

.nav.active {
  background: #f26b2e;
  color: #fff;
}

.main {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

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

.topbar-actions span {
  color: #707784;
  font-size: 14px;
}

h1,
h2,
p {
  margin: 0;
}

.topbar h1 {
  font-size: 26px;
}

.topbar p,
.settings p {
  color: #707784;
  margin-top: 6px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stat,
.card {
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  padding: 18px;
}

.card + .card {
  margin-top: 14px;
}

.stat span {
  color: #707784;
  font-size: 13px;
}

.stat strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(240px, 1.5fr) repeat(3, minmax(120px, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  background: #fbfcfd;
}

.product-form label {
  margin-top: 0;
}

.product-form button {
  align-self: end;
}

.tag-field {
  grid-column: 1 / -2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d8dce3;
  border-radius: 10px;
}

.tag-field legend {
  padding: 0 6px;
  color: #707784;
  font-size: 13px;
}

.tag-field label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: #15171a;
  font-size: 13px;
}

.tag-field input {
  width: 16px;
  height: 16px;
}

.inspection-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  background: #fbfcfd;
}

.inspection-form label {
  margin-top: 0;
}

.inspection-form .full-line {
  grid-column: 1 / -1;
}

.inspection-form button {
  align-self: end;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e7e9ee;
  text-align: left;
}

th {
  color: #707784;
  font-weight: 600;
  background: #fbfcfd;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  background: #15171a;
}

.inline-actions button:disabled {
  background: #aeb5c2;
}

.image-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.image-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f4f6f8;
  color: #15171a;
  text-decoration: none;
  font-size: 12px;
  border: 1px solid #e7e9ee;
}

.muted-cell {
  color: #8a929f;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 23, 26, 0.46);
}

.modal-panel {
  width: min(920px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid #e7e9ee;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
}

.report-detail {
  margin-top: 16px;
}

.report-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: 12px;
  background: #15171a;
  color: #fff;
}

.report-kicker {
  color: #9be3d8;
  font-size: 13px;
  margin-bottom: 8px;
}

.report-hero h3 {
  margin: 0;
  font-size: 24px;
}

.report-hero p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.64);
}

.report-seal {
  width: 118px;
  height: 118px;
  flex: 0 0 118px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 3px solid #d8291f;
  border-radius: 999px;
  color: #d8291f;
  background: rgba(255, 255, 255, 0.96);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  transform: rotate(-12deg);
}

.report-price {
  min-width: 180px;
  text-align: right;
}

.report-price span,
.report-summary span {
  display: block;
  color: #707784;
  font-size: 13px;
}

.report-price span {
  color: rgba(255, 255, 255, 0.64);
}

.report-price strong {
  display: block;
  margin-top: 8px;
  color: #ff7a3d;
  font-size: 30px;
}

.report-summary,
.report-check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.report-summary div,
.report-check-item,
.report-promise {
  padding: 14px;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  background: #fbfcfd;
}

.report-summary strong {
  display: block;
  margin-top: 8px;
}

.report-detail h4 {
  margin: 20px 0 0;
  font-size: 16px;
}

.report-check-item span,
.report-check-item strong,
.report-check-item em {
  display: block;
}

.report-check-item span {
  color: #707784;
  font-size: 13px;
}

.report-check-item strong {
  margin-top: 8px;
  line-height: 1.5;
}

.report-check-item em {
  width: max-content;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #e9fbf8;
  color: #05796f;
  font-size: 12px;
  font-style: normal;
}

.report-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.report-image-link {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  color: #15171a;
  text-decoration: none;
  background: #fff;
}

.report-image-link span {
  font-weight: 700;
}

.report-image-link small {
  color: #707784;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-empty {
  padding: 18px;
  border-radius: 10px;
  background: #f5f6f8;
  color: #707784;
}

.report-adjust-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.report-adjust-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  background: #fff;
}

.report-adjust-row span {
  color: #555c66;
}

.report-adjust-row strong {
  color: #f26b2e;
}

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

.report-lens-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  background: #fff;
}

.report-lens-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #707784;
}

.report-lens-card em {
  color: #15171a;
  font-style: normal;
}

.report-promise {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.report-promise span {
  color: #707784;
  line-height: 1.7;
}

.flow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.flow div {
  min-height: 76px;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #555c66;
}

.settings {
  max-width: 560px;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

input,
select,
textarea {
  height: 40px;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

.settings button {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
  .brand {
    grid-column: 1 / -1;
  }
  .stats,
  .flow,
  .product-form,
  .inspection-form {
    grid-template-columns: repeat(2, 1fr);
  }
  .tag-field {
    grid-column: 1 / -1;
  }
}
