﻿*, *::before, *::after {
  box-sizing: border-box;
}

/* 2026-04-23 UX Bug #5: WIP (Work In Progress) button state.
   Features not yet built are rendered as `disabled` + a "Proximamente"
   badge instead of an alert() that confesses lack of delivery. */
.btn[data-feature="wip"] {
  opacity: 0.55;
  cursor: not-allowed;
  position: relative;
}

.wip-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #5a3d2b;
  background: #fdf3e8;
  border: 1px solid #e7d2b8;
  border-radius: 999px;
  vertical-align: middle;
}

html,
body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  font-weight: 400;
}

:root {
  --paper-0: #F7F5F2;
  --paper-1: #FFFFFF;
  --paper-2: #F1EBE6;
  --ink-0: #2C2C2C;
  --ink-1: #6A6A6A;
  --line-0: #E6DBD0;
  --accent-0: #D6C3A3;
  --accent-1: #C5A882;
  --accent-dark: #3B2F2F;
  --cta-green: #22C55E;
  --bg-0: var(--paper-0);
  --bg-1: var(--paper-1);
  --panel-0: var(--paper-1);
  --panel-1: #FBF8F5;
  --line: var(--line-0);
  --line-soft: var(--line-0);
  --text-0: var(--ink-0);
  --text-1: #3B3531;
  --text-2: var(--ink-1);
  --ok: #22C55E;
  --warn: var(--accent-0);
  --danger: #B87F78;
  --danger-bg: #F4DEDA;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-0: 0 10px 20px rgba(60, 44, 34, 0.08);
  --ease: 160ms cubic-bezier(0.22, 0.82, 0.34, 1);
}

body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  font-weight: 400;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-0);
  box-shadow: var(--shadow-0);
  padding: 22px;
}

.kicker {
  margin: 0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 500;
}

.login-card h1 {
  margin: 8px 0 10px;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
}

.login-copy {
  margin: 0 0 14px;
  color: var(--text-1);
}

.login-form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-1);
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-0);
  color: var(--text-0);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent-0);
  outline: none;
}

.admin-shell {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 18px 14px 36px;
  display: grid;
  gap: 14px;
  overflow-x: hidden;
}

.app-shell {
  overflow-x: hidden;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: start;
  gap: 14px;
}

.admin-layout > * {
  min-width: 0;
}

.admin-sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-0);
  padding: 12px;
  box-shadow: var(--shadow-0);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.sidebar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  color: var(--text-0);
  text-decoration: none;
  background: var(--panel-1);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.sidebar-link:hover {
  border-color: rgba(248, 212, 138, 0.55);
  background: var(--panel-1);
  transform: translateY(-1px);
}

.main-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.admin-head {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-0);
  box-shadow: var(--shadow-0);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.head-copy h1 {
  margin: 6px 0 8px;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
}

.head-copy p {
  margin: 0;
  color: var(--text-1);
  max-width: 760px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-pill {
  min-height: 38px;
  border: 1px solid rgba(102, 178, 145, 0.55);
  background: rgba(111, 179, 155, 0.18);
  color: var(--text-0);
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
}

.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--panel-0);
  padding: 14px;
}

.quick-setup {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-1);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-copy h2 {
  margin: 0 0 5px;
  font-size: 1.08rem;
}

.quick-copy p {
  margin: 0;
  color: var(--text-1);
  font-size: 0.87rem;
}

.quick-setup-main {
  margin-bottom: 10px;
}

.quick-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pilot-note {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid rgba(87, 148, 255, 0.3);
  border-radius: 12px;
  background: rgba(201, 164, 116, 0.12);
}

.pilot-note h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.pilot-note p {
  margin: 0;
  color: var(--text-1);
  font-size: 0.86rem;
  line-height: 1.45;
}

.faq-admin-panel {
  display: grid;
  gap: 12px;
}

/* ─── WhatsApp global · backoffice section (Phase B · 2026-05-21) ────
 * Reuses the design tokens (--panel-1 cream, --line-soft, --text-1)
 * from the rest of the admin panel so the new section blends in
 * instead of looking grafted-on. Two-column layout collapses on
 * narrow viewports via the media query below.
 */

.whatsapp-global-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
}

.whatsapp-global-row .field {
  display: grid;
  gap: 6px;
}

.whatsapp-global-row .field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.whatsapp-global-row .field input {
  padding: 8px 10px;
  font-size: 0.96rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: white;
  color: var(--text-1);
  font-family: ui-monospace, "SF Mono", monospace;
  letter-spacing: 0.04em;
}

.whatsapp-global-row .field input:focus {
  outline: 2px solid #0d7d5c;
  outline-offset: 1px;
  border-color: #0d7d5c;
}

.whatsapp-global-row .hint {
  font-size: 0.78rem;
  color: #6b6660;
  line-height: 1.35;
  display: block;
}

#whatsapp-global-normalized {
  color: #0d7d5c;
  font-weight: 600;
}

@media (max-width: 720px) {
  .whatsapp-global-row {
    grid-template-columns: 1fr;
  }
}

.faq-editor-list {
  display: grid;
  gap: 10px;
}

.faq-editor-item {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.faq-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.faq-editor-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-editor-head strong {
  font-size: 0.94rem;
}

.faq-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 10px;
}

.faq-preview-shell {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-1);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.faq-preview-list {
  display: grid;
  gap: 10px;
}

.faq-preview-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-0);
  padding: 12px;
}

.faq-preview-index {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.faq-preview-item strong {
  display: block;
  margin: 0 0 4px;
}

.faq-preview-item p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.5;
}

.stats-grid {
  margin: 10px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stats-grid article {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  padding: 10px;
}

.stats-grid p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stats-grid h3 {
  margin: 6px 0 0;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.45rem;
}

.sync-panel {
  margin: 10px 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toolbar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-inline {
  margin-top: 8px;
}

.filters-admin {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  padding: 10px;
}

.admin-inline-note {
  margin: 6px 0 12px;
  color: var(--text-2);
  font-size: 0.84rem;
}

.admin-inline-note.compact {
  margin: 0;
}

.filters-admin h3 {
  margin: 0;
  font-size: 0.98rem;
}

.inventory-search-shell {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--panel-0);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  margin-bottom: 12px;
}

.inventory-search-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inventory-search-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.inventory-search-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.84rem;
  max-width: 740px;
}

.inventory-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-quick-views {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-quick-view {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.inventory-quick-view span {
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--panel-1);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.inventory-quick-view:hover {
  border-color: rgba(248, 218, 148, 0.55);
  transform: translateY(-1px);
}

.inventory-quick-view.is-active {
  border-color: rgba(248, 218, 148, 0.65);
  background: rgba(248, 218, 148, 0.1);
  color: var(--text-0);
}

.inventory-task-summary {
  margin: -2px 0 0;
  color: var(--text-2);
  font-size: 0.83rem;
}

.inventory-search-grid {
  display: grid;
  gap: 8px;
}

.inventory-search-grid-primary {
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(180px, 1fr));
  align-items: end;
}

.inventory-search-grid-advanced {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-search-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:12px; background:var(--panel-0); border:1px solid var(--line-soft); border-radius:12px; margin-bottom:12px; }
.search-input-wrap { flex:1; min-width:200px; position:relative; display:flex; align-items:center; }
#admin-search { width:100%; background:var(--panel-0); border:1px solid var(--line-soft); border-radius:8px; color:var(--text-0); padding:9px 32px; font-size:14px; }
#admin-search:focus { border-color:var(--accent-0); outline:none; }
.search-icon { position:absolute; left:10px; color:var(--text-2); }
.clear-btn { position:absolute; right:8px; background:none; border:none; color:var(--text-2); cursor:pointer; font-size:1rem; }
.search-meta {
  color:var(--text-1);
  font-size:0.875rem;
  white-space:nowrap;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}
.admin-search-shortcut { white-space: nowrap; }
.admin-pagination { display:flex; gap:4px; justify-content:center; padding:16px; flex-wrap:wrap; }
.page-btn { min-width:44px; height:44px; background:var(--panel-0); border:1px solid var(--line-soft); border-radius:8px; color:var(--text-0); cursor:pointer; font-size:0.875rem; font-weight:600; }
.page-btn.active { background:var(--accent-0); color:#07090f; border-color:var(--accent-0); }
.page-btn:hover:not(.active) { border-color:var(--accent-0); color:var(--accent-0); }
@media(max-width:599px) { .admin-search-bar { flex-direction:column; align-items:stretch; } .search-input-wrap, .admin-search-shortcut { width:100%; min-width:0; } }

.filters-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.filters-grid-primary {
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(180px, 1fr));
  align-items: end;
}

.filters-grid-advanced {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-span-2 {
  grid-column: span 2;
}

.inventory-filters-panel {
  margin-top: 12px;
}

.filters-feedback-row {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.active-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-1);
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-chip.is-neutral {
  color: var(--text-2);
  border-style: dashed;
}

.advanced-tools {
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--panel-1);
}

.advanced-tools summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-1);
}

