body.is-admin { background: #efeae3; }
body.is-login { background: var(--paper); }

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.side {
  background: #1a1714;
  color: #f3eee6;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .brand-text small { color: rgba(243, 238, 230, 0.55); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a,
.side button.linkish {
  color: rgba(243, 238, 230, 0.72);
  text-decoration: none;
  background: none;
  border: none;
  padding: 8px 0;
  letter-spacing: 0.16em;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.side nav a.on,
.side nav a:hover,
.side button.linkish:hover { color: #fff; }
.side-logout { margin-top: auto; }
.main { padding: 36px 40px 80px; }
.main h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 42px;
  margin: 6px 0 8px;
}
.list-head, .form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}
.finder {
  width: min(360px, 100%);
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 8px 0;
  margin-bottom: 16px;
}
.goods { display: flex; flex-direction: column; gap: 12px; }
.good {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px 18px;
  align-items: center;
  background: var(--card);
  padding: 12px;
  border: 1px solid transparent;
}
.good:hover { border-color: rgba(26, 23, 20, 0.16); }
.thumb-link { width: 84px; height: 106px; display: block; background: #e6dfd4; }
.thumb-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.mini {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 32px;
}
.good-name {
  font-family: var(--serif);
  font-size: 22px;
  color: inherit;
  text-decoration: none;
}
.good-name:hover { color: var(--cinnabar); }
.good .hint { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.linkline {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
  margin: 4px 0 0;
}
.pill {
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 1px 6px;
  border: 1px solid var(--line);
}
.pill.off { color: var(--cinnabar); border-color: rgba(156, 59, 46, 0.45); }
.ops {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.ops form { margin: 0; }
.ops a, .ops button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-size: 14px;
}
.ops .danger { color: var(--cinnabar); }

.panel {
  background: var(--card);
  padding: 22px 22px 8px;
  margin-bottom: 16px;
}
.panel h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 16px;
}
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field > span, .field > label {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.field input[type="text"],
.field input[type="password"],
.field input[type="search"],
.field textarea,
.field select,
.field input:not([type]) {
  border: 1px solid rgba(26, 23, 20, 0.16);
  background: #fff;
  padding: 12px 14px;
  width: 100%;
  border-radius: 0;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--cinnabar);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checks, .checkline { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 4px 0 16px; }
.checks label, .checkline { letter-spacing: 0.04em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 24px; }
.drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 148px;
  border: 1px dashed rgba(26, 23, 20, 0.35);
  background: #fff;
  text-align: center;
  padding: 20px;
  cursor: pointer;
  margin-bottom: 8px;
}
.drop input {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop.over { border-color: var(--cinnabar); background: #fff7f5; }
.existing { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 16px; }
.shot {
  width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.shot img { width: 120px; height: 150px; object-fit: cover; background: #eee; }
#previews { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
#previews img { width: 72px; height: 90px; object-fit: cover; }

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.login-art {
  background: #1a1714;
  color: #f3eee6;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}
.login-art .seal {
  font-family: var(--serif);
  font-size: clamp(96px, 14vw, 160px);
  font-weight: 400;
  line-height: 0.9;
  margin: 0;
}
.login-art p { max-width: 16em; color: rgba(243, 238, 230, 0.78); }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(420px, 100%); }
.login-card h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 48px;
  margin: 0 0 8px;
}

@media (max-width: 800px) {
  .shell { display: block; }
  .side {
    position: sticky;
    top: 0;
    height: auto;
    width: auto;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    overflow-x: auto;
  }
  .side nav { flex-direction: row; gap: 14px; }
  .side nav a, .side button.linkish { white-space: nowrap; }
  .side-logout { margin-top: 0; }
  .side .brand-text { display: none; }
  .main { padding: 22px 16px 64px; }
  .row2, .login { grid-template-columns: 1fr; }
  .login-art { min-height: 240px; padding: 28px; }
  .ops { grid-column: 1 / -1; }
}
