:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: #282f2c;
  background: #f5f6f2;
  font-synthesis: none;
  line-height: 1.6;
  font-size: 15px;
  --green: #235b49;
  --line: #dce3dd;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  height: 78px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.brand span {
  font-weight: 400;
  font-size: 14px;
  color: #64726b;
  margin-left: 20px;
}
main {
  max-width: 1560px;
  margin: auto;
  padding: 28px 4vw;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
h3 {
  font-size: 17px;
  margin: 10px 0;
}
p {
  margin: 8px 0 18px;
}
.muted,
small {
  color: #637269;
}
.muted {
  font-size: 13px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  min-height: 40px;
}
button.secondary {
  background: white;
  color: var(--green);
  border-color: #b9c9bf;
}
button.danger {
  background: #a13e35;
  border-color: #a13e35;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:hover:not(:disabled) {
  filter: brightness(0.93);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #dbac54;
  outline-offset: 2px;
}
input,
select,
textarea {
  border: 1px solid #b9c9bf;
  border-radius: 5px;
  padding: 8px;
  background: #fff;
  color: #282f2c;
  max-width: 100%;
}
input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--green);
}
textarea {
  width: 100%;
  min-height: 90px;
}
label {
  display: grid;
  gap: 5px;
  font-size: 13px;
}
label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
#login {
  max-width: 430px;
  margin: 7vh auto;
  padding: 30px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
#login form {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 28px;
}
nav button {
  color: #4d6256;
  background: transparent;
  border-color: transparent;
}
nav button.active {
  background: var(--green);
  color: white;
}
.toolbar,
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 15px 0;
}
.toolbar {
  justify-content: space-between;
}
.notice,
#notice:not(:empty) {
  padding: 12px 16px;
  margin-bottom: 18px;
  background: #fff6df;
  border: 1px solid #e8d4a3;
  border-radius: 6px;
}
#notice.error {
  color: #963b31;
  background: #ffefec;
  border-color: #efb9b1;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 13px;
}
th {
  text-align: left;
  background: #edf1ec;
  font-weight: 600;
  color: #49604f;
}
td,
th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td input[type="text"] {
  min-width: 130px;
  width: 100%;
}
td input[type="number"] {
  width: 88px;
}
td .actions {
  min-width: 180px;
}
td img,
.thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #f6f6f2;
  border-radius: 5px;
}
td label {
  margin: 5px 0;
}
code {
  font-size: 11px;
  overflow-wrap: anywhere;
  color: #526059;
}
.badge {
  display: inline-block;
  background: #e6eee7;
  color: #315a41;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.preview {
  background: #fff0cf;
  color: #805800;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.empty {
  padding: 40px;
  color: #69766d;
  text-align: center;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  color: var(--green);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  max-height: 330px;
  overflow: auto;
}
dialog {
  border: 1px solid #ced9cf;
  border-radius: 10px;
  max-width: 850px;
  width: calc(100% - 40px);
  padding: 26px;
}
dialog::backdrop {
  background: #17271e99;
}
#confirm {
  max-width: 480px;
}
iframe {
  width: 100%;
  height: 55vh;
  border: 1px solid var(--line);
  background: white;
}
.record {
  border-left: 3px solid #c9d7cb;
  padding-left: 12px;
  margin: 12px 0;
}
.id {
  font-variant-numeric: tabular-nums;
}
.stock-controls {
  display: flex;
  gap: 5px;
  align-items: center;
}
.stock-controls button {
  padding: 6px 8px;
  font-size: 12px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
input[type="file"] {
  width: 190px;
  font-size: 12px;
}
@media (max-width: 700px) {
  header {
    height: auto;
    min-height: 70px;
    gap: 12px;
    padding: 14px 5vw;
  }
  .brand span {
    display: block;
    margin-left: 0;
  }
  .brand {
    font-size: 18px;
  }
  main {
    padding: 20px 4vw;
  }
  h1 {
    font-size: 24px;
  }
  .panel {
    padding: 14px;
  }
  #identity {
    font-size: 12px;
  }
  nav {
    gap: 4px;
  }
  nav button {
    padding: 8px 10px;
  }
  td,
  th {
    padding: 9px;
  }
}

[hidden] { display: none !important; }