.advanced-grid {
  margin-top: 10px;
}

.table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.table-head h2 {
  margin: 0;
}

.table-head p {
  margin: 0;
  color: var(--text-1);
  font-size: 0.83rem;
  max-width: 560px;
}

.table-panel {
  padding: 12px;
}

.table-wrap,
.table-wrapper {
  max-height: 60vh;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-1);
  color: var(--text-2);
  text-align: left;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 6px;
  white-space: normal;
  word-break: break-word;
}

tbody td {
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 4px;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

tbody tr:hover td {
  background: rgba(201, 164, 116, 0.12);
}

.cell-input,
.cell-select {
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  font-size: 0.85rem;
  padding: 7px 9px;
}

.cell-input.price,
.cell-input.stock {
  text-align: right;
}

.cell-textarea {
  min-height: 56px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  font-size: 0.82rem;
  padding: 7px 9px;
}

.cell-bool {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-1);
}

.row-actions {
  display: grid;
  gap: 6px;
  min-width: 132px;
}

.row-action-btn {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.row-action-btn.sell {
  border-color: rgba(253, 206, 122, 0.45);
  background: rgba(201, 164, 116, 0.18);
  color: var(--text-0);
}

.row-action-btn.bad {
  border-color: rgba(244, 129, 129, 0.5);
  background: var(--danger-bg);
  color: var(--text-0);
}

.status-chip {
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-chip.available {
  border-color: rgba(91, 218, 142, 0.44);
  color: var(--text-0);
}

.status-chip.sold {
  border-color: rgba(246, 128, 128, 0.45);
  color: var(--text-0);
}

.status-chip.reserved {
  border-color: rgba(244, 196, 95, 0.5);
  color: var(--text-0);
}

.status-chip.hidden {
  border-color: rgba(153, 173, 205, 0.36);
  color: var(--text-1);
}

.status-chip-btn {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 136px;
}

.status-chip-btn.status-disponible {
  border-color: rgba(91, 218, 142, 0.44);
  color: var(--text-0);
  background: rgba(111, 179, 155, 0.16);
}

.status-chip-btn.status-agotado {
  border-color: rgba(239, 111, 122, 0.5);
  color: var(--text-0);
  background: rgba(184, 121, 115, 0.16);
}

.status-chip-btn.status-preventa {
  border-color: rgba(244, 196, 95, 0.5);
  color: var(--text-0);
  background: rgba(201, 164, 116, 0.16);
}

.status-chip-btn.status-bajo_pedido,
.status-chip-btn.status-bajo-pedido {
  border-color: rgba(96, 164, 255, 0.5);
  color: var(--text-1);
  background: rgba(150, 170, 210, 0.16);
}

.status-dropdown {
  position: absolute;
  top: 120%;
  right: 0;
  z-index: 20;
  background: var(--panel-0);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 6px;
  display: grid;
  gap: 6px;
  min-width: 160px;
  box-shadow: var(--shadow-0);
}

.status-dropdown button {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  font-weight: 500;
}

.status-dropdown button:hover {
  border-color: var(--accent-0);
  color: var(--accent-0);
}

.notes h2 {
  margin: 0 0 8px;
}

.notes p {
  margin: 0;
  color: var(--text-1);
  line-height: 1.45;
}

.notes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notes-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.note-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-1);
  padding: 14px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.note-step {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(248, 212, 138, 0.45);
  background: rgba(248, 212, 138, 0.12);
  color: var(--text-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.note-card strong {
  display: block;
  margin-bottom: 4px;
}

.note-card p {
  font-size: 0.84rem;
}

.csv-structure {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  padding: 12px 14px;
}

.csv-structure summary {
  cursor: pointer;
  font-weight: 500;
}

.csv-structure p + p {
  margin-top: 10px;
}

.btn {
  min-height: 44px;
  border: 1px solid #c9a275;
  border-radius: 8px;
  background: #c9a275;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform var(--ease), border-color var(--ease), filter var(--ease), background var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-1);
}

.btn.ghost {
  background: transparent;
  color: var(--text-0);
  border-color: var(--line-soft);
}

.btn.danger {
  background: transparent;
  color: #b87973;
  border-color: #b87973;
}

.btn.accent {
  border-color: #c9a275;
  background: #c9a275;
  color: #ffffff;
}

.status {
  margin: 10px 0 0;
  min-height: 22px;
  color: var(--text-1);
  font-size: 0.84rem;
}

.sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(47, 35, 26, 0.08);
  backdrop-filter: blur(2px);
}

.sheet-modal.open {
  display: flex;
}

.sheet-modal-card {
  width: min(860px, 100%);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--panel-1);
  box-shadow: var(--shadow-0);
  padding: 14px;
  max-height: calc(100dvh - 30px);
  overflow: auto;
}

.sheet-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-modal-head h3 {
  margin: 0;
}

.sheet-modal-copy {
  margin: 8px 0 12px;
  color: var(--text-1);
}

.sheet-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sheet-modal-actions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

/* 2026-05-26 · product-form footer: visual hierarchy
 *  - Guardar (primary action) · ancho mayor · pegado a la derecha
 *  - Eliminar (destructive) · estilo ghost para no competir con primary */
.sheet-modal-actions #save-product-btn {
  min-width: 140px;
  padding: 10px 24px;
  font-weight: 600;
}

.sheet-modal-actions #delete-product-btn {
  margin-right: auto;
  background: transparent;
  border: 1px solid rgba(220, 80, 80, 0.45);
  color: rgba(220, 80, 80, 0.95);
  font-weight: 500;
}

.sheet-modal-actions #delete-product-btn:hover {
  background: rgba(220, 80, 80, 0.08);
  border-color: rgba(220, 80, 80, 0.7);
}

.sheet-modal-status {
  margin: 10px 0 0;
  min-height: 20px;
  color: var(--text-1);
}

.sheet-modal-status.error {
  color: #ffb0b0;
}

.sheet-modal-status.ok {
  color: #b4f5d3;
}

.sheet-oauth {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sheet-oauth p {
  margin: 0 0 8px;
  color: var(--text-1);
  font-size: 0.84rem;
}

.sheet-oauth-config {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
}

.sheet-oauth-hint {
  margin: 8px 0 10px;
  color: var(--text-2);
  font-size: 0.875rem;
}

.wizard-card {
  width: min(920px, 100%);
}

.wizard-steps {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.wiz-step {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: #eaf0fc;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
}

.wiz-step.active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent-0), var(--accent-1));
  color: var(--text-0);
}

