.admin { padding: 32px 0 80px; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-danger { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.35); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.16); border-color: var(--bad); color: #fecaca; }
.admin-tabs a.active { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 6px; }

.login { max-width: 420px; margin: 10vh auto; }
.login .panel { display: flex; flex-direction: column; gap: 14px; }

.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; font-weight: 800; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); word-break: break-all; margin-top: 18px; }

/* Store-wide sale panel on the product list */
.sale-controls { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin: 14px 0 4px; }
.sale-controls > .field { flex: 0 0 200px; }
.sale-quick { display: flex; gap: 6px; }
.sale-controls + p { margin: 6px 0 0; }
.panel > .actions { justify-content: flex-start; margin-top: 16px; }
.was { font-size: 11.5px; color: var(--dim); text-decoration: line-through; }

table.products { width: 100%; border-collapse: collapse; font-size: 14px; }
.products th { text-align: left; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); padding: 10px; border-bottom: 1px solid var(--line); }
.products td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.products tr.off td { opacity: 0.45; }
.thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: #070910; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; }
.thumb .ph img { width: 62%; height: auto; }
.stock-select { height: 36px; min-width: 132px; border-radius: 10px; padding: 0 10px; font-weight: 700; font-size: 13px; color: var(--text); background: rgba(3, 4, 9, 0.55); border: 1px solid var(--line-2); cursor: pointer; }
.stock-select.is-in { border-color: rgba(91, 143, 224, 0.55); background: rgba(91, 143, 224, 0.12); color: #cfe0ff; }
.stock-select.is-out { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.1); color: #fecaca; }
.stock-select:disabled { opacity: 0.6; cursor: progress; }
.stock-select option { background: #0a0c13; color: var(--text); }
.editor .stock-select { width: 100%; height: 44px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }

.editor { position: fixed; inset: 0; z-index: 80; background: rgba(3, 4, 9, 0.72); backdrop-filter: blur(4px); display: grid; place-items: start center; overflow: auto; padding: 5vh 16px; }
.editor .panel { width: min(760px, 100%); background: #0a0c13; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.editor-head h2 { margin: 0; }
.editor-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.img-pick { display: flex; gap: 16px; align-items: center; }
.img-pick .thumb { width: 96px; height: 96px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 650; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Gallery editor */
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.img-cell { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: #070910; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 2px; background: linear-gradient(180deg, transparent, rgba(3, 4, 9, 0.88)); padding: 3px; opacity: 0; transition: opacity 0.15s; }
.img-cell:hover .img-tools, .img-cell:focus-within .img-tools { opacity: 1; }
.img-tools .x { width: 26px; height: 24px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 15px; line-height: 1; }
.img-tools .x:hover:not([disabled]) { background: var(--accent); }
.img-tools .x[disabled] { opacity: 0.3; cursor: not-allowed; }
.img-add { width: 92px; height: 92px; border-radius: 10px; border: 1px dashed var(--line-2); display: grid; place-items: center; cursor: pointer; color: var(--muted); text-align: center; transition: border-color 0.15s, color 0.15s; }
.img-add:hover { border-color: var(--accent); color: var(--text); }
.img-add span { font-size: 22px; line-height: 1; display: grid; gap: 2px; justify-items: center; }
.img-add small { font-size: 10.5px; letter-spacing: 0.04em; }
.img-add input { display: none; }

/* Lab test (COA) editor */
.coa-edit { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(255, 255, 255, 0.02); }
.coa-edit.busy { opacity: 0.6; }
.coa-actions { display: flex; gap: 6px; align-items: center; }
.coa-actions label.btn { display: inline-flex; align-items: center; }
.file-inline { display: none; }
.tiny { font-size: 11.5px; }
.coa-list { display: flex; flex-direction: column; gap: 4px; }
.coa-file { color: var(--accent-2); font-weight: 600; font-size: 13px; }
.coa-file:hover { text-decoration: underline; }
.coa-file.ext { color: var(--muted); font-weight: 500; }
.coa-file small { margin-left: 6px; color: var(--dim); font-size: 11px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-btn { border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.tag-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.rows { display: flex; flex-direction: column; gap: 10px; }
.rowedit { display: grid; gap: 10px; grid-template-columns: 2fr 1fr 2fr auto; align-items: end; }
.rowedit.faq { grid-template-columns: 1fr auto; }
.rowedit.faq .field textarea { min-height: 70px; }
.settings .panel h2 { margin-bottom: 14px; }
.sticky-save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 18px; }

.logo-box { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
/* The mark is drawn on black; the site is black, so it sits flush. */
.logo-box img { width: 160px; height: 160px; object-fit: contain; background: #05070c; border-radius: 18px; border: 1px solid var(--line-2); }

@media (max-width: 820px) {
  .admin-tabs:not([hidden]) { display: flex !important; position: static; flex-direction: row; padding: 0; border: 0; background: none; gap: 14px; overflow-x: auto; }
  .admin-tabs a { border: 0; padding: 6px 0; white-space: nowrap; }
  .top-row { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 12px; }
  .rowedit { grid-template-columns: 1fr; }
  .coa-edit { grid-template-columns: 1fr; }
}

/* States we ship to */
.state-tools { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.state-tools .muted { margin-right: auto; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; }
.state-grid .check { font-weight: 500; font-size: 13px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.state-grid .check.off { color: #f87171; text-decoration: line-through; opacity: 0.8; }
.state-grid .check input { width: 15px; height: 15px; }

