/* 进出货库存记录：商务风（style.css）之外的样式，颜色都用 style.css 的变量 */
h2 { margin: 0 0 12px; font-size: 1.1rem; font-weight: 650; }
.card { margin-top: 16px; }
.app > .card:first-of-type { margin-top: 0; }

.month-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-bar h2 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 0; }
.stats > div { min-width: 0; padding: 10px 8px; border-radius: 6px; background: var(--bg); }
.stats dt { color: var(--muted); font-size: .85rem; }
.stats dd { margin: 2px 0 0; font-size: clamp(.95rem, 4.4vw, 1.25rem); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats small { display: block; color: var(--muted); font-size: .74rem; line-height: 1.3; }
.neg { color: #c0392b; }

button.ghost { background: transparent; color: var(--accent); }
button.icon { width: 44px; padding: 0; font-size: 1.4rem; line-height: 1; }
button.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }

.field { display: grid; gap: 4px; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.field input, .field select { width: 100%; box-sizing: border-box; color: var(--fg); font-size: 1rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.actions button[type="submit"] { flex: 1; }
.hint { margin: 8px 0 0; color: #b9770e; font-size: .9rem; }
.hint:empty { display: none; }
.empty { color: var(--muted); }

/* 进货 / 卖出 二选一 */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 44px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--accent); color: var(--accent-fg); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -4px; }

.stock, .records { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stock li, .records li { padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.s-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.s-head strong { font-size: 1.05rem; }
.s-stock { font-weight: 700; font-variant-numeric: tabular-nums; }
.s-stock.zero { color: var(--muted); }
.s-meta, .r-meta { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.s-acts { display: flex; gap: 6px; margin-top: 8px; }
.records li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.records li .s-acts { margin-top: 0; flex: none; }
.tag { display: inline-block; min-width: 1.6em; margin-right: 8px; padding: 0 6px; border-radius: 4px; font-size: .8rem; font-weight: 700; text-align: center; }
.tag.in { background: #dbeafe; color: #1e40af; }
.tag.out { background: #dcfce7; color: #166534; }

.add { margin-top: 14px; }
.add summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; }

@media (max-width: 380px) {
  .records li { flex-direction: column; align-items: stretch; }
}