.wizard-view {
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.wizard-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wizard-note {
  margin: 0;
  color: var(--text-1);
  font-size: 0.84rem;
}

.wizard-review {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  padding: 10px;
  color: var(--text-2);
  font-size: 0.85rem;
  line-height: 1.45;
}

.wizard-actions {
  justify-content: space-between;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-grid-primary,
  .inventory-search-grid-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .admin-shell {
    padding: 12px 10px 30px;
  }

  .head-actions {
    width: 100%;
  }

  .head-actions .btn,
  .head-actions .session-pill {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  .quick-actions {
    width: 100%;
  }

  .quick-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .filters-grid,
  .inventory-search-grid,
  .inventory-search-grid-primary,
  .inventory-search-grid-advanced,
  .filters-grid-primary,
  .filters-grid-advanced {
    grid-template-columns: 1fr;
  }

  .filter-span-2 {
    grid-column: span 1;
  }

  .filters-feedback-row {
    flex-direction: column;
  }

  .inventory-search-actions {
    width: 100%;
  }

  .inventory-search-actions .btn,
  .inventory-search-actions .search-meta {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  .sheet-modal-grid,
  .wizard-row {
    grid-template-columns: 1fr;
  }

  .faq-editor-grid {
    grid-template-columns: 1fr;
  }

  .sheet-oauth-config {
    grid-template-columns: 1fr;
  }

  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scraper-live-banner {
    grid-template-columns: 1fr;
  }

  .scraper-live-meta {
    grid-template-columns: 1fr;
  }

  .scraper-review-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-review-stage {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
}

@media (max-width: 768px) {
  .admin-shell {
    padding: 0 0 26px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    box-shadow: none;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding: 0 4px 6px;
    margin: 6px -4px 0;
    scrollbar-width: thin;
  }

  .sidebar-link {
    flex: 0 0 auto;
  }

  .main-content {
    padding: 12px;
  }
}

@media (max-width: 600px) {
  .login-screen {
    padding: 10px;
  }

  .login-card {
    padding: 16px;
    border-radius: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions .btn,
  .head-actions .btn,
  .head-actions .session-pill {
    flex: 1 1 100%;
  }

  .toolbar .btn {
    flex: 1 1 100%;
  }

  .table-wrap {
    max-height: 56vh;
  }

  .sheet-modal {
    padding: 8px;
  }

  .sheet-modal-card {
    max-height: calc(100dvh - 14px);
    padding: 10px;
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .product-modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .form-actions,
  .sheet-modal-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    min-height: 44px;
  }

  .product-table .col-variant,
  .product-table .col-date {
    display: none;
  }

  /* Columna de nombre mÃ¡s compacta */
  .cell-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .scraper-review-actions .btn,
  .image-review-head-actions .btn {
    width: auto;
    flex: 1 1 calc(50% - 4px);
  }

  .scraper-review-meta {
    grid-template-columns: 1fr;
  }

  .image-review-card {
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh;
    border-radius: 0;
  }

  .image-review-stage {
    grid-template-columns: 1fr;
  }

  .image-review-nav {
    width: 100%;
  }

  .image-review-canvas {
    min-height: 40vh;
  }
}

/* Product Table Styles */
.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}

.product-table thead th {
  background: var(--panel-0);
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: normal;
}

.product-table tbody tr {
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--ease);
}

.product-table tbody tr:hover {
  background: var(--panel-0);
}

.product-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--panel-0);
  vertical-align: middle;
}

.product-table .col-image {
  width: 86px;
}

.product-table .col-name {
  width: 320px;
}

.product-table .col-brand {
  width: 132px;
}

.product-table .col-variant {
  width: 118px;
}

.product-table .col-price {
  text-align: right;
  width: 144px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.product-table .col-category {
  width: 126px;
}

.product-table .col-date {
  color: var(--text-2);
  font-size: 0.85rem;
  width: 112px;
  white-space: nowrap;
}

.product-table .col-stock {
  width: 154px;
  text-align: center;
}

.product-table .col-actions {
  width: 328px;
}

.product-table code {
  background: rgba(201, 164, 116, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: monospace;
}

.product-table .badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8em;
  background: rgba(201, 164, 116, 0.12);
  color: var(--text-1);
}

.product-table .badge.success {
  background: rgba(111, 179, 155, 0.2);
  color: var(--ok);
}

.product-table .badge.warning {
  background: rgba(201, 164, 116, 0.2);
  color: var(--warn);
}

.actions-cell {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.actions-cell .btn {
  width: 100%;
  justify-content: center;
}
.product-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
}

.btn-icon {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0.7;
  transition: all var(--ease);
}

.btn-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.btn.small {
  min-height: 36px;
  min-width: 84px;
  padding: 8px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
  width: auto;
  flex: 0 0 auto;
}

.btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.action-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.row-menu {
  position: relative;
}

.row-menu summary {
  list-style: none;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 196px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  box-shadow: var(--shadow-0);
  display: grid;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.empty-state h3 {
  margin: 0 0 10px;
  color: var(--text-1);
}

.product-cards-container {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.product-card-admin {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-1);
  padding: 12px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
}

.admin-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
}

.card-info {
  min-width: 0;
}

.card-name {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}

.card-brand,
.card-price,
.card-sku {
  margin: 4px 0 0;
}

.card-brand {
  color: var(--text-1);
}

.card-task {
  margin: 6px 0 0;
  font-size: 0.82rem;
  font-weight: 500;
}

.card-task-ok {
  color: var(--text-1);
}

.card-task-info {
  color: var(--text-1);
}

.card-task-warn {
  color: #ffe2a7;
}

.card-task-muted {
  color: var(--text-2);
}

.card-status {
  grid-column: 1 / -1;
}

.card-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Product Form Styles */
.product-form {
  display: grid;
  gap: 18px;
}

/* 2026-05-26 · layout rework per Ana feedback "el tamaño de las secciones
 * y botones esta desproporcionado". Fixes:
 *  - align-items: start · evita que un campo con helper text largo estire
 *    la altura de toda la fila (el bug visible en Orden vs Stock)
 *  - min-height parejo en input/select · alinea visualmente labels lado a
 *    lado independiente del help text que cada uno tenga
 *  - .form-grid-full · clase modificadora para campos que ocupan toda la
 *    fila (WhatsApp per-producto · destaca como configuracion importante) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 12px;
  align-items: start;
}

.form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-grid > label > input:not([type="checkbox"]),
.form-grid > label > select,
.form-grid > label > textarea {
  min-height: 42px;
  box-sizing: border-box;
}

.form-grid > label.form-grid-full {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid rgba(248, 218, 148, 0.4);
  border-radius: 12px;
  background: rgba(248, 218, 148, 0.06);
  position: relative;
  margin-top: 4px;
}

.form-grid > label.form-grid-full::before {
  content: "Configuracion opcional";
  position: absolute;
  top: -9px;
  left: 14px;
  padding: 0 8px;
  background: var(--panel-1, #fff);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.form-checkboxes {
  display: flex;
  gap: 20px;
  padding: 10px 0;
}

.form-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
}

.form-checkboxes input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 0;
}

.image-upload-section {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}

.image-upload-section h4 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-1);
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-start;
}

.image-preview-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.image-preview-item {
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--ease), transform var(--ease);
}

.image-preview-item:hover {
  border-color: rgba(248, 218, 148, 0.55);
  transform: translateY(-1px);
}

.image-preview-item.is-pending {
  border-style: dashed;
}

.image-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 12px;
  background: var(--panel-1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.image-preview-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
  opacity: 0.92;
  transform: translateY(0);
  transition: opacity var(--ease);
}

.image-action-btn {
  min-height: 28px;
  min-width: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: #dce9fb;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.image-action-btn.ghost {
  background: var(--panel-1);
}

.image-action-btn.danger {
  border-color: rgba(239, 111, 122, 0.6);
  color: #f9a5ad;
}

.image-action-btn.primary {
  border-color: rgba(245, 158, 11, 0.6);
  color: #fcd34d;
}

.image-action-btn:hover {
  border-color: #648dca;
}

.image-preview-wrap:hover .image-preview-actions,
.image-preview-actions:focus-within {
  opacity: 1;
}

@media (hover: none) {
  .image-preview-actions {
    opacity: 1;
  }
}

.image-review-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}

.product-modal-card {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.form-help {
  margin: -6px 0 0;
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.4;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.875rem;
}

.scraper-review-panel {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-0);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.scraper-review-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.scraper-review-head h4 {
  margin: 4px 0 0;
}

.scraper-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scraper-review-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scraper-review-meta article {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-1);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.scraper-review-meta span {
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.scraper-review-meta strong {
  color: var(--text-0);
  word-break: break-word;
}

.image-review-modal {
  z-index: 120;
}

.image-review-card {
  width: min(1100px, 100%);
  display: grid;
  gap: 14px;
}

.image-review-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.image-review-counter {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  font-size: 0.84rem;
}

.image-review-stage {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 12px;
  align-items: center;
}

.image-review-canvas {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--panel-0);
  padding: 12px;
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.image-review-canvas img {
  max-width: 100%;
  max-height: calc(62vh - 24px);
  object-fit: contain;
  border-radius: 12px;
}

.image-review-nav {
  min-height: 56px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  color: var(--text-0);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
}

.image-review-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.image-review-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.image-review-thumb {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
  overflow: hidden;
  cursor: pointer;
}

.image-review-thumb.is-active {
  border-color: rgba(248, 218, 148, 0.7);
  box-shadow: 0 0 0 2px rgba(248, 218, 148, 0.14);
}

.image-review-thumb.is-primary {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.14);
}

.image-review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

label.required::after {
  content: " *";
  color: var(--danger);
}

/* Legacy dark-theme pill / cell-task block removed 2026-05-04.
   The original block used `var(--panel-0)` + `var(--text-0)` (dark-theme
   tokens) and `color: #ffe2a7` (pale yellow) — those leaked through the
   cascade in the light admin and produced cream-on-cream pills. The
   high-contrast block at the bottom of this file is now the only owner of
   .pill / .cell-task styling. Keep .pill-row layout though (no color leak):  */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.cell-meta {
  color: var(--text-1);
  font-size: 0.83rem;
  line-height: 1.35;
}

.cell-stock {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.cell-stock-note {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

.cell-name strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.22;
  white-space: normal;
}

.cell-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cell-sku {
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cell-variant {
  display: grid;
  gap: 4px;
  color: var(--text-1);
  line-height: 1.2;
}

.cell-variant span:last-child {
  color: var(--text-2);
  font-size: 0.86rem;
}

.card-sku {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-reference-admin {
  border-color: rgba(96, 164, 255, 0.45);
  color: var(--text-1);
  background: rgba(150, 170, 210, 0.16);
}

.pill-scraped-admin {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--text-1);
  background: rgba(111, 179, 155, 0.16);
}

.pill-storefront-ok {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--text-1);
  background: rgba(150, 170, 210, 0.16);
}

.pill-storefront-off {
  border-color: rgba(244, 196, 95, 0.45);
  color: var(--text-0);
  background: rgba(201, 164, 116, 0.16);
}

.pill-publication {
  background: rgba(201, 164, 116, 0.16);
  border-color: rgba(148, 167, 197, 0.32);
  color: var(--text-1);
}

.pill-publication.pill-draft {
  border-color: rgba(244, 196, 95, 0.45);
  color: var(--text-0);
  background: rgba(201, 164, 116, 0.16);
}

.pill-publication.pill-hidden {
  border-color: rgba(148, 167, 197, 0.35);
  color: var(--text-1);
  background: rgba(201, 164, 116, 0.12);
}

.pill-publication.pill-review_required {
  border-color: rgba(244, 196, 95, 0.45);
  color: var(--text-0);
  background: rgba(201, 164, 116, 0.16);
}

.pill-publication.pill-publish_ready {
  border-color: rgba(96, 164, 255, 0.45);
  color: var(--text-1);
  background: rgba(150, 170, 210, 0.16);
}

.pill-publication.pill-reserved {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--text-1);
  background: rgba(150, 170, 210, 0.2);
}

.pill-publication.pill-sold {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--text-1);
  background: rgba(74, 222, 128, 0.14);
}

.pill-publication.pill-archived {
  border-color: rgba(148, 167, 197, 0.35);
  color: var(--text-1);
  background: rgba(201, 164, 116, 0.12);
}

.form-help {
  margin: -4px 0 0;
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Status Messages */
.status {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin: 12px 0;
  min-height: 20px;
}

.status.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.status.success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--ok);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

/* Danger button style */
.btn.danger {
  background: transparent;
  color: #b87973;
  border-color: #b87973;
}

.btn.danger:hover {
  background: rgba(239, 111, 122, 0.1);
  border-color: #b87973;
}

.table-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  background: var(--panel-0);
  border-radius: 10px;
  margin-bottom: 10px;
}

