* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 20px;
  color: #1F1E1B;
  background: #F7F4EE;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
}
a { color: #3A4A3E; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { color: #3A4A3E; margin: 0; font-size: 22px; }
h2 { margin: 18px 0 10px; font-size: 18px; color: #3A4A3E; }
.top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand span { color: #5C5A55; font-size: 13px; }
.tabs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tabs a, .tabs button {
  padding: 8px 16px;
  border: 1px solid #E5DFD0;
  background: #fff;
  border-radius: 8px;
  color: #1F1E1B;
  text-decoration: none;
  cursor: pointer;
}
.tabs a.on { background: #94A89A; color: #fff; border-color: #94A89A; }
.head-side { display: flex; align-items: center; gap: 8px; }
button.ghost, .ghost {
  background: #FBF9F4;
  color: #3A4A3E;
  border: 1px solid #E5DFD0;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
.panel { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(31,30,27,.08); }
.sum-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 8px; }
.sum-row b { font-size: 20px; color: #3A4A3E; margin-right: 16px; }
.sum-row span { color: #5C5A55; font-size: 13px; }
.flash { padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; }
.flash.ok { background: #E4F0E2; color: #3A4A3E; }
.flash.bad { background: #F8E8E4; color: #C44536; }
.sub, .muted, .hint { color: #5C5A55; font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px; border-bottom: 1px solid #E5DFD0; text-align: left; vertical-align: top; }
th { color: #5C5A55; font-weight: 600; font-size: 13px; }
label { display: block; font-size: 13px; color: #5C5A55; margin-top: 8px; }
input, textarea, select {
  width: 100%;
  padding: 8px;
  margin: 4px 0 8px;
  border: 1px solid #E5DFD0;
  border-radius: 8px;
  background: #fff;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: start; }
.btn, button.btn, button.primary { background: #94A89A; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.secondary, button.secondary { background: #FBF9F4; color: #3A4A3E; border: 1px solid #E5DFD0; }
.btn.small { padding: 4px 8px; font-size: 13px; }
.btn.bad, button.problem { background: #C44536; color: #fff; border: none; }
.btn.warn { background: #E08A2C; color: #fff; border: none; }
button.query { background: #E08A2C; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.matrix-wrap { overflow: auto; }
table.matrix { width: max-content; min-width: 100%; }
table.matrix th, table.matrix td { text-align: center; white-space: nowrap; }
table.matrix td.name, table.matrix th.name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
table.matrix .qty { font-weight: 600; color: #1F1E1B; }
.ops { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
button.icon {
  width: 22px; height: 22px; padding: 0;
  border-radius: 6px; border: 1px solid #E5DFD0; background: #fff;
  color: #3A4A3E; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
button.icon.ship { color: #3A4A3E; }
button.icon.move { color: #2F6FED; }
button.icon.sale { color: #E08A2C; }
button.icon.scrap { color: #C44536; }
button.icon svg { display: block; }
.mask { position: fixed; inset: 0; background: rgba(31,30,27,.35); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; z-index: 30; }
.mask.hidden { display: none; }
.dialog { background: #fff; border-radius: 12px; padding: 16px 18px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 8px 28px rgba(31,30,27,.18); }
.dialog h3 { margin: 0 0 12px; font-size: 16px; color: #3A4A3E; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
button.ok { background: #C44536; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; }
button.cancel { background: #4A4844; color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #F8E8D6; color: #E08A2C; font-size: 12px; }
.pill.done { background: #E4F0E2; color: #3A4A3E; }
.group-title { margin: 18px 0 8px; font-size: 13px; letter-spacing: 0.08em; color: #5C5A55; }
.sw { position: relative; width: 38px; height: 22px; display: inline-block; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: #d5cfc5; border-radius: 99px; }
.sw span:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .15s; }
.sw input:checked + span { background: #94A89A; }
.sw input:checked + span:before { transform: translateX(16px); }
.login-wrap { min-height: calc(100vh - 40px); display: grid; place-items: center; }
.login-card { width: min(420px, 100%); }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input[type="number"] { width: 72px; }
.part-row { display: grid; grid-template-columns: 1fr 100px; gap: 8px; margin-bottom: 8px; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }
