/* FAB Singles — base styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f4f5f7; color: #222; line-height: 1.5; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav, .admin-nav {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.65rem 1.5rem; background: #1a1a2e; color: #fff;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 1.15rem; color: #e8c96f; text-decoration: none; }
.nav a { color: #bbb; text-decoration: none; font-size: 0.9rem; }
.nav a:hover, .admin-nav a:hover { color: #fff; }
.admin-nav a.active { color: #fff; font-weight: 600; }
.btn-link { background: none; border: none; color: #bbb; cursor: pointer; font-size: 0.9rem; padding: 0; }
.btn-link:hover { color: #fff; }

/* ── Main areas ───────────────────────────────────────────────────────────── */
.store-main, .admin-main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1.5rem; }
.admin-main h1 { margin-bottom: 1rem; font-size: 1.4rem; }
.count { font-size: 1rem; font-weight: 400; color: #666; }

/* ── Flash ────────────────────────────────────────────────────────────────── */
.flash {
  padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem;
  background: #d4edda; color: #155724; border: 1px solid #c3e6cb;
  font-size: 0.9rem;
}
.flash a { color: #155724; font-weight: 600; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-wrap { max-width: 360px; margin: 5rem auto; padding: 2rem; background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.login-wrap h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.login-wrap label { display: block; margin-bottom: 1.25rem; font-size: 0.875rem; font-weight: 600; color: #444; }
.login-wrap input { display: block; width: 100%; padding: 0.55rem 0.75rem; margin-top: 0.3rem; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; }
.login-wrap input:focus { outline: 2px solid #4a6fa5; border-color: transparent; }
.login-wrap button { width: 100%; padding: 0.65rem; background: #1a1a2e; color: #fff; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; margin-top: 0.25rem; }
.login-wrap button:hover { background: #2d2d5e; }
.error { color: #c00; margin-bottom: 1rem; font-size: 0.875rem; background: #fff0f0; padding: 0.5rem 0.75rem; border-radius: 4px; border: 1px solid #fcc; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary { padding: 0.6rem 1.25rem; background: #1a1a2e; color: #fff; border: none; border-radius: 6px; font-size: 0.95rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: #2d2d5e; }
.btn-secondary { padding: 0.6rem 1.25rem; background: #fff; color: #444; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-secondary:hover { background: #f5f5f5; }

/* ── Inventory listings table ─────────────────────────────────────────────── */
.listings-filters { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
.filter-input { flex: 1; max-width: 280px; padding: 0.45rem 0.75rem; border: 1px solid #ccc; border-radius: 6px; font-size: 0.9rem; }
.filter-select { padding: 0.45rem 0.6rem; border: 1px solid #ccc; border-radius: 6px; font-size: 0.9rem; }

.listings-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.listings-table th { padding: 0.6rem 0.8rem; text-align: left; background: #f0f0f4; font-size: 0.8rem; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #e0e0e0; }
.listings-table td { padding: 0.55rem 0.8rem; border-bottom: 1px solid #f0f0f0; font-size: 0.875rem; vertical-align: middle; }
.listings-table tr:last-child td { border-bottom: none; }
.listings-table tr:hover td { background: #fafafa; }
.edit-link { color: #4a6fa5; font-size: 0.85rem; text-decoration: none; }
.edit-link:hover { text-decoration: underline; }

.thumb { width: 40px; height: 56px; object-fit: contain; border-radius: 3px; }
.thumb-cell { width: 52px; }

.condition-badge { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.8rem; font-weight: 700; }
.cond-nm { background: #d4edda; color: #155724; }
.cond-lp { background: #cce5ff; color: #004085; }
.cond-mp { background: #fff3cd; color: #856404; }
.cond-hp { background: #f8d7da; color: #721c24; }

.status-badge { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.status-active { background: #d4edda; color: #155724; }
.status-hidden { background: #e2e3e5; color: #383d41; }
.status-sold   { background: #f8d7da; color: #721c24; }

.empty-state { text-align: center; padding: 3rem 1rem; color: #666; }
.empty-state p { margin-bottom: 1rem; }

/* ── Listing tool layout ──────────────────────────────────────────────────── */
.list-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .list-layout { grid-template-columns: 1fr; } }

.list-search-col, .list-detail-col { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden; }

/* Search box */
.search-box { padding: 1rem; border-bottom: 1px solid #eee; }
.search-box input { width: 100%; padding: 0.6rem 0.85rem; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; }
.search-box input:focus { outline: 2px solid #4a6fa5; border-color: transparent; }
.search-hint { display: block; margin-top: 0.4rem; font-size: 0.8rem; color: #999; }

/* Search results */
.search-results { max-height: 520px; overflow-y: auto; }
.search-loading, .search-empty, .search-error { padding: 1rem; font-size: 0.875rem; color: #666; }
.search-error { color: #c00; }

.results-table { width: 100%; border-collapse: collapse; }
.results-table th { padding: 0.45rem 0.7rem; text-align: left; background: #f7f7f9; font-size: 0.75rem; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #eee; position: sticky; top: 0; }
.results-table td { padding: 0.5rem 0.7rem; font-size: 0.85rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.result-row { cursor: pointer; }
.result-row:hover td { background: #f0f4ff; }
.result-row.selected td { background: #e8eeff; }
.result-row:focus { outline: 2px solid #4a6fa5; outline-offset: -2px; }
.price-col { text-align: right; font-size: 0.8rem; color: #444; }
.thumb-placeholder { display: block; width: 28px; height: 40px; background: #e8e8e8; border-radius: 3px; }

/* Detail panel */
.detail-placeholder { padding: 3rem 2rem; text-align: center; color: #999; font-size: 0.95rem; }

.card-preview { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.25rem; border-bottom: 1px solid #eee; }
.card-img-large { width: 130px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); flex-shrink: 0; }
.card-img-medium { width: 100px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.card-img-placeholder { width: 130px; height: 180px; background: #e0e0e0; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #999; flex-shrink: 0; }
.card-preview-info h2 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.card-meta { font-size: 0.85rem; color: #666; margin-top: 0.2rem; }

/* Listing form */
.listing-form { padding: 1.25rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.3rem; color: #333; }
.form-row input[type="text"],
.form-row input[type="number"],
.form-row select,
.form-row textarea { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; font-family: inherit; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: 2px solid #4a6fa5; border-color: transparent; }
.form-row input[type="number"] { max-width: 120px; }
.form-row small { display: block; margin-top: 0.25rem; font-size: 0.78rem; color: #888; }

.market-ref { font-size: 0.8rem; font-weight: 400; color: #888; margin-left: 0.5rem; }
.market-ref strong { color: #444; }
.optional { font-weight: 400; color: #999; font-size: 0.8rem; }

.price-input-wrap { display: flex; align-items: center; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; max-width: 180px; }
.price-input-wrap:focus-within { outline: 2px solid #4a6fa5; }
.price-prefix { padding: 0.5rem 0.6rem; background: #f5f5f5; border-right: 1px solid #ccc; font-size: 0.95rem; color: #555; }
.price-input-wrap input { border: none; border-radius: 0; outline: none; flex: 1; padding: 0.5rem 0.6rem; font-size: 0.95rem; }

.form-actions { display: flex; gap: 0.75rem; align-items: center; padding-top: 0.5rem; }

/* Edit layout */
.edit-layout { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; align-items: start; background: #fff; border-radius: 10px; padding: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08); max-width: 700px; }
@media (max-width: 600px) { .edit-layout { grid-template-columns: 1fr; } }
.edit-preview h2 { font-size: 1rem; margin: 0.5rem 0 0.25rem; }