.table-loading .spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-soft);
  border-top-color: var(--accent-0);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-0);
  font-weight: 500;
  margin: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #6fb39b;
}

.toast.error {
  background: #b87973;
}

#toast-container {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 120;
  display: grid;
  gap: 8px;
}

/* === MOBILE FIRST ENHANCEMENTS === */

/* Para mÃ³viles < 768px: layout mÃ¡s compacto */
@media (max-width: 768px) {
  .admin-shell {
    padding: 12px 8px 30px;
  }

  .admin-head {
    flex-direction: column;
    padding: 12px;
  }

  .head-copy h1 {
    font-size: 1.5rem;
  }

  .head-copy p {
    font-size: 0.88rem;
  }

  .head-actions {
    width: 100%;
    flex-direction: column;
  }

  .head-actions .btn,
  .head-actions .session-pill {
    width: 100%;
    justify-content: center;
  }

  .panel {
    padding: 12px;
  }

  .quick-setup {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-actions {
    width: 100%;
  }

  .quick-actions .btn {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .table-panel {
    padding: 10px;
  }

  .table-head {
    flex-direction: column;
    gap: 8px;
  }

  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Para mÃ³viles muy pequeÃ±os < 480px */
@media (max-width: 480px) {
  .admin-shell {
    padding: 10px 6px 24px;
  }

  .admin-head,
  .panel {
    padding: 10px;
  }

  .head-copy h1 {
    font-size: 1.3rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .stats-grid article {
    padding: 8px;
  }

  .quick-actions .btn {
    font-size: 0.88rem;
    padding: 10px 12px;
  }

  .table-wrap {
    border-radius: 10px;
  }

  .product-table {
    font-size: 0.82rem;
  }

  .product-table thead th {
    font-size: 0.875rem;
    padding: 6px 4px;
  }

  .product-table tbody td {
    padding: 5px 3px;
  }

  .wizard-steps {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .wiz-step {
    min-height: 36px;
    font-size: 0.875rem;
  }
}

/* Para mÃ³viles ultra pequeÃ±os < 320px - prevenir scroll horizontal */
@media (max-width: 320px) {
  .admin-shell {
    padding: 8px 4px 20px;
  }

  .admin-head,
  .panel {
    padding: 8px;
  }

  .head-copy h1 {
    font-size: 1.1rem;
    word-break: break-word;
  }

  .search-meta {
    font-size: 0.875rem;
  }

  .page-btn {
    min-width: 44px;
    height: 44px;
    font-size: 0.875rem;
  }

  .product-table {
    font-size: 0.875rem;
  }

  .product-table thead th,
  .product-table tbody td {
    padding: 4px 2px;
  }
}

/* â”€â”€ SCRAPER PANEL â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.scraper-config-grid,
.scraper-automation-grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.scraper-runtime-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.scraper-live-banner {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-0);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: start;
}

.scraper-live-copy h3 {
  margin: 6px 0;
  font-size: 1.08rem;
}

.scraper-live-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.scraper-live-meta-item {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(247, 238, 228, 0.9);
  padding: 10px;
}

.scraper-live-meta-item span {
  display: block;
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.scraper-live-meta-item strong {
  display: block;
  margin-top: 4px;
  font-size: 0.94rem;
  color: var(--text-0);
  word-break: break-word;
}

.scraper-live-banner.is-pending,
.scraper-live-banner.is-running,
.scraper-live-banner.is-unknown {
  border-color: rgba(244, 196, 95, 0.45);
  background: var(--panel-1);
}

.scraper-live-banner.is-succeeded,
.scraper-live-banner.is-dry_run {
  border-color: rgba(91, 218, 142, 0.45);
  background: var(--panel-1);
}

.scraper-live-banner.is-failed,
.scraper-live-banner.is-image_pull_backoff {
  border-color: rgba(248, 113, 113, 0.45);
  background: #f3d7d4;
}

.scraper-runtime-cards article,
.scraper-config-block {
  background: var(--panel-1);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}

.scraper-runtime-cards p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.scraper-runtime-cards h4 {
  margin: 8px 0 6px;
  font-size: 1rem;
}

.scraper-runtime-cards span {
  color: var(--text-1);
  font-size: 0.83rem;
}

.scraper-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}

.scraper-brand-grid,
.scraper-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scraper-brand-grid label,
.scraper-type-grid label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-1);
}

.scraper-brand-grid label:hover,
.scraper-type-grid label:hover {
  border-color: var(--accent-0);
}

.scraper-config-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scraper-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  min-height: 44px;
}

.scraper-toggle input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.scraper-jobs-section {
  margin-top: 1.5rem;
}

.scraper-jobs-list {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.scraper-jobs-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.scraper-jobs-list th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: var(--panel-1);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}

.scraper-jobs-list td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.job-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.job-status-badge.running {
  background: #fef3c7;
  color: #92400e;
}

.job-status-badge.succeeded,
.job-status-badge.completed {
  background: #d1fae5;
  color: #065f46;
}

.job-status-badge.failed {
  background: #fee2e2;
  color: #991b1b;
}

.job-status-badge.dry_run,
.job-status-badge.unknown {
  background: #eef2ff;
  color: #334155;
}

.scraper-jobs-list tr.running {
  animation: pulse-row 2s infinite;
}

@media (max-width: 900px) {
  .scraper-runtime-cards,
  .scraper-config-inputs {
    grid-template-columns: 1fr;
  }
}
@keyframes pulse-row { 0%,100% { opacity:1 } 50% { opacity:0.7 } }

/* === OVERRIDES 2026-03-28: merchant-first inventory + scraper UX === */

.product-table .col-image {
  width: 92px;
}

.product-table .col-name {
  width: 34%;
}

.product-table .col-price {
  width: 156px;
  text-align: left;
}

.product-table .col-stock {
  width: 156px;
}

.product-table .col-origin {
  width: 172px;
}

.product-table .col-date {
  width: 108px;
}

.product-table .col-actions {
  width: 272px;
  min-width: 272px;
}

.product-table td,
.product-table thead th {
  padding: 12px 10px;
}

.product-table thead th {
  font-size: 0.875rem;
}

.product-table tbody td {
  overflow: visible;
}

.cell-meta,
.cell-price,
.cell-origin {
  display: grid;
  gap: 4px;
}

.cell-meta {
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.4;
}

.cell-price strong,
.cell-origin strong {
  font-size: 0.96rem;
  color: var(--text-0);
}

.cell-price span,
.cell-origin span {
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.35;
}

.actions-cell {
  display: block;
}

.action-stack {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.action-stack .btn,
.action-stack .storefront-action,
.action-stack .row-menu {
  flex: 0 0 auto;
}

.action-stack .edit-btn {
  min-width: 86px;
}

.action-stack .storefront-action {
  min-width: 94px;
  white-space: nowrap;
  justify-content: center;
}

.action-stack .row-menu > summary {
  min-width: 64px;
}

.row-menu {
  position: relative;
}

.row-menu summary {
  list-style: none;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu[open] > summary {
  border-color: rgba(244, 212, 138, 0.55);
}

@media (max-width: 1200px) {
  .action-stack {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .action-stack .storefront-action {
    min-width: 96px;
  }
}

.row-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 212px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-0);
  box-shadow: var(--shadow-0);
  z-index: 24;
}

.row-menu-panel .btn {
  width: 100%;
  justify-content: center;
}

.image-health-badge {
  display: none;
}

.image-health-badge.visible {
  display: inline-flex;
}

.image-preview img.is-pending {
  border-style: dashed;
  border-color: rgba(244, 212, 138, 0.65);
  opacity: 0.92;
}

.inventory-search-shell {
  gap: 14px;
  padding: 14px;
}

.inventory-search-head {
  align-items: end;
}

.inventory-search-actions .btn {
  min-width: 148px;
}

.inventory-search-grid-primary {
  grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(180px, 1fr));
}

.inventory-search-grid-advanced {
  padding-top: 10px;
}

.filters-feedback-row {
  align-items: center;
}

.scraper-config-grid,
.scraper-automation-grid {
  gap: 12px;
}

.scraper-guided-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.scraper-active-summary {
  margin-top: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-0);
  color: var(--text-1);
  font-size: 0.9rem;
  line-height: 1.45;
}

.scraper-active-summary strong {
  color: var(--text-0);
}

.scraper-active-summary span {
  color: var(--text-2);
}

.scraper-last-run-summary {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(87, 148, 255, 0.28);
  border-radius: 12px;
  background: rgba(201, 164, 116, 0.22);
  color: var(--text-1);
  font-size: 0.88rem;
  line-height: 1.5;
}

.scraper-last-run-summary strong {
  color: var(--text-0);
}

.scraper-last-run-summary span {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
}

.scraper-picker {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-1);
  padding: 10px 12px;
}

.scraper-picker summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.scraper-picker summary::-webkit-details-marker {
  display: none;
}

.scraper-picker summary strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.scraper-kicker {
  display: inline-block;
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

.scraper-picker-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-0);
  color: var(--text-0);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: right;
}

.scraper-brand-grid,
.scraper-type-grid {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scraper-brand-grid label,
.scraper-type-grid label {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.scraper-config-inputs {
  align-items: end;
}

.scraper-config-inputs-tight {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scraper-volume-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.scraper-volume-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-0);
  color: var(--text-0);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), color var(--ease), transform var(--ease);
}

.scraper-volume-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 212, 138, 0.5);
}

