:root {
  --red: #b3261e;
  --deep-red: #861a16;
  --charcoal: #252525;
  --warm: #f7f3ee;
  --panel: #ffffff;
  --border: #e7ddd6;
  --muted: #68605b;
  --soft-red: #fdecea;
}
* { box-sizing: border-box; }
body { margin:0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background:#111; color:var(--charcoal); }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.shell { background:#111; min-height:100vh; padding:12px; }
.view-tabs { max-width:1400px; margin:0 auto 12px; display:flex; gap:8px; padding:8px; background:rgba(255,255,255,.08); border-radius:18px; }
.view-tabs button { flex:1; border:0; color:#fff; background:transparent; padding:12px 14px; border-radius:12px; font-weight:900; cursor:pointer; }
.view-tabs button.active { background:var(--red); }
.app-frame { max-width:1400px; margin:0 auto; background:#fff; border-radius:22px; overflow:hidden; box-shadow:0 18px 60px rgba(0,0,0,.35); }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; border-radius:9px; border:1px solid #d9cbc3; padding:10px 14px; font-size:14px; font-weight:900; background:#fff; color:var(--charcoal); box-shadow:0 1px 2px rgba(0,0,0,.06); cursor:pointer; transition:.15s ease; }
.btn:hover { transform: translateY(-1px); background:var(--warm); }
.btn.primary { background:var(--red); border-color:var(--deep-red); color:#fff; }
.btn.primary:hover { background:var(--deep-red); }
.btn.dark { background:var(--charcoal); border-color:var(--charcoal); color:#fff; }
.btn.danger { color:var(--red); border-color:#e8b9b3; }
.btn:disabled { opacity:.55; cursor:not-allowed; transform:none; }
.admin { display:grid; grid-template-columns:280px 1fr; min-height:calc(100vh - 24px); background:var(--warm); }
.sidebar { background:var(--charcoal); color:#fff; padding:22px; }
.brand { display:flex; align-items:center; gap:12px; margin-bottom:30px; }
.logo { width:44px; height:44px; border-radius:9px; display:grid; place-items:center; background:var(--red); color:#fff; font-weight:1000; }
.brand-title { font-weight:1000; }
.brand-sub { font-size:12px; color:rgba(255,255,255,.55); }
.nav-item { display:flex; align-items:center; gap:10px; width:100%; border:0; background:transparent; color:rgba(255,255,255,.75); padding:12px 14px; border-radius:12px; font-weight:900; text-align:left; cursor:pointer; }
.nav-item.active { background:var(--red); color:#fff; }
.nav-item:hover { background:rgba(255,255,255,.08); color:#fff; }
.main { padding:28px; }
.topbar { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:22px; }
h1 { margin:0; font-size:34px; line-height:1.05; letter-spacing:-.04em; }
h2 { margin:0; font-size:22px; letter-spacing:-.02em; }
h3 { margin:0; }
p { margin:0; }
.muted { color:var(--muted); line-height:1.55; }
.actions { display:flex; flex-wrap:wrap; gap:8px; }
.card { background:#fff; border:1px solid var(--border); border-radius:18px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.source-grid { display:grid; grid-template-columns:1fr auto; gap:18px; align-items:end; }
.field { display:block; font-size:13px; color:#635953; font-weight:900; }
.field input, .field textarea, .field select { width:100%; margin-top:8px; border:1px solid #d9cbc3; border-radius:10px; background:var(--warm); padding:11px 12px; color:var(--charcoal); }
.field textarea { min-height:105px; resize:vertical; }
.codebox { margin-top:8px; background:var(--warm); border-radius:10px; padding:13px; font:13px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; color:#4d4540; overflow:auto; }
.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin:18px 0; }
.stat { background:#fff; border:1px solid var(--border); border-radius:18px; padding:18px; }
.stat-label { color:#7a716c; font-size:13px; font-weight:800; }
.stat-num { margin-top:6px; font-size:38px; font-weight:1000; line-height:1; }
.stat-foot { margin-top:10px; color:var(--red); font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.06em; }
.grid-review { display:grid; grid-template-columns:.9fr 1.35fr; gap:18px; margin-top:18px; }
.queue-list { display:grid; gap:10px; }
.queue-item { width:100%; border:1px solid var(--border); background:var(--warm); border-radius:14px; padding:14px; text-align:left; cursor:pointer; }
.queue-item.active { border-color:var(--red); background:var(--soft-red); }
.queue-head { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.queue-title { font-weight:1000; }
.queue-cat { margin-top:5px; font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.06em; color:var(--red); }
.badge { display:inline-flex; align-items:center; border-radius:999px; background:#fff; padding:4px 8px; font-size:11px; font-weight:1000; text-transform:capitalize; color:#605853; white-space:nowrap; }
.queue-desc { margin-top:8px; color:#665f5b; font-size:13px; line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.editor-head { display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; align-items:flex-start; margin-bottom:16px; }
.status-pill { display:inline-flex; border-radius:999px; background:var(--soft-red); color:var(--deep-red); padding:5px 10px; font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.05em; }
.source-link { display:inline-flex; gap:5px; color:var(--red); font-size:13px; font-weight:900; text-decoration:none; margin-top:5px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px; }
.list-card { border:1px solid var(--border); border-radius:14px; padding:14px; }
.clean-list { margin:12px 0 0; padding:0; list-style:none; display:grid; gap:8px; }
.clean-list li { display:flex; gap:8px; align-items:flex-start; color:#514a46; font-size:13px; line-height:1.45; }
.check { color:var(--red); font-weight:1000; }
.raw { margin-top:14px; border:1px dashed #cdbdb4; background:var(--warm); border-radius:14px; padding:16px; }
.raw-title { display:flex; gap:8px; align-items:center; font-weight:1000; margin-bottom:8px; }
.raw pre { white-space:pre-wrap; margin:0; color:#4f4843; font:13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; max-height:260px; overflow:auto; }
.lower-grid { display:grid; grid-template-columns:.8fr 1.2fr; gap:18px; margin-top:18px; }
.category-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:9px; }
.category-pill { background:var(--warm); border:1px solid var(--border); border-radius:12px; padding:12px; }
.category-pill strong { display:block; }
.category-pill span { font-size:12px; color:#756c67; }
.logs { display:grid; gap:8px; max-height:260px; overflow:auto; }
.log { background:var(--warm); border-radius:12px; padding:10px 12px; font-size:13px; color:#4f4843; line-height:1.45; }
.log strong { color:var(--charcoal); }
.empty { border:1px dashed #cdbdb4; background:var(--warm); border-radius:14px; padding:26px; text-align:center; }
.empty-icon { font-size:34px; margin-bottom:8px; color:var(--red); }
.public { min-height:calc(100vh - 24px); background:var(--warm); }
.public header { border-bottom:1px solid var(--border); background:#fff; }
.utility { background:var(--charcoal); color:#fff; text-align:center; padding:8px 14px; font-size:12px; text-transform:uppercase; font-weight:900; letter-spacing:.04em; }
.pub-head { max-width:1280px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; padding:16px 20px; }
.pub-brand { display:flex; gap:12px; align-items:center; }
.pub-nav { display:flex; gap:24px; font-weight:900; color:#554d48; }
.hero { max-width:1280px; margin:0 auto; padding:40px 20px; display:grid; grid-template-columns:1.08fr .92fr; gap:28px; }
.hero-panel { background:#fff; border:1px solid var(--border); border-radius:18px; padding:32px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.kicker { display:inline-flex; border-radius:999px; background:var(--soft-red); color:var(--deep-red); padding:8px 12px; font-size:12px; text-transform:uppercase; font-weight:1000; letter-spacing:.05em; margin-bottom:18px; }
.hero h1 { font-size:56px; max-width:780px; }
.hero p { max-width:610px; font-size:18px; line-height:1.65; color:#655d58; margin-top:18px; }
.hero-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:24px; }
.mini-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:28px; }
.mini { background:var(--warm); border:1px solid var(--border); border-radius:13px; padding:14px; font-weight:900; }
.dark-panel { background:var(--charcoal); color:#fff; border-radius:18px; padding:22px; }
.dark-title { display:flex; justify-content:space-between; align-items:center; color:#ffb3ad; font-size:13px; font-weight:1000; text-transform:uppercase; letter-spacing:.05em; margin-bottom:16px; }
.dark-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.dark-card { border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.06); border-radius:13px; padding:13px; font-weight:900; }
.thumb { height:78px; border-radius:10px; margin-bottom:10px; background:linear-gradient(135deg,#5a5a5a,#313131,var(--deep-red)); }
.catalog-section { max-width:1280px; margin:0 auto; padding:0 20px 42px; }
.section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:18px; }
.product-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.product-card { background:#fff; border:1px solid var(--border); border-radius:18px; padding:14px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.product-image { height:172px; border-radius:13px; background:linear-gradient(135deg,#ddd,#c6c6c6,#8f8f8f); position:relative; overflow:hidden; }
.product-image img { width:100%; height:100%; object-fit:cover; display:block; }
.product-image .badge { position:absolute; top:10px; left:10px; background:var(--red); color:#fff; }
.product-cat { margin-top:14px; color:var(--red); font-size:11px; font-weight:1000; text-transform:uppercase; letter-spacing:.06em; }
.product-title { margin-top:4px; font-size:17px; font-weight:1000; line-height:1.2; }
.product-desc { margin-top:8px; font-size:13px; line-height:1.55; color:#655d58; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; min-height:61px; }
.product-actions { margin-top:14px; display:flex; flex-wrap:wrap; gap:8px; }
.notice { padding:14px; border-radius:14px; background:#fff6d5; border:1px solid #e6cd76; color:#66520e; font-size:14px; line-height:1.45; margin-top:12px; }
.error { padding:14px; border-radius:14px; background:#ffe9e6; border:1px solid #f0b1a9; color:#7f1d16; font-size:14px; line-height:1.45; margin-top:12px; }
@media (max-width: 1000px) {
  .admin { grid-template-columns:1fr; }
  .sidebar { position:relative; }
  .grid-review, .lower-grid, .hero, .source-grid { grid-template-columns:1fr; }
  .stats, .product-grid { grid-template-columns:repeat(2,1fr); }
  .hero h1 { font-size:42px; }
}
@media (max-width: 640px) {
  .main { padding:18px; }
  .topbar, .section-head, .pub-head { flex-direction:column; align-items:flex-start; }
  .pub-nav { display:none; }
  .stats, .product-grid, .form-grid, .two-col, .mini-grid, .dark-grid, .category-grid { grid-template-columns:1fr; }
  .hero h1 { font-size:34px; }
}

.section-head-mini { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:16px; }
.category-tree { display:grid; gap:14px; }
.category-tree.compact { max-height:420px; overflow:auto; padding-right:4px; }
.category-node { border:1px solid var(--border); border-radius:16px; overflow:hidden; background:#fff; }
.category-parent { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; background:var(--charcoal); color:#fff; padding:14px 16px; }
.category-parent strong { display:block; font-size:16px; }
.category-parent span { display:block; margin-top:4px; color:rgba(255,255,255,.62); font-size:12px; font-family:ui-monospace, SFMono-Regular, Consolas, monospace; }
.category-parent em { font-style:normal; background:rgba(255,255,255,.12); border-radius:999px; padding:5px 9px; font-size:11px; font-weight:1000; white-space:nowrap; }
.category-children { display:grid; gap:8px; padding:10px; background:var(--warm); }
.category-child { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; border:1px solid var(--border); background:#fff; border-radius:12px; padding:11px 12px; }
.category-child strong { display:block; }
.category-child span { display:block; margin-top:4px; color:#756c67; font-size:12px; font-family:ui-monospace, SFMono-Regular, Consolas, monospace; }
.category-child a { color:var(--red); font-size:12px; font-weight:900; text-decoration:none; white-space:nowrap; }
.empty-child { color:var(--muted); font-size:13px; padding:14px; }
.category-table-wrap { margin-top:14px; overflow:auto; border:1px solid var(--border); border-radius:14px; }
.category-table { width:100%; border-collapse:collapse; font-size:13px; }
.category-table th { text-align:left; background:var(--charcoal); color:#fff; padding:12px; }
.category-table td { border-top:1px solid var(--border); padding:11px 12px; vertical-align:top; }
.category-table code { background:var(--warm); border-radius:8px; padding:3px 6px; }
.category-table a { color:var(--red); font-weight:900; text-decoration:none; }
.image-review { margin-top:14px; border:1px solid var(--border); border-radius:14px; padding:14px; background:#fff; }
.image-review.empty-inline { background:var(--warm); border-style:dashed; }
.image-gallery { display:grid; grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:10px; }
.gallery-thumb { position:relative; display:block; height:92px; border-radius:12px; overflow:hidden; border:1px solid var(--border); background:linear-gradient(135deg,#ddd,#aaa); }
.gallery-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.gallery-thumb span { position:absolute; top:6px; left:6px; display:grid; place-items:center; width:22px; height:22px; border-radius:999px; background:var(--red); color:#fff; font-size:11px; font-weight:1000; }
@media (max-width: 640px) {
  .category-parent, .category-child { flex-direction:column; }
  .category-parent em { white-space:normal; }
}

/* Center-screen importer status overlay */
.import-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(17, 17, 17, .68);
  backdrop-filter: blur(5px);
}
.import-overlay.show { display: flex; }
.import-modal {
  width: min(460px, 92vw);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 24px;
  background: #fff;
  padding: 30px;
  text-align: center;
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
  animation: importPop .22s ease-out;
}
.import-modal h2 {
  margin-top: 16px;
  font-size: 26px;
  letter-spacing: -.03em;
}
.import-modal p {
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 340px;
}
.import-modal small {
  display: block;
  margin-top: 12px;
  color: #756c67;
  font-size: 12px;
  line-height: 1.45;
}
.import-spinner {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 0 auto;
}
.import-spinner span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 5px solid transparent;
  border-top-color: var(--red);
  animation: importSpin 1s linear infinite;
}
.import-spinner span:nth-child(2) {
  inset: 10px;
  border-top-color: var(--charcoal);
  animation-duration: 1.35s;
  animation-direction: reverse;
}
.import-spinner span:nth-child(3) {
  inset: 22px;
  border-top-color: var(--deep-red);
  animation-duration: .85s;
}
.import-progress {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--warm);
}
.import-progress div {
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--deep-red), var(--red), #e45b52);
  animation: importBar 1.25s ease-in-out infinite;
}
@keyframes importSpin { to { transform: rotate(360deg); } }
@keyframes importBar {
  0% { transform: translateX(-115%); }
  50% { transform: translateX(75%); }
  100% { transform: translateX(245%); }
}
@keyframes importPop {
  from { transform: translateY(8px) scale(.98); opacity: .75; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}


/* Sample public product detail page */
.product-detail-wrap { max-width:1280px; margin:0 auto; padding:28px 20px 48px; }
.product-detail { margin-top:18px; display:grid; grid-template-columns:.95fr 1.05fr; gap:24px; align-items:start; }
.detail-gallery, .detail-info { background:#fff; border:1px solid var(--border); border-radius:18px; padding:18px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.detail-main-image { min-height:470px; border-radius:15px; overflow:hidden; background:linear-gradient(135deg,#ddd,#bdbdbd,#8f8f8f); display:grid; place-items:center; }
.detail-main-image img { width:100%; height:100%; min-height:470px; object-fit:contain; background:#f2eee9; display:block; }
.detail-placeholder { color:#746b66; font-weight:900; }
.detail-thumbs { display:grid; grid-template-columns:repeat(auto-fill, minmax(78px, 1fr)); gap:10px; margin-top:12px; }
.detail-thumbs a { position:relative; height:78px; border-radius:12px; overflow:hidden; border:1px solid var(--border); background:var(--warm); display:block; }
.detail-thumbs img { width:100%; height:100%; object-fit:cover; display:block; }
.detail-thumbs span { position:absolute; top:5px; left:5px; width:20px; height:20px; display:grid; place-items:center; border-radius:50%; background:var(--red); color:#fff; font-size:10px; font-weight:1000; }
.detail-info h1 { margin-top:10px; font-size:46px; line-height:1.05; }
.detail-desc { margin-top:14px; font-size:17px; line-height:1.65; color:#625a55; }
.detail-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:22px; }
.detail-actions a.btn { text-decoration:none; }
.detail-panels { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:18px; }
@media (max-width: 1000px) {
  .product-detail { grid-template-columns:1fr; }
  .detail-main-image, .detail-main-image img { min-height:340px; }
  .detail-info h1 { font-size:36px; }
}
@media (max-width: 640px) {
  .detail-panels { grid-template-columns:1fr; }
  .detail-main-image, .detail-main-image img { min-height:260px; }
}


/* v5 smoother product detail layout */
.detail-topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}
.detail-source-note {
  color:#766c66;
  font-size:13px;
  font-weight:800;
}
.hero-detail {
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, .96fr);
  gap:28px;
}
.smooth-gallery {
  padding:20px;
  border-radius:24px;
}
.smooth-info {
  position:sticky;
  top:18px;
  border-radius:24px;
  padding:28px;
}
.detail-main-image {
  min-height:560px;
  transition: opacity .18s ease, transform .18s ease;
}
.detail-main-image.is-switching {
  opacity:.55;
  transform:scale(.992);
}
.detail-main-image img {
  min-height:560px;
  max-height:620px;
  object-fit:contain;
  padding:10px;
}
.gallery-meta {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
  color:#6d645f;
  font-size:13px;
}
.gallery-meta strong {
  display:inline-grid;
  place-items:center;
  min-width:34px;
  height:28px;
  margin-right:6px;
  border-radius:999px;
  background:var(--red);
  color:#fff;
}
.gallery-meta span { font-weight:800; color:#8a8079; }
.smooth-thumbs {
  display:flex;
  gap:11px;
  overflow-x:auto;
  padding:12px 2px 2px;
  scroll-snap-type:x mandatory;
}
.thumb-button {
  position:relative;
  width:92px;
  height:78px;
  flex:0 0 auto;
  overflow:hidden;
  border:2px solid var(--border);
  border-radius:14px;
  background:var(--warm);
  cursor:pointer;
  scroll-snap-align:start;
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.thumb-button:hover { transform:translateY(-2px); border-color:var(--red); }
.thumb-button.active { border-color:var(--red); box-shadow:0 0 0 4px rgba(179,38,30,.14); }
.thumb-button img { width:100%; height:100%; object-fit:cover; display:block; }
.thumb-button span {
  position:absolute;
  left:6px;
  top:6px;
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:999px;
  background:rgba(179,38,30,.95);
  color:white;
  font-size:11px;
  font-weight:1000;
}
.detail-quick-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin-top:22px;
}
.detail-quick-grid div {
  border:1px solid var(--border);
  border-radius:15px;
  background:var(--warm);
  padding:14px;
}
.detail-quick-grid span {
  display:block;
  color:#766c66;
  font-size:11px;
  font-weight:1000;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.detail-quick-grid strong {
  display:block;
  margin-top:4px;
  font-size:16px;
  color:var(--charcoal);
}
.detail-content-grid {
  display:grid;
  grid-template-columns: .85fr .85fr 1.3fr;
  gap:18px;
  margin-top:24px;
}
.detail-raw { margin-top:0; }
@media (max-width: 1100px) {
  .hero-detail { grid-template-columns:1fr; }
  .smooth-info { position:static; }
  .detail-content-grid { grid-template-columns:1fr; }
  .detail-main-image, .detail-main-image img { min-height:420px; }
}
@media (max-width: 640px) {
  .detail-topbar { align-items:flex-start; flex-direction:column; }
  .smooth-info { padding:20px; }
  .detail-quick-grid { grid-template-columns:1fr; }
  .detail-main-image, .detail-main-image img { min-height:300px; }
  .thumb-button { width:84px; height:70px; }
}

/* v6: clickable public product cards + simplified all-products admin table */
.product-card.clickable {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.product-card.clickable:hover {
  transform: translateY(-3px);
  border-color: rgba(179,38,30,.45);
  box-shadow: 0 12px 32px rgba(0,0,0,.10);
}
.product-card.clickable:focus-visible {
  outline: 3px solid rgba(179,38,30,.32);
  outline-offset: 3px;
}
.click-hint {
  margin-top: 10px;
  color: var(--red);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.products-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
.products-table th {
  text-align: left;
  padding: 12px;
  background: var(--charcoal);
  color: #fff;
  white-space: nowrap;
}
.products-table td {
  border-top: 1px solid var(--border);
  padding: 12px;
  vertical-align: middle;
}
.product-row {
  cursor: pointer;
  transition: background .12s ease;
}
.product-row:hover,
.product-row.active {
  background: var(--soft-red);
}
.product-cell {
  display: grid;
  grid-template-columns: 62px minmax(240px, 1fr);
  gap: 12px;
  align-items: center;
}
.product-cell strong {
  display: block;
  font-size: 14px;
}
.product-cell span {
  display: -webkit-box;
  margin-top: 4px;
  color: #6b625d;
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-mini-img {
  width: 62px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg,#ddd,#aaa);
  color: var(--red);
  font-weight: 1000;
}
.product-mini-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--warm);
  color: #5f5651;
}
.status-chip.status-published {
  background: #e6f5e8;
  color: #23723a;
}
.status-chip.status-review {
  background: #fff4ce;
  color: #775d0a;
}
.status-chip.status-draft {
  background: #e9edf4;
  color: #46576e;
}
.products-table a {
  color: var(--red);
  font-weight: 900;
  text-decoration: none;
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}
.mini-btn {
  padding: 7px 9px;
  font-size: 12px;
  border-radius: 8px;
}
@media (max-width: 800px) {
  .product-cell { grid-template-columns: 52px minmax(180px, 1fr); }
  .product-mini-img { width:52px; height:46px; }
  .table-actions { min-width: 180px; }
}

/* v7: product edit popover/modal for simplified All Products view */
.product-edit-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17,17,17,.66);
  backdrop-filter: blur(5px);
}
.product-edit-modal {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
  animation: modalPop .18s ease-out;
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
}
.modal-head h2 {
  margin-top: 8px;
  font-size: 28px;
}
.modal-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--warm);
  color: var(--charcoal);
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}
.modal-close:hover { background: var(--soft-red); color: var(--red); }
.modal-body-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 24px;
}
.modal-product-preview {
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--warm);
}
.modal-product-preview img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}
.modal-form-grid { grid-template-columns: 1fr 1fr; }
.modal-two-col { grid-template-columns: 1fr 1fr; }
.modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
}
@keyframes modalPop {
  from { opacity: .65; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 980px) {
  .product-edit-modal { max-height: 94vh; }
  .modal-body-grid { grid-template-columns: 1fr; }
  .modal-product-preview { min-height: 240px; }
  .modal-form-grid, .modal-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .product-edit-modal-backdrop { padding: 10px; align-items: stretch; }
  .product-edit-modal { width: 100%; max-height: 100%; border-radius: 18px; }
  .modal-head, .modal-body-grid, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot { flex-wrap: wrap; justify-content: stretch; }
  .modal-foot .btn { flex: 1 1 auto; }
}
