/* Store manager. Builds on the tokens in styles.css. */
.admin .top-in { flex-wrap: wrap; padding-block: .6rem; }
.admin .brand-sub { display: inline; }
.status {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase;
  padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 2px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: .45rem;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); }
.status.dirty { color: var(--warn); border-color: currentColor; }
.status.dirty::before { background: var(--warn); }
.status.clean::before { background: var(--edge); }
.admin-main { padding-block: 2rem 4rem; display: flex; flex-direction: column; gap: 2.4rem; }
.muted { color: var(--ink-2); }
.small { font-size: .84rem; }
.hint { font-weight: 400; color: var(--ink-2); font-size: .8rem; }
.btn-sm { min-height: 38px; padding: .4rem .85rem; font-size: .9rem; }

.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); counter-reset: step; }
.how li { counter-increment: step; display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem 1rem 0; }
.how li + li { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.how li b::before { content: counter(step) "  "; font-family: var(--mono); font-size: .75rem; color: var(--edge); }
.how li span { color: var(--ink-2); font-size: .9rem; }
@media (max-width: 760px) { .how ol { grid-template-columns: minmax(0, 1fr); } .how li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }

.panel { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.panel > * { min-width: 0; max-width: 100%; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.panel-head p { margin-top: .3rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.toolbar .input { width: min(16rem, 100%); }
.bulk { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; padding: 1rem; background: var(--shelf); border: 1px solid var(--line); border-radius: var(--r); }
.bulk p { flex-basis: 100%; }
.input-num { width: 5.5rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; }
.check input, .radio input { accent-color: var(--edge); width: 1.05rem; height: 1.05rem; }

.admin-scroll { border-top: 2px solid var(--ink); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.admin-table th { text-align: left; font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); padding: .8rem .6rem .6rem 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th .hint { text-transform: none; letter-spacing: 0; font-family: var(--body); }
.admin-table td { padding: .6rem .6rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr.sold td:not(:last-child) { opacity: .7; }
.thumb { width: 64px; height: 54px; background: var(--shelf); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; display: grid; place-items: center; }
.thumb .art, .thumb .photo { width: 100%; height: 100%; object-fit: contain; }
.c-name { min-width: 14rem; }
.c-name strong { display: block; font-weight: 650; line-height: 1.3; }
.c-name span { color: var(--ink-2); font-size: .82rem; }
.money { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--shelf); }
.money span { padding-left: .55rem; color: var(--ink-2); font-size: .9rem; }
.money input { width: 6rem; border: 0; background: transparent; padding: .45rem .55rem .45rem .25rem; font-variant-numeric: tabular-nums; min-height: 38px; }
.money:focus-within { border-color: var(--edge); box-shadow: 0 0 0 2px color-mix(in srgb, var(--edge) 30%, transparent); }
.money input:focus { outline: none; }
.admin-table .select { min-height: 38px; padding: .3rem .5rem; font-size: .9rem; }
.acts { display: flex; gap: .3rem; justify-content: flex-end; flex-wrap: nowrap; }
.icon-btn { min-width: 34px; height: 34px; padding: 0 .55rem; background: transparent; border: 1px solid var(--line); border-radius: 2px; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.icon-btn.danger:hover, .icon-btn.confirm { border-color: var(--sale); color: var(--sale); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.group { margin: 0; padding: 1.1rem 1.2rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--shelf); display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.group legend { padding: 0 .4rem; margin-left: -.4rem; }
.group-wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .92rem; min-width: 0; }
.field .input, .field .select { font-weight: 400; width: 100%; background: var(--paper); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; }
.radios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.radio { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--edge); box-shadow: inset 0 0 0 1px var(--edge); }
.radio > span { display: flex; flex-direction: column; gap: .25rem; }
.radio .muted { font-size: .84rem; }
.warn { color: var(--warn); font-size: .88rem; }
.cats { display: flex; flex-direction: column; gap: .5rem; }
.cat-row { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: center; }
.cat-row .input { flex: 1 1 12rem; min-width: 0; background: var(--paper); }
.cat-row .count { font-family: var(--mono); font-size: .7rem; color: var(--ink-2); }
.cat-add { display: flex; gap: .6rem; flex-wrap: wrap; }
.cat-add .input { flex: 1; min-width: 12rem; background: var(--paper); }
@media (max-width: 820px) { .settings-grid, .radios { grid-template-columns: minmax(0, 1fr); } }

.panel-quiet { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3rem; }
.more > div { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
@media (max-width: 700px) { .more { grid-template-columns: minmax(0, 1fr); } }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--edge); outline-offset: 2px; }

/* Editor dialog */
.editor { width: min(1000px, calc(100% - 32px)); max-height: calc(100% - 32px); border: 1px solid var(--line); border-radius: var(--r); }
.editor[open] { display: flex; flex-direction: column; }
.editor form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); }
.editor-head h2 { font-family: var(--display); font-weight: 800; font-stretch: 118%; font-size: 1.35rem; letter-spacing: -.01em; }
.editor-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem; padding: 1.3rem; overflow-y: auto; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; align-content: start; }
.span-2 { grid-column: 1 / -1; }
.editor textarea.input { resize: vertical; min-height: 5rem; font-family: var(--body); }
.pic-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; }
.field-color input { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); cursor: pointer; }
.photo-row { display: flex; gap: .5rem; }
.photo-row .input { flex: 1; min-width: 0; }
.editor-preview { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: .7rem; }
.preview-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); padding-bottom: 1rem; overflow: hidden; }
.preview-card .item-stage { pointer-events: none; }
.preview-card .add-btn { pointer-events: none; }
.editor-foot { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: flex-end; align-items: center; padding: 1rem 1.3rem calc(1rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--shelf); }
.editor-foot .form-error { margin-right: auto; }
@media (max-width: 820px) {
  .editor { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: 0; }
  .editor-head { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
  .editor-body { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { position: static; order: -1; }
  .editor-fields { grid-template-columns: minmax(0, 1fr); }
}

.export { width: min(760px, calc(100% - 32px)); }
.export-body { padding: 1.3rem; display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }
.export-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.code { width: 100%; min-height: 16rem; resize: vertical; padding: .8rem; background: var(--shelf); border: 1px solid var(--line); border-radius: var(--r); font-family: var(--mono); font-size: .72rem; line-height: 1.55; color: var(--ink); }

.add-photos { align-self: flex-start; }
#e-photos { min-height: 3.6rem; font-family: var(--mono); font-size: .8rem; }