.scraper-volume-btn.is-active {
  border-color: rgba(244, 212, 138, 0.65);
  background: rgba(201, 164, 116, 0.2);
  color: var(--text-0);
}

.scraper-advanced-panel {
  margin-top: 12px;
}

.scraper-live-banner {
  gap: 14px;
}

.scraper-live-copy .kicker {
  color: var(--text-2);
}

.scraper-job-list {
  display: grid;
  gap: 10px;
}

.scraper-jobs-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scraper-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.85rem;
}

.scraper-range select {
  min-width: 160px;
}

.scraper-jobs-pagination {
  margin-top: 14px;
}

.scraper-jobs-list {
  overflow: visible;
  border: 0;
  background: transparent;
}

.scraper-job-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-1);
  overflow: hidden;
}

.scraper-job-card > summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(190px, 1fr) minmax(132px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
}

.scraper-job-card > summary::-webkit-details-marker {
  display: none;
}

.scraper-job-card[open] > summary {
  border-bottom: 1px solid var(--line-soft);
}

.scraper-job-main,
.scraper-job-results,
.scraper-job-time {
  min-width: 0;
}

.scraper-job-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.scraper-job-topline strong {
  font-size: 0.94rem;
  word-break: break-word;
}

.scraper-job-mode {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
}

.scraper-job-subline {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.4;
}

.scraper-job-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scraper-job-results span {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-0);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.scraper-job-time {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.scraper-job-time strong {
  font-size: 0.9rem;
}

.scraper-job-time span {
  color: var(--text-2);
  font-size: 0.875rem;
  text-align: right;
}

.scraper-job-expand {
  color: var(--text-1);
  font-size: 0.875rem;
  font-style: normal;
  text-decoration: underline;
}

.scraper-job-detail {
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
}

.scraper-job-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scraper-job-detail-grid article {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-0);
  padding: 10px;
}

