/* 後台(沿用 style.css 的色票與按鈕) */
.admin { height: auto; min-height: 100dvh; }
body:has(.admin:not([hidden])) { user-select: text; }
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs button { padding: 12px 18px; border: 0; background: none; border-bottom: 3px solid transparent; cursor: pointer; font-size: 1rem; }
.tabs button.on { border-bottom-color: var(--accent); font-weight: 700; }
.tab { padding: 12px 12px 96px; width: 100%; max-width: 980px; margin: 0 auto; }
.banner { margin: 12px; padding: 12px 16px; border-radius: 10px; }
.banner.warn { background: #fdecea; color: var(--warn); font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; }
.card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.card h3 { margin: 18px 0 8px; font-size: 1rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.row input { flex: 1 1 160px; }
.card input[type=text], .card input:not([type]), .card input[type=number], .card input[type=password], .card select {
  padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; min-height: 44px; background: #fff; min-width: 0;
}
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; }

.cat-bar { display: flex; gap: 8px; align-items: center; }
.cat-bar .cats { flex: 1; min-width: 0; padding: 0; border: 0; }
.tab, .card, .cat-head > *, .item-row > *, .opt-row > * { min-width: 0; }
.cat-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat-head input { flex: 1 1 180px; font-size: 1.1rem; font-weight: 700; }

/* 加價選項 */
.opt-row { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; margin-bottom: 6px; }

/* 品項表 */
.item-head, .item-row {
  display: grid; gap: 6px; align-items: center;
  grid-template-columns: minmax(140px, 1fr) 76px 76px 76px 64px 104px 50px 50px 132px;
}
.item-head { font-size: .8rem; color: var(--muted); padding: 0 8px 4px; }
.item-row { padding: 8px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fff; }
.item-row.sold { background: #fbf3f2; }
.item-row input, .item-row select { width: 100%; }
.item-row .acts { display: flex; gap: 4px; justify-content: flex-end; }
.item-row .acts button { min-width: 40px; min-height: 40px; padding: 4px 8px; }
.item-row label.check { justify-content: center; }
.item-row .lbl { display: none; }

@media (max-width: 860px) {
  .item-head { display: none; }
  .item-row { grid-template-columns: repeat(3, 1fr); }
  .item-row .f-name { grid-column: 1 / -1; }
  .item-row .lbl { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 2px; }
  .item-row .f-temp { grid-column: span 2; }
  .item-row .acts { grid-column: 1 / -1; justify-content: space-between; }
  .item-row label.check { flex-direction: column; gap: 2px; }
  .item-row label.check .lbl { order: -1; }
  .save-bar #dirty-msg { flex-basis: 100%; }
  .save-bar .spacer { display: none; }
  .save-bar .btn { flex: 1; }
}

.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.05); z-index: 10;
}
.save-bar .spacer { flex: 1; }
.save-bar.dirty { background: #fff8e6; }
.save-bar.dirty #dirty-msg { color: var(--accent); font-weight: 700; }