.scraper-job-detail-grid span {
  display: block;
  color: var(--text-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.scraper-job-detail-grid strong {
  display: block;
  margin-top: 4px;
  word-break: break-word;
  font-size: 0.88rem;
}

.scraper-job-detail-copy {
  margin: 0;
  color: var(--text-1);
  font-size: 0.84rem;
  line-height: 1.45;
}

.card-publication {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.875rem;
}

.cell-storefront {
  color: var(--text-3);
  font-size: 0.875rem;
}

.cell-storefront.is-visible,
.card-storefront-flag.is-visible {
  color: #86efac;
}

.cell-storefront.is-hidden,
.card-storefront-flag.is-hidden {
  color: #f9a5ad;
}

@media (max-width: 1200px) {
  .inventory-search-grid-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-span-2 {
    grid-column: 1 / -1;
  }

  .product-table .col-name {
    width: 30%;
  }

  .scraper-guided-grid {
    grid-template-columns: 1fr;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .scraper-job-card > summary {
    grid-template-columns: 1fr;
  }

  .scraper-job-time {
    justify-items: start;
  }
}

@media (max-width: 900px) {
  .main-content {
    padding-bottom: 28px;
  }

  .inventory-search-actions,
  .filters-feedback-row,
  .table-head {
    width: 100%;
  }

  .inventory-search-actions {
    justify-content: space-between;
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-search-actions .btn,
  .inventory-search-actions .search-meta {
    width: 100%;
  }

  .inventory-quick-views {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .inventory-quick-view {
    flex: 0 0 auto;
  }

  .inventory-search-grid-primary,
  .inventory-search-grid-advanced,
  .scraper-guided-grid,
  .scraper-config-grid,
  .scraper-automation-grid,
  .scraper-config-inputs,
  .scraper-config-inputs-tight {
    grid-template-columns: 1fr !important;
  }

  .notes-head,
  .table-head,
  .quick-setup,
  .faq-editor-head,
  .sheet-modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .table-head .toolbar-inline,
  .notes-head .toolbar-inline,
  .quick-actions,
  .faq-editor-actions {
    width: 100%;
  }

  .table-head .toolbar-inline .btn,
  .notes-head .toolbar-inline .btn,
  .quick-actions .btn,
  .faq-editor-actions .btn {
    width: 100%;
  }

  .scraper-job-detail-grid {
    grid-template-columns: 1fr;
  }

  .scraper-picker summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .scraper-picker-summary {
    text-align: left;
  }

  .sheet-modal-card,
  .product-modal-card,
  .image-review-card {
    width: 100%;
    max-width: 100%;
  }

  .form-checkboxes {
    flex-wrap: wrap;
    gap: 10px;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn,
  .card-actions .row-menu {
    width: 100%;
  }

  .card-actions .row-menu summary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .inventory-search-shell {
    padding: 12px 10px;
  }

  .search-meta {
    text-align: left;
  }

  .scraper-job-card > summary {
    padding: 12px;
  }

  .scraper-job-results {
    gap: 6px;
  }

  .scraper-job-results span {
    min-height: 28px;
    font-size: 0.875rem;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .note-card {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 12px;
  }

  .note-step {
    width: 36px;
    height: 36px;
  }
}

/* Premium harmonization: typography + palette */
h1,
h2,
h3,
h4 {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.kicker,
.panel-kicker,
.section-kicker,
.muted,
.helper-text {
  font-weight: 500;
  color: var(--text-2);
}

.btn,
.ghost-btn,
.pill,
.tag,
.badge,
.row-menu summary,
.quick-filter,
.scraper-job-results span {
  font-weight: 500;
}

.panel,
.card,
.scraper-job-card,
.inventory-search-shell,
.stats-card,
.note-card,
.faq-admin-panel,
.faq-preview-item,
.faq-editor-item,
.data-table,
.table-shell {
  background: var(--panel-1);
  border-color: var(--line-0);
  box-shadow: 0 12px 22px rgba(45, 34, 25, 0.1);
}

.btn.ghost,
.btn.outline,
.ghost-btn {
  border-color: var(--line-0);
  background: #fdf8f3;
  color: var(--text-1);
}

.btn.accent {
  background: var(--accent-0);
  color: #3c2f27;
}

.btn.success {
  background: var(--cta-green);
  color: #ffffff;
}

.badge,
.pill,
.tag {
  background: #fdf8f3;
  border-color: var(--line-0);
}




/* === Old-money admin overrides === */
.admin-head h1,
.login-card h1,
.stats-grid h3,
.footer-logo,
.table-head h2 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-0);
}

.btn,
.ghost-btn,
.pill,
.tag,
.badge,
.row-menu summary,
.quick-filter,
.inventory-quick-view,
.status-chip,
.status-chip-btn,
.row-action-btn {
  font-weight: 500;
}

.panel,
.card,
.scraper-job-card,
.inventory-search-shell,
.stats-card,
.note-card,
.faq-admin-panel,
.faq-preview-item,
.faq-editor-item,
.data-table,
.table-shell,
.admin-sidebar,
.admin-head,
.login-card {
  background: var(--panel-0);
  border-color: var(--line-0);
  box-shadow: var(--shadow-0);
}

.sidebar-link,
.inventory-quick-view,
.filter-chip,
.btn.outline,
.btn.ghost,
.ghost-btn,
.row-action-btn {
  background: var(--panel-1);
  border-color: var(--line-0);
  color: var(--text-0);
}

.btn.accent,
.btn.primary {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #ffffff;
}

.btn.success {
  background: var(--cta-green);
  border-color: var(--cta-green);
  color: #ffffff;
}

.status-chip-btn.status-disponible {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.status-chip-btn.status-agotado {
  border-color: rgba(184, 127, 120, 0.4);
  background: rgba(184, 127, 120, 0.12);
}

.status-chip-btn.status-preventa {
  border-color: rgba(214, 195, 163, 0.6);
  background: rgba(214, 195, 163, 0.16);
}

.status-chip-btn.status-bajo_pedido,
.status-chip-btn.status-bajo-pedido {
  border-color: rgba(214, 195, 163, 0.6);
  background: rgba(214, 195, 163, 0.16);
}

/* ============================================================================
 * 2026-05-01 Wave A3: Product detail drawer
 * Linear/Notion/Figma-grade slide-in side panel. Coexists with #product-modal.
 * ============================================================================ */

.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(47, 35, 26, 0.32);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out;
}

.drawer-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.product-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(560px, 100vw);
  background: var(--panel-0);
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 40px rgba(60, 44, 34, 0.12);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.22, 0.82, 0.34, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: none;
}

.product-drawer.open {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .drawer-scrim,
  .product-drawer {
    transition: none;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-1);
  flex-shrink: 0;
}

.drawer-close {
  border: 1px solid var(--line);
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-1);
  display: grid;
  place-items: center;
  transition: background 120ms ease, color 120ms ease;
}

.drawer-close:hover,
.drawer-close:focus-visible {
  background: var(--paper-2);
  color: var(--text-0);
  outline: none;
}

.drawer-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.drawer-title {
  font-size: 0.84rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.drawer-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent-0), var(--accent-1));
  color: var(--accent-dark);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.drawer-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 18px 32px;
  flex: 1 1 auto;
}

.drawer-hero {
  position: relative;
  margin: 14px -18px 18px;
  background: var(--paper-2);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.drawer-hero-canvas {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.drawer-hero-canvas img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}

.drawer-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-0);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: background 120ms ease;
}

.drawer-hero-nav:hover,
.drawer-hero-nav:focus-visible {
  background: #fff;
  outline: none;
}

.drawer-hero-nav.prev { left: 12px; }
.drawer-hero-nav.next { right: 12px; }

.drawer-hero-nav[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.drawer-hero-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}

.drawer-hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.drawer-hero-dot.active {
  background: #fff;
  transform: scale(1.4);
}

.drawer-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-section:last-child {
  border-bottom: none;
}

.drawer-section-title {
  margin: 0 0 8px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.drawer-section-meta {
  font-size: 0.875rem;
  color: var(--text-2);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.drawer-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  min-height: 32px;
}

.drawer-key {
  font-size: 0.875rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drawer-val {
  font-size: 0.92rem;
  color: var(--text-0);
  word-break: break-word;
}

.drawer-val.drawer-editable {
  cursor: text;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px dashed transparent;
  transition: border-color 120ms ease, background 120ms ease;
  margin: -4px -8px;
}

.drawer-val.drawer-editable:hover,
.drawer-val.drawer-editable:focus-visible {
  border-color: var(--accent-0);
  background: var(--paper-2);
  outline: none;
}

.drawer-val.drawer-editable.editing {
  padding: 0;
  border: none;
  background: transparent;
  margin: 0;
}

.drawer-edit-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--accent-1);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--text-0);
  outline: none;
}

.drawer-val.drawer-readonly {
  color: var(--text-1);
}

.drawer-attrs {
  margin: 0;
  color: var(--text-1);
  font-size: 0.92rem;
}

.drawer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-chip {
  border: 1px solid var(--line);
  background: var(--panel-1);
  color: var(--text-1);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.drawer-chip:hover,
.drawer-chip:focus-visible {
  border-color: var(--accent-1);
  outline: none;
}

.drawer-chip.active {
  background: linear-gradient(120deg, var(--accent-0), var(--accent-1));
  color: var(--accent-dark);
  border-color: transparent;
  font-weight: 500;
}

.drawer-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}

.drawer-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  cursor: pointer;
  padding: 0;
}

.drawer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drawer-thumb.active {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 2px var(--accent-0);
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-action-status {
  margin-top: 8px;
  min-height: 18px;
  font-size: 0.84rem;
}

.drawer-action-status.error { color: var(--danger); }
.drawer-action-status.ok { color: var(--ok); }

@media (max-width: 640px) {
  .product-drawer {
    width: 100vw;
    border-left: none;
  }
  .drawer-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .drawer-key {
    font-size: 0.875rem;
  }
}

/* ===========================================================================
   2026-05-04 — Bold semantic badge system (v2)
   The 2026-05-02 pastel palette technically passed WCAG (~4.5:1) but read as
   "cream on cream" because all hues sat in the 90%+ lightness band. With 4-5
   pills stacked per row, the eye couldn't differentiate them from glance.

   New rule: high-attention states (warning, danger, info-as-marketing) use
   SOLID saturated backgrounds with white or near-black text. Calm states
   (success-as-OK, neutral-hidden, brand) keep medium pastels. This gives
   real visual hierarchy at the row level, not just per-pill contrast.

   Contrast ratios on the light admin canvas:
     success      4.7:1   (pastel — calm)
     info         8.6:1   (solid blue, white text)
     warning     11.7:1   (solid amber, near-black text)
     danger       5.7:1   (solid red, white text)
     purple       6.8:1   (solid purple, white text)
     neutral      7.4:1   (medium gray bg, dark text)
     brand        6.2:1   (pastel gold, dark brown)
   =========================================================================== */

:root {
  /* SUCCESS — green, calm pastel (positive but doesn't need to shout) */
  --bdg-success-bg: #d1e7dd;
  --bdg-success-fg: #0f5132;
  --bdg-success-ring: #1a7c40;

  /* INFO — solid blue with white text (used for "Nuevo" — marketing) */
  --bdg-info-bg: #0d6efd;
  --bdg-info-fg: #ffffff;
  --bdg-info-ring: #0a58ca;

  /* WARNING — solid amber with NEAR-BLACK text (yellow demands dark text) */
  --bdg-warning-bg: #ffc107;
  --bdg-warning-fg: #1a1a1a;
  --bdg-warning-ring: #cc9900;

  /* DANGER — solid red with white text (image missing, blocking errors) */
  --bdg-danger-bg: #dc3545;
  --bdg-danger-fg: #ffffff;
  --bdg-danger-ring: #b02a37;

  /* PURPLE — origin labels (Referencia / Scrapeado), distinguished from data */
  --bdg-purple-bg: #6f42c1;
  --bdg-purple-fg: #ffffff;
  --bdg-purple-ring: #553098;

  /* NEUTRAL — hidden / archived / muted: medium gray bg, dark text */
  --bdg-neutral-bg: #e9ecef;
  --bdg-neutral-fg: #343a40;
  --bdg-neutral-ring: #adb5bd;

  /* BRAND — gold/cream, used for non-status meta */
  --bdg-brand-bg: #f4e8c5;
  --bdg-brand-fg: #5c3d0d;
  --bdg-brand-ring: #c4a86e;
}

/* Base pill — overrides line 2094 — clear contrast on light canvas */
.pill,
.cell-task {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.005em;
  border: 1px solid var(--bdg-neutral-ring);
  background: var(--bdg-neutral-bg);
  color: var(--bdg-neutral-fg);
  white-space: nowrap;
}

/* Storefront visibility — green when visible, neutral when hidden */
.pill.pill-storefront-ok {
  background: var(--bdg-success-bg);
  color: var(--bdg-success-fg);
  border-color: var(--bdg-success-ring);
}
.pill.pill-storefront-off {
  background: var(--bdg-neutral-bg);
  color: var(--bdg-neutral-fg);
  border-color: var(--bdg-neutral-ring);
}

/* "Nuevo" — info-blue (recommended new arrival) */
.pill.pill-new {
  background: var(--bdg-info-bg);
  color: var(--bdg-info-fg);
  border-color: var(--bdg-info-ring);
}

/* "HQ" — success-green (quality stamp) */
.pill.pill-hq {
  background: var(--bdg-success-bg);
  color: var(--bdg-success-fg);
  border-color: var(--bdg-success-ring);
}

/* Origin pills (Captura manual / Referencia demo / Scrapeado Yupoo) */
.pill-reference-admin {
  background: var(--bdg-purple-bg);
  color: var(--bdg-purple-fg);
  border-color: var(--bdg-purple-ring);
}
.pill-scraped-admin {
  background: var(--bdg-info-bg);
  color: var(--bdg-info-fg);
  border-color: var(--bdg-info-ring);
}

/* Publication-state pills */
.pill-publication {
  background: var(--bdg-brand-bg);
  color: var(--bdg-brand-fg);
  border-color: var(--bdg-brand-ring);
}
.pill-publication.pill-published {
  background: var(--bdg-success-bg);
  color: var(--bdg-success-fg);
  border-color: var(--bdg-success-ring);
}
.pill-publication.pill-draft {
  background: var(--bdg-warning-bg);
  color: var(--bdg-warning-fg);
  border-color: var(--bdg-warning-ring);
}
.pill-publication.pill-hidden {
  background: var(--bdg-neutral-bg);
  color: var(--bdg-neutral-fg);
  border-color: var(--bdg-neutral-ring);
}
.pill-publication.pill-review_required {
  background: var(--bdg-warning-bg);
  color: var(--bdg-warning-fg);
  border-color: var(--bdg-warning-ring);
}
.pill-publication.pill-publish_ready {
  background: var(--bdg-info-bg);
  color: var(--bdg-info-fg);
  border-color: var(--bdg-info-ring);
}
.pill-publication.pill-reserved {
  background: var(--bdg-purple-bg);
  color: var(--bdg-purple-fg);
  border-color: var(--bdg-purple-ring);
}
.pill-publication.pill-sold {
  background: var(--bdg-success-bg);
  color: var(--bdg-success-fg);
  border-color: var(--bdg-success-ring);
  opacity: 0.85;  /* sold = past-tense, slightly less attention */
}
.pill-publication.pill-archived {
  background: var(--bdg-neutral-bg);
  color: var(--bdg-neutral-fg);
  border-color: var(--bdg-neutral-ring);
}

/* Cell tasks (Estado column meta) */
.cell-task-ok {
  background: var(--bdg-success-bg);
  color: var(--bdg-success-fg);
  border-color: var(--bdg-success-ring);
}
.cell-task-info {
  background: var(--bdg-info-bg);
  color: var(--bdg-info-fg);
  border-color: var(--bdg-info-ring);
}
.cell-task-warn {
  background: var(--bdg-warning-bg);
  color: var(--bdg-warning-fg);
  border-color: var(--bdg-warning-ring);
}
.cell-task-muted {
  background: var(--bdg-neutral-bg);
  color: var(--bdg-neutral-fg);
  border-color: var(--bdg-neutral-ring);
}
.cell-task-danger {
  background: var(--bdg-danger-bg);
  color: var(--bdg-danger-fg);
  border-color: var(--bdg-danger-ring);
}

/* Generic .badge.warning (used by image-health-badge) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  text-transform: none;
}
.badge.warning,
.badge.image-health-badge {
  background: var(--bdg-danger-bg);
  color: var(--bdg-danger-fg);
  border-color: var(--bdg-danger-ring);
}
.badge.success {
  background: var(--bdg-success-bg);
  color: var(--bdg-success-fg);
  border-color: var(--bdg-success-ring);
}
.badge.info {
  background: var(--bdg-info-bg);
  color: var(--bdg-info-fg);
  border-color: var(--bdg-info-ring);
}
.badge.neutral {
  background: var(--bdg-neutral-bg);
  color: var(--bdg-neutral-fg);
  border-color: var(--bdg-neutral-ring);
}

/* Action-button cluster (Editar / Tienda / Ocultar / Mas) — was nearly
   invisible on cream backdrop. Promote to clear secondary buttons.
   The primary "Editar" stays accent (gold), the secondaries get a
   visible outline + hover that earns its position. */
.actions-cell .btn,
.row-menu-panel .btn,
.btn.small {
  border: 1px solid #c8b893;
  background: #ffffff;
  color: #4a3a1d;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 80ms ease;
}
.actions-cell .btn:hover,
.row-menu-panel .btn:hover,
.btn.small:hover {
  background: #f7eedf;
  border-color: #a48758;
  color: #2d220e;
  transform: translateY(-1px);
}
.actions-cell .btn:focus-visible,
.row-menu-panel .btn:focus-visible,
.btn.small:focus-visible {
  outline: 2px solid #a48758;
  outline-offset: 2px;
}
.actions-cell .btn.accent,
.actions-cell .btn.btn-edit,
.actions-cell button.editar,
.actions-cell .btn[data-action="edit"] {
  /* the primary "Editar" button keeps the brand gold; just bump contrast */
  background: #b48b50;
  color: #fff;
  border-color: #8e6a35;
}
.actions-cell .btn.accent:hover,
.actions-cell .btn.btn-edit:hover {
  background: #8e6a35;
  border-color: #6f5024;
}

/* Row meta hierarchy — "$0.00 / Sin precio comercial" was visually muted.
   Make $0 + currency the dominant element; keep "Sin precio" as secondary
   hint with a clear amber accent (this IS a warning state). */
.cell-price strong,
.product-card-price-main {
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1.02rem;
}
.cell-price small,
.product-card-price-note {
  color: var(--bdg-warning-fg);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Light dividers between rows for scannability — was barely visible */
.product-cards-container > * + *,
.product-row + .product-row {
  border-top: 1px solid #ece1cd;
}

/* Small alpha tweak on the selected/active filter chip so the
   active state earns vs the inactive (was the same beige). */
.chip-filter-btn.active,
.chip.active,
.filter-chip.active {
  background: var(--bdg-brand-bg);
  border-color: var(--bdg-brand-ring);
  color: var(--bdg-brand-fg);
  font-weight: 700;
}

/* Pill-row spacing — tighter vertical so the badge cluster feels grouped */
.pill-row {
  gap: 5px;
  margin-top: 4px;
  align-items: center;
}

/* Reduced-motion respect — kill hover-lift on action buttons */
@media (prefers-reduced-motion: reduce) {
  .actions-cell .btn,
  .row-menu-panel .btn,
  .btn.small {
    transition: none;
  }
  .actions-cell .btn:hover,
  .row-menu-panel .btn:hover,
  .btn.small:hover {
    transform: none;
  }
}

/* ===========================================================================
   2026-05-02 — Modern inventory gallery (Wave A2)
   The user asked for an Instagram/Linear-grade visual grid. The JS render
   was already in place (renderProductGallery in admin.js); CSS was empty,
   which collapsed every card to default block flow → looked like a list.
   This block makes it a true responsive card grid + hover quick-actions
   + status overlay badges + smooth focus-state.
   =========================================================================== */

/* View-toggle (Galeria / Lista pill-row) */
.inv-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #f5ecdc;
  border: 1px solid #d8c8a8;
}
.inv-view-toggle .inv-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: #6b5530;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.inv-view-toggle .inv-view-btn:hover {
  color: #2d220e;
}
.inv-view-toggle .inv-view-btn.is-active,
.inv-view-toggle .inv-view-btn[aria-selected="true"] {
  background: #ffffff;
  color: #2d220e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.inv-view-toggle .inv-view-btn:focus-visible {
  outline: 2px solid #a48758;
  outline-offset: 2px;
}

/* Responsive grid container */
.product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 6px 0 24px;
}

/* Individual gallery card */
.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #ece1cd;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 200ms ease, border-color 160ms ease;
  outline: none;
}
.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -16px rgba(56, 41, 14, 0.28),
              0 4px 10px -4px rgba(56, 41, 14, 0.12);
  border-color: #d8c8a8;
}
.gallery-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(180, 139, 80, 0.45);
  border-color: #b48b50;
}

/* Hero image area */
.gallery-card-hero {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f7eedf;
  overflow: hidden;
}
.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 360ms ease;
}
.gallery-card:hover .gallery-card-img {
  transform: scale(1.04);
}

/* Status overlay pills (top-right of hero) */
.gallery-card-overlays {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 4px;
  justify-content: flex-end;
  max-width: calc(100% - 16px);
  pointer-events: none;
}
.ov-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #2d220e;
  text-transform: uppercase;
}
.ov-new      { background: rgba(221, 232, 248, 0.95); color: #1d4d8c; border-color: rgba(29, 77, 140, 0.18); }
.ov-sold     { background: rgba(220, 242, 228, 0.95); color: #1a6b3d; border-color: rgba(26, 107, 61, 0.18); }
.ov-reserved { background: rgba(236, 230, 248, 0.95); color: #5a2d8c; border-color: rgba(90, 45, 140, 0.18); }
.ov-archived { background: rgba(236, 236, 236, 0.95); color: #4a4a4a; border-color: rgba(0, 0, 0, 0.10); }
.ov-hidden   { background: rgba(236, 236, 236, 0.95); color: #4a4a4a; border-color: rgba(0, 0, 0, 0.10); }
.ov-draft    { background: rgba(255, 240, 208, 0.95); color: #8b5a00; border-color: rgba(139, 90, 0, 0.20); }
.ov-bajo     { background: rgba(255, 240, 208, 0.95); color: #8b5a00; border-color: rgba(139, 90, 0, 0.20); }
.ov-agotado  { background: rgba(253, 226, 226, 0.95); color: #9a1c1c; border-color: rgba(154, 28, 28, 0.20); }

/* Image-broken health badge (bottom-left, only when img.error fired) */
.gallery-card-health {
  position: absolute;
  bottom: 8px;
  left: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.gallery-card-health.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hover-revealed quick-action toolbar (bottom-right of hero) */
.gallery-card-quick {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.gallery-card:hover .gallery-card-quick,
.gallery-card:focus-within .gallery-card-quick {
  opacity: 1;
  transform: translateY(0);
}
.quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.96);
  color: #4a3a1d;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 80ms ease, border-color 140ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.quick-icon:hover {
  background: #fff;
  color: #2d220e;
  border-color: #b48b50;
  transform: translateY(-1px);
}
.quick-icon.danger:hover {
  color: #9a1c1c;
  border-color: #e69a9a;
}
.quick-icon:focus-visible {
  outline: 2px solid #a48758;
  outline-offset: 2px;
}

/* Body — brand, name, price block */
.gallery-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 14px;
}
.gallery-card-brand {
  margin: 0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b5530;
  font-weight: 600;
}
.gallery-card-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.gallery-card-price-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.gallery-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  font-feature-settings: "tnum";
}
.gallery-card-ref {
  font-size: 0.875rem;
  color: #8b5a00;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Bottom status row */
.gallery-card-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #ece1cd;
}
.gallery-card-task {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bdg-neutral-bg);
  color: var(--bdg-neutral-fg);
  border: 1px solid var(--bdg-neutral-ring);
}
.gallery-card-task-warn  { background: var(--bdg-warning-bg); color: var(--bdg-warning-fg); border-color: var(--bdg-warning-ring); }
.gallery-card-task-ok    { background: var(--bdg-success-bg); color: var(--bdg-success-fg); border-color: var(--bdg-success-ring); }
.gallery-card-task-info  { background: var(--bdg-info-bg);    color: var(--bdg-info-fg);    border-color: var(--bdg-info-ring); }
.gallery-card-task-danger{ background: var(--bdg-danger-bg);  color: var(--bdg-danger-fg);  border-color: var(--bdg-danger-ring); }

/* Reduced-motion: kill the lift + zoom + pulse */
@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card-img,
  .gallery-card-quick,
  .quick-icon {
    transition: none;
  }
  .gallery-card:hover {
    transform: none;
  }
  .gallery-card:hover .gallery-card-img {
    transform: none;
  }
}

/* Mobile narrow — single column with reduced gap */
@media (max-width: 600px) {
  .product-gallery {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .gallery-card-quick {
    /* On touch, no hover — show always */
    opacity: 1;
    transform: none;
  }
  .gallery-card-name {
    font-size: 0.88rem;
  }
}

/* ===========================================================================
   2026-05-02 — Product Detail Drawer (Wave A3)
   Slide-in panel from right edge when card is clicked. Linear/Notion-grade.
   The JS controller listens for `anashop:product-open` and populates this
   markup; if the drawer markup is absent, the legacy edit modal still fires.
   =========================================================================== */

.product-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 4, 0.32);
  opacity: 0;
  pointer-events: none;
  z-index: 1100;
  transition: opacity 200ms ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.product-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.product-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: #fdf8ee;
  box-shadow: -16px 0 48px -16px rgba(56, 41, 14, 0.32);
  z-index: 1101;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.32, 0.72, 0.34, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.product-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #ece1cd;
  background: #fff;
}
.drawer-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #1a1a1a;
  font-weight: 600;
}
.drawer-head .drawer-sku {
  margin: 0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b5530;
  font-weight: 600;
}
.drawer-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8c8a8;
  background: #fff;
  color: #4a3a1d;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.drawer-close:hover {
  background: #f7eedf;
}
.drawer-close:focus-visible {
  outline: 2px solid #a48758;
  outline-offset: 2px;
}

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Image carousel — main image + thumbs */
.drawer-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-image-main {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f7eedf;
  border-radius: 10px;
  overflow: hidden;
}
.drawer-image-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.drawer-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.drawer-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f7eedf;
  cursor: pointer;
  padding: 0;
}
.drawer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.drawer-thumb.is-active {
  border-color: #b48b50;
}
.drawer-thumb:focus-visible {
  outline: 2px solid #a48758;
  outline-offset: 2px;
}

/* Inline-edit field rows */
.drawer-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 10px;
}
.drawer-key {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #6b5530;
}
.drawer-val {
  font-size: 0.92rem;
  color: #1a1a1a;
}
.drawer-input,
.drawer-val input,
.drawer-val select,
.drawer-val textarea {
  width: 100%;
  border: 1px solid #d8c8a8;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.92rem;
  color: #1a1a1a;
  font-family: inherit;
}
.drawer-input:focus,
.drawer-val input:focus,
.drawer-val select:focus,
.drawer-val textarea:focus {
  outline: 2px solid #a48758;
  outline-offset: 1px;
  border-color: #b48b50;
}

.drawer-section-title {
  margin: 8px 0 4px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #6b5530;
  border-bottom: 1px solid #ece1cd;
  padding-bottom: 4px;
}

/* Reference-price callout (the new A1 feature surfaced) */
.drawer-ref-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bdg-warning-bg);
  border: 1px solid var(--bdg-warning-ring);
  border-radius: 10px;
}
/* `display: flex` above defeats the [hidden] attribute. This rule restores
   it so products without a captured supplier price collapse the callout
   entirely (instead of showing an em-dash placeholder + the hint). */
.drawer-ref-block[hidden] {
  display: none;
}
.drawer-ref-key {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--bdg-warning-fg);
}
.drawer-ref-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bdg-warning-fg);
  font-feature-settings: "tnum";
}
.drawer-ref-hint {
  font-size: 0.875rem;
  color: #6b5530;
  font-weight: 500;
}

/* Footer — save + cancel */
.drawer-footer {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #ece1cd;
  background: #fff;
  justify-content: flex-end;
}
.drawer-footer .drawer-status {
  flex: 1 1 auto;
  font-size: 0.82rem;
  color: #6b5530;
  align-self: center;
}
.drawer-footer .drawer-status.is-success { color: var(--bdg-success-fg); }
.drawer-footer .drawer-status.is-error   { color: var(--bdg-danger-fg); }

/* Reduced-motion: instant slide */
@media (prefers-reduced-motion: reduce) {
  .product-drawer,
  .product-drawer-backdrop {
    transition: none;
  }
}

/* Mobile drawer = full-width sheet */
@media (max-width: 600px) {
  .product-drawer {
    width: 100vw;
  }
  .drawer-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .drawer-key {
    font-size: 0.875rem;
  }
}

