/* === Tom Select Styles === */
@import url('https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/css/tom-select.bootstrap5.min.css');
/* === DM Mono — precision technical font for product data === */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&display=swap');

/* === Reset y base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-warning: #d97706;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --sidebar-width: 260px;
  --topbar-height: 56px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════
   APP LAYOUT — Sidebar + Main
   ═══════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Sidebar header / logo */
.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group-label {
  display: block;
  padding: 0.75rem 1.25rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1.25rem;
  text-decoration: none;
  color: #94a3b8;
  border-radius: 0;
  transition: all 0.15s ease;
  position: relative;
  flex-wrap: wrap;
}

.sidebar-nav a .nav-hint {
  display: block;
  width: 100%;
  font-size: 0.7rem;
  color: #475569;
  margin-left: 2.25rem;
  margin-top: -0.2rem;
  line-height: 1.3;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}

.sidebar-nav a:hover .nav-hint {
  color: #64748b;
}

.sidebar-nav a.active {
  background: rgba(37, 99, 235, 0.15);
  color: #fff;
  border-right: 3px solid var(--color-primary);
}

.sidebar-nav a.active .nav-hint {
  color: rgba(147, 197, 253, 0.7);
}

.sidebar-nav a.active .nav-icon {
  color: var(--color-primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-text {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Sidebar footer / user */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0.75rem;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 0.25rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: capitalize;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: #64748b;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}

.sidebar-logout:hover {
  background: rgba(255,255,255,0.05);
  color: #f87171;
}

.sidebar-logout .nav-icon {
  width: 18px;
  height: 18px;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ── Top bar (mobile only) ──────────────────────────── */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 1rem;
  align-items: center;
  gap: 0.75rem;
  z-index: 50;
}

.topbar-menu {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-menu svg {
  width: 20px;
  height: 20px;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ── Main content ───────────────────────────────────── */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 1.75rem 2.5rem;
  width: 100%;
  min-width: 0;
}

/* ── Responsive (mobile) ────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
    box-shadow: 4px 0 25px rgba(0,0,0,0.3);
  }

  .sidebar-overlay.sidebar-overlay--visible {
    display: block;
  }

  .topbar {
    display: flex;
  }

  .app-main {
    margin-left: 0;
  }

  .main-content {
    padding: 1rem 1.25rem;
  }
}

/* ═══════════════════════════════════════════════════════
   AUTH LAYOUT (no sidebar)
   ═══════════════════════════════════════════════════════ */

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ═══════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════ */

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flash-notice { background: #ecfdf5; color: var(--color-success); border: 1px solid #bbf7d0; }
.flash-alert { background: #fef2f2; color: var(--color-danger); border: 1px solid #fecaca; }

/* ═══════════════════════════════════════════════════════
   PAGE HEADER with description
   ═══════════════════════════════════════════════════════ */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.page-description {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover { background: var(--color-bg); box-shadow: var(--shadow); }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: 0 2px 8px rgba(37,99,235,0.25); }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ── Split button (btn-group + dropdown) ─────────────────────────────────── */
.btn-group { display: inline-flex; align-items: stretch; position: relative; }
.btn-group > form > .btn { border-radius: 0; }
.btn-group > form:first-child > .btn { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group-arrow {
  padding: 0.3rem 0.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.btn-group-arrow::-webkit-details-marker { display: none; }
.btn-group-dropdown { position: relative; }
.btn-group-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  min-width: 170px;
  overflow: hidden;
}
.btn-group-dropdown[open] .btn-group-menu { display: block; }
.btn-group-menu form { display: block; margin: 0; }
.btn-group-menu-item,
.btn-group-menu form button,
.btn-group-menu form input[type="submit"] {
  display: block;
  width: 100%;
  padding: 0.45rem 0.85rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}
.btn-group-menu-item:hover,
.btn-group-menu form button:hover,
.btn-group-menu form input[type="submit"]:hover { background: var(--color-bg); }

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfe; }

/* ── Scrollable table wrapper ───────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.table-scroll table {
  border-radius: 0;
  box-shadow: none;
}

/* ── Compact table variant ──────────────────────────── */
.table-compact th,
.table-compact td {
  padding: 0.5rem 0.75rem;
}

.table-compact th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ── Column types ───────────────────────────────────── */
.col-product {
  min-width: 200px;
}

.col-category {
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-number {
  white-space: nowrap;
  text-align: right !important;
  min-width: 70px;
}

.col-center {
  text-align: center !important;
  white-space: nowrap;
}

.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right !important;
}

/* ── Mobile: products list table → cards ──────────────────
   IMPORTANT: scoped to .products-main to avoid breaking other
   table-compact uses (e.g. WooCommerce table in product show)
   ────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .products-main .table-scroll {
    overflow-x: unset;
    border-radius: 0;
    box-shadow: none;
    background: none;
  }

  .products-main .table-compact,
  .products-main .table-compact tbody {
    display: block;
  }

  .products-main .table-compact thead {
    display: none;
  }

  /* Each row → card with flex-wrap for 2-col meta grid */
  .products-main .table-compact tr {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
    padding: 0.875rem 1rem 0;
    position: relative;
    transition: box-shadow 0.15s, transform 0.15s;
  }

  .products-main .table-compact tr:active {
    transform: scale(0.99);
  }

  /* Reset all td defaults */
  .products-main .table-compact td {
    display: flex;
    border: none !important;
    background: none !important;
    text-align: left !important;
    white-space: normal;
    max-width: none;
    overflow: visible;
    padding: 0;
  }

  /* ── Product header: full width ─────── */
  .products-main .table-compact td.col-product {
    flex: 0 0 100%;
    display: block;
    padding: 0 5rem 0.75rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border) !important;
  }

  .products-main .product-cell-name {
    font-size: 0.925rem !important;
    font-weight: 600 !important;
  }

  /* ── Status: absolute top-right ──────── */
  .products-main .table-compact td.col-status {
    position: absolute;
    top: 0.875rem;
    right: 1rem;
    flex: 0 0 auto;
    padding: 0;
    display: flex;
    align-items: flex-start;
  }

  /* ── Meta grid: 2 columns ────────────── */
  .products-main .table-compact td.col-category,
  .products-main .table-compact td.col-number:not(.col-price) {
    flex: 0 0 50%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.15rem;
    padding: 0.6rem 0.5rem 0.6rem 0;
    border-bottom: 1px solid var(--color-border) !important;
    border-right: 1px solid var(--color-border) !important;
  }

  .products-main .table-compact td.col-price,
  .products-main .table-compact td.col-suppliers {
    flex: 0 0 50%;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0.15rem;
    padding: 0.6rem 0 0.6rem 0.5rem;
    border-bottom: 1px solid var(--color-border) !important;
    text-align: right;
  }

  /* Label above value */
  .products-main .table-compact td[data-label]::before {
    content: attr(data-label);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: block;
    flex-shrink: 0;
    line-height: 1;
    margin-bottom: 0.2rem;
  }

  /* ── Actions row: full width, bottom ──── */
  .products-main .table-compact td.col-actions {
    flex: 0 0 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 0 0.625rem;
  }

  .products-main .table-compact td.col-actions::before {
    display: none;
  }

  /* Larger touch targets */
  .row-action {
    width: 38px;
    height: 38px;
  }

  .row-action svg {
    width: 18px;
    height: 18px;
  }

  .col-category {
    max-width: none;
    white-space: normal;
  }
}

/* ── Product cell (combined SKU + Name + Brand) ─────── */
.product-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.product-cell-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-cell-name:hover {
  color: var(--color-primary);
}

.product-cell-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.product-sku {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.product-brand {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* ── Category label ─────────────────────────────────── */
.category-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ── Row action icons ───────────────────────────────── */
.row-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  transition: all 0.15s;
}

.row-action:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.row-action svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea { min-height: 100px; resize: vertical; }

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check input[type="checkbox"] { width: auto; }

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: var(--color-danger);
  font-size: 0.875rem;
}

.form-errors ul { margin-left: 1rem; }

/* ═══════════════════════════════════════════════════════
   CARDS / DETAIL VIEW
   ═══════════════════════════════════════════════════════ */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h2 { font-size: 1.1rem; margin-bottom: 1rem; font-weight: 600; }

.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
}

.detail-label { font-weight: 600; color: var(--color-text-muted); }

/* ═══════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: var(--color-success); }
.badge-warning { background: #fef3c7; color: var(--color-warning); }
.badge-danger { background: #fee2e2; color: var(--color-danger); }
.badge-info { background: #dbeafe; color: var(--color-primary); }
.badge-muted { background: #f1f5f9; color: var(--color-text-muted); }

/* ═══════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════ */

.text-muted { color: var(--color-text-muted); font-size: 0.85rem; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

/* ═══════════════════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}

.stat-card:hover {
  border-color: #cbd5e1;
}

.stat-card--highlight {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.stat-card--highlight .stat-value { color: var(--color-primary); }

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════
   BREADCRUMB
   ═══════════════════════════════════════════════════════ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--color-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--color-border); }
.breadcrumb-current { color: var(--color-text); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   CATEGORY TREE (index)
   ═══════════════════════════════════════════════════════ */

.category-tree { display: flex; flex-direction: column; gap: 0.75rem; }

.category-tree-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.category-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
  gap: 1rem;
  flex-wrap: wrap;
}

.category-tree-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-icon { font-size: 1rem; }

.category-tree-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.category-tree-name:hover { color: var(--color-primary); }

.category-tree-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.category-count { font-size: 0.875rem; color: var(--color-text-muted); }

.category-children { padding: 0.875rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.category-child-row { display: flex; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  text-decoration: none;
  transition: background 0.15s;
  flex-shrink: 0;
}

.category-chip:hover { background: #dbeafe; }
.category-chip--empty { background: var(--color-bg); border-color: var(--color-border); }

.category-chip-name { font-size: 0.8rem; font-weight: 500; color: var(--color-text); }

.category-chip-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-primary);
  color: #fff;
  border-radius: 9999px;
  padding: 0.05rem 0.35rem;
  min-width: 18px;
  text-align: center;
}

.category-chip--empty .category-chip-count { background: var(--color-text-muted); }

.category-grandchildren { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }

.category-grandchip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.15s;
}

.category-grandchip:hover { background: #f1f5f9; color: var(--color-text); }

/* ═══════════════════════════════════════════════════════
   SUBCATEGORY GRID (show)
   ═══════════════════════════════════════════════════════ */

.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.subcategory-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: var(--color-bg);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.subcategory-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
  background: #eff6ff;
}

.subcategory-card--empty { opacity: 0.6; }

.subcategory-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.subcategory-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.subcategory-card-count {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}

.subcategory-card-children { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.4rem; }

.subcategory-grandchip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid var(--color-border);
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.subcategory-grandchip-count { font-weight: 700; color: var(--color-text); }

.subcategory-card-footer {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--color-border);
}

/* ═══════════════════════════════════════════════════════
   TOM SELECT CUSTOM STYLES
   ═══════════════════════════════════════════════════════ */

.ts-wrapper {
  width: 100% !important;
}

.ts-wrapper.single .ts-control {
  background: #ffffff !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius) !important;
  padding: 0.6rem 0.85rem !important;
  font-size: 0.875rem !important;
  min-height: 38px !important;
  color: var(--color-text) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.ts-wrapper.single .ts-control:hover {
  border-color: var(--color-primary) !important;
  background: #fafbfc !important;
}

.ts-wrapper.single .ts-control.dropdown-active {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  background: #ffffff !important;
}

.ts-dropdown {
  background: #ffffff !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
              0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
  margin-top: 4px !important;
  z-index: 1000 !important;
}

.ts-dropdown-content {
  background: #ffffff !important;
  max-height: 300px !important;
  overflow-y: auto !important;
}

.ts-dropdown .option {
  padding: 0.6rem 0.85rem !important;
  font-size: 0.875rem !important;
  background: #ffffff !important;
  color: var(--color-text) !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}

.ts-dropdown .option:hover {
  background: #f8fafc !important;
}

.ts-dropdown .option.active {
  background: #eff6ff !important;
  color: var(--color-primary) !important;
  font-weight: 500 !important;
}

.ts-dropdown .option.selected {
  background: #e0f2fe !important;
  color: var(--color-primary) !important;
}

.ts-option-parent {
  font-weight: 600 !important;
  color: var(--color-text) !important;
  background: #ffffff !important;
}

.ts-option-child {
  padding-left: 1.5rem !important;
  color: var(--color-text-muted) !important;
  font-size: 0.85rem !important;
  background: #ffffff !important;
}

.ts-dropdown .optgroup-header {
  background: #f8fafc !important;
  color: var(--color-text-muted) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  padding: 0.5rem 0.85rem !important;
  letter-spacing: 0.05em !important;
}

.ts-dropdown .no-results {
  padding: 1rem 0.85rem !important;
  text-align: center !important;
  color: var(--color-text-muted) !important;
  font-size: 0.875rem !important;
  background: #ffffff !important;
}

.ts-wrapper.single .ts-control .item {
  color: var(--color-text) !important;
}

.ts-wrapper.single .ts-control::after {
  border-color: var(--color-text-muted) transparent transparent !important;
  border-width: 5px 5px 0 !important;
  margin-top: -3px !important;
}

.ts-dropdown .dropdown-input-wrap {
  padding: 0.5rem !important;
  background: #f8fafc !important;
  border-bottom: 1px solid var(--color-border) !important;
}

.ts-dropdown .dropdown-input {
  width: 100% !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.875rem !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: var(--color-text) !important;
}

.ts-dropdown .dropdown-input:focus {
  outline: none !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important;
}

.ts-dropdown .dropdown-input::placeholder {
  color: var(--color-text-muted) !important;
}

.ts-dropdown-content::-webkit-scrollbar { width: 8px; }
.ts-dropdown-content::-webkit-scrollbar-track { background: #f8fafc; border-radius: 4px; }
.ts-dropdown-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.ts-dropdown-content::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══════════════════════════════════════════════════════
   PRODUCT FILTERS SIDEBAR
   ═══════════════════════════════════════════════════════ */

.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ── Mobile filter overlay (backdrop) ──────────────────── */
.mobile-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 299;
  opacity: 0;
  transition: opacity 0.28s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ── Mobile: sidebar becomes a bottom-sheet drawer ──────── */
@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
  }

  .mobile-filter-overlay.is-visible {
    display: block;
    opacity: 1;
  }

  .filters-sidebar {
    /* Override sidebar to act as a fixed drawer */
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto !important;
    max-height: 88vh;
    z-index: 300;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    overflow-y: auto;
    padding: 0.75rem 1.25rem 2rem;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  }

  .filters-sidebar.is-open {
    transform: translateY(0);
  }
}

/* ── Mobile drawer grip bar ─────────────────────────────── */
.mobile-drawer-grip-bar {
  display: none;
}

@media (max-width: 900px) {
  .mobile-drawer-grip-bar {
    display: block;
    width: 44px;
    height: 5px;
    background: var(--color-border);
    border-radius: 9999px;
    margin: 0 auto 1rem;
    flex-shrink: 0;
  }
}

/* ── Mobile drawer top header ────────────────────────────── */
.mobile-drawer-top {
  display: none;
}

@media (max-width: 900px) {
  .mobile-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--color-primary);
  }

  /* Hide the desktop filters-title on mobile (replaced by mobile-drawer-top) */
  .filters-sidebar .filters-title {
    display: none;
  }
}

.mobile-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.mobile-filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35em;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9999px;
  line-height: 1;
}

.mobile-drawer-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.mobile-drawer-close-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

@media (max-width: 900px) {
  .mobile-drawer-close-btn {
    display: inline-flex;
  }
}

/* ── Mobile filter apply button ─────────────────────────── */
.mobile-filter-apply {
  display: none;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 900px) {
  .mobile-filter-apply {
    display: block;
  }
}

.filters-sidebar {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.filters-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
}

.filters-title svg {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

.filter-group {
  margin-bottom: 1.25rem;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-group:last-child { margin-bottom: 0; }

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-label-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.filter-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: all 0.2s ease;
}

.filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-input::placeholder { color: var(--color-text-muted); }

.filter-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.filter-range input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.filter-range input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #eff6ff;
  border-radius: var(--radius);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--color-surface);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-tag-remove {
  color: var(--color-danger);
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.2rem;
  text-decoration: none;
  transition: transform 0.15s;
}

.filter-tag-remove:hover { transform: scale(1.2); }

.clear-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-danger);
  text-decoration: none;
  border: 1px solid var(--color-danger);
  border-radius: 6px;
  transition: all 0.2s;
  background: var(--color-surface);
}

.clear-filters:hover {
  background: #fef2f2;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}

.products-main {
  min-width: 0;
}

.auto-brand-notice {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 6px;
  flex-wrap: wrap;
}

.auto-detected-chip {
  padding: 0.1rem 0.4rem;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.auto-brand-dismiss {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.auto-brand-dismiss:hover { color: var(--color-danger); }

/* ── Products toolbar (filter btn + count + sort) ───────── */
.products-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

/* Filter toggle button (hidden on desktop, shown on mobile) */
.btn-mobile-filter {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-mobile-filter:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-mobile-filter.has-filters {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .btn-mobile-filter {
    display: inline-flex;
  }
}

.products-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.products-count-pages {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.products-sort {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.products-sort form {
  display: flex;
}

.products-sort select {
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  min-width: 170px;
}

/* ── Mobile toolbar: filter + sort on row 1, count on row 2 ── */
@media (max-width: 900px) {
  .products-toolbar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .btn-mobile-filter {
    order: 1;
    flex-shrink: 0;
  }

  .products-sort {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
  }

  .products-sort select {
    min-width: 0;
    font-size: 0.8rem;
  }

  .products-count {
    order: 3;
    flex: 0 0 100%; /* own line below */
    font-size: 0.8rem;
    color: var(--color-text-muted);
  }
}

/* ── Active filter chips bar (mobile) ───────────────────── */
.active-filter-chips {
  display: none;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

@media (max-width: 900px) {
  .active-filter-chips {
    display: flex;
  }
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #1d4ed8;
  white-space: nowrap;
}

.filter-chip-clear {
  background: #fff0f0;
  border-color: #fecaca;
  color: var(--color-danger);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip-clear:hover {
  background: #fef2f2;
}

/* ═══════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
  padding: 1rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: background 0.15s, border-color 0.15s;
}

.pagination a:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

.pagination .current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.pagination .disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .gap {
  border: none;
  background: none;
}

/* ═══════════════════════════════════════════════════════
   SUPPLIER CARDS (index dashboard)
   ═══════════════════════════════════════════════════════ */

.supplier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

@media (max-width: 500px) {
  .supplier-cards {
    grid-template-columns: 1fr;
  }
}

.supplier-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s;
}

.supplier-card:hover {
  border-color: #cbd5e1;
}

.supplier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.supplier-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.supplier-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.supplier-card-name:hover {
  color: var(--color-primary);
}

.supplier-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.supplier-stat {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.supplier-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  display: block;
  line-height: 1.2;
}

.supplier-stat-value--success { color: var(--color-success); }
.supplier-stat-value--warning { color: var(--color-warning); }

.supplier-stat-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ── Progress bar ───────────────────────────────────── */
.supplier-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.supplier-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.supplier-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.supplier-progress-fill--complete {
  background: var(--color-success);
}

.supplier-progress-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.supplier-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

/* button warning variant */
.btn-warning {
  background: var(--color-warning);
  color: #fff;
  border-color: var(--color-warning);
}
.btn-warning:hover { background: #b45309; }

/* copy inline icon button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  vertical-align: middle;
  opacity: 0.35;
  transition: all 0.15s;
  margin-left: 3px;
  flex-shrink: 0;
}
.btn-copy svg { width: 12px; height: 12px; pointer-events: none; }
.btn-copy:hover { opacity: 1; background: var(--color-bg); color: var(--color-primary); }
.btn-copy--success { color: var(--color-success) !important; opacity: 1 !important; background: #ecfdf5 !important; }

/* ── OEM chip list ───────────────────────────────────────────────────────── */
.oem-list { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; }
.oem-chip {
  font-size: 0.68rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── WooCommerce sync dropdown ───────────────────────────────────────────── */
.woo-dropdown { position: relative; display: inline-block; }

.woo-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  list-style: none;
}
.woo-dropdown-btn::-webkit-details-marker { display: none; }
.woo-dropdown-btn::marker { display: none; }

.woo-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.12), 0 4px 6px -2px rgba(0,0,0,0.06);
  z-index: 300;
  min-width: 230px;
  overflow: hidden;
}

.woo-dropdown[open] .woo-dropdown-menu {
  display: block;
  animation: wooDropIn 0.15s ease;
}

@keyframes wooDropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.woo-menu-section { padding: 0.35rem; }

.woo-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: none;
  border: none;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.875rem;
}
.woo-menu-item:hover { background: var(--color-bg); }

.woo-menu-item--all { font-weight: 500; }
.woo-menu-item--all:hover { background: var(--color-primary-light); }

.woo-store-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.woo-store-avatar--all {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.woo-menu-info {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  flex: 1;
}
.woo-menu-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.woo-menu-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.woo-menu-divider { height: 1px; background: var(--color-border); margin: 0 0.35rem; }

.woo-menu-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  padding: 0.5rem 1rem 0.2rem;
}

.woo-sync-status { font-size: 0.71rem; font-weight: 500; line-height: 1.2; }
.woo-sync-status--synced       { color: var(--color-success); }
.woo-sync-status--pending_sync { color: var(--color-warning); }
.woo-sync-status--sync_failed  { color: var(--color-danger); }
.woo-sync-status--new          { color: var(--color-text-muted); }

/* ── Refresh split button ────────────────────────────────────────────────── */
.refresh-split { display: inline-flex; align-items: stretch; }
.refresh-split > form { display: flex; margin: 0; }
.refresh-split > form > .btn {
  height: 100%;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}
.refresh-split-toggle { position: relative; display: flex; }
.refresh-split-toggle > summary {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255,255,255,0.3);
  list-style: none;
  cursor: pointer;
  line-height: 1;
}
.refresh-split-toggle > summary::-webkit-details-marker,
.refresh-split-toggle > summary::marker { display: none; }
.refresh-split-toggle[open] > summary { background: var(--color-primary-dark); }
.refresh-split-toggle[open] .woo-dropdown-menu { display: block; }

/* ═══════════════════════════════════════════════════════
   VIEW TABS (Pendientes / Todos)
   ═══════════════════════════════════════════════════════ */

.view-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.view-tab:hover {
  color: var(--color-text);
  border-bottom-color: #cbd5e1;
}

.view-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.view-tab-badge {
  background: var(--color-warning);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   FILTER BAR (chip-based supplier filter)
   ═══════════════════════════════════════════════════════ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.filter-bar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-right: 0.25rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.filter-chip--active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.filter-chip-count {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255,255,255,0.3);
  padding: 0.05rem 0.3rem;
  border-radius: 9999px;
  min-width: 16px;
  text-align: center;
}

.filter-chip--active .filter-chip-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════
   SECTION HEADERS (icon + title + action)
   ═══════════════════════════════════════════════════════ */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
}

.section-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   COLLAPSIBLE SECTIONS
   ═══════════════════════════════════════════════════════ */

.collapsible summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
}

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

.collapsible-trigger::before {
  content: "▶";
  font-size: 0.6rem;
  margin-right: 0.5rem;
  color: var(--color-text-muted);
  transition: transform 0.2s;
  display: inline-block;
}

.collapsible[open] .collapsible-trigger::before {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════
   LOG OUTPUT
   ═══════════════════════════════════════════════════════ */

.log-output {
  background: var(--color-bg);
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  overflow-x: auto;
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-output--error {
  background: #fef2f2;
  color: var(--color-danger);
  border: 1px solid #fecaca;
}

/* ═══════════════════════════════════════════════════════
   IMPORT PROGRESS PANEL
   ═══════════════════════════════════════════════════════ */

.import-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  transform: translateY(calc(100% + 2rem));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.import-panel--visible { transform: translateY(0); }

.import-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--color-primary);
  color: #fff;
  gap: 0.5rem;
}

.import-panel__header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.import-panel__title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-panel__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.import-panel__close:hover { color: #fff; }

.import-panel__body { padding: 0.9rem 1rem; }

/* ── Fila de estado ─────────────────────────────────── */
.import-panel__status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.import-panel__status-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

/* ── Chips de progreso ──────────────────────────────── */
.import-panel__progress {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.3rem;
  padding: 0.45rem 0.6rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  word-break: break-word;
}

.import-panel__chip {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  white-space: normal;
}

.import-panel__chip--time {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.import-panel__chip--count {
  color: var(--color-text);
  font-weight: 600;
}

.import-panel__chip--label {
  color: var(--color-text-muted);
}

.import-panel__sep {
  color: var(--color-border);
  flex-shrink: 0;
  font-size: 0.65rem;
  line-height: 1.8;
}

/* ── Stats (completado) ─────────────────────────────── */
.import-panel__stats {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.import-panel__stat-row { display: flex; justify-content: space-between; align-items: center; }
.import-panel__stat-row strong { color: var(--color-text); font-size: 0.85rem; }
.import-panel__error { color: var(--color-danger); font-size: 0.8rem; line-height: 1.4; }
.import-panel__actions { margin-top: 0.75rem; }

.import-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: import-spin 0.75s linear infinite;
  flex-shrink: 0;
}

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

/* ═══════════════════════════════════════════════════════
   PHOTO GALLERY
   ═══════════════════════════════════════════════════════ */

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.photo-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.photo-link {
  display: block;
  width: 100%;
  height: 100%;
}

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

@media (max-width: 640px) {
  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
}

/* ═══════════════════════════════════════════════════════
   PRODUCT SHOW — Overview layout (info + image)
   ═══════════════════════════════════════════════════════ */

.product-show-overview {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.product-show-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.product-show-image {
  position: sticky;
  top: 1rem;
}

.product-main-image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-main-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.product-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0.5rem;
}

.product-main-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.product-main-image-wrap:hover .product-main-image-overlay {
  opacity: 1;
}

@media (max-width: 800px) {
  .product-show-overview {
    grid-template-columns: 1fr;
  }
  .product-show-image {
    position: static;
    max-width: 220px;
    justify-self: center;
  }
}

/* ═══════════════════════════════════════════════════════
   SUPPLIER PRODUCT CARDS
   ═══════════════════════════════════════════════════════ */

.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.sp-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.sp-card--best {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.sp-card--best:hover {
  border-color: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

/* Header: supplier name + status */
.sp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.sp-card-supplier {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.sp-supplier-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.sp-card--best .sp-supplier-avatar {
  background: var(--color-primary-dark);
}

.sp-supplier-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sp-supplier-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-supplier-name:hover {
  color: var(--color-primary);
}

.sp-best-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.1rem 0.4rem;
  width: fit-content;
}

/* SKU row */
.sp-card-sku-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
}

.sp-card-sku-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sp-card-sku-value {
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  color: var(--color-text);
  font-weight: 500;
  word-break: break-all;
}

/* Metrics: price + stock */
.sp-card-metrics {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sp-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.5rem;
  gap: 0.15rem;
}

.sp-metric-divider {
  width: 1px;
  background: var(--color-border);
  flex-shrink: 0;
  margin: 0.4rem 0;
}

.sp-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.sp-metric-value--best {
  color: var(--color-primary);
}

.sp-metric-value--stock {
  color: var(--color-success);
}

.sp-metric-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* OEM section */
.sp-card-oem {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sp-card-oem-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding-top: 0.1rem;
  white-space: nowrap;
}

/* Image thumbnails */
.sp-card-thumbs {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.sp-thumb-link {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.sp-thumb-link:hover {
  border-color: var(--color-primary);
}

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

.sp-thumb-more {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Actions */
.sp-card-actions {
  display: flex;
  gap: 0.4rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.sp-card-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0.3rem 0.5rem;
}

/* Notice banner */
.sp-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* Empty state */
.sp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--color-text-muted);
  text-align: center;
}

.sp-empty p {
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .sp-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Supplier card: fabricante / origen ─────────────── */
.sp-card-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
}

.sp-card-attr {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.sp-card-attr-key {
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sp-card-attr-val {
  color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════
   PRODUCT SHOW — Metrics row (replaces stats-grid)
   ═══════════════════════════════════════════════════════ */

.pshow-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.pshow-metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: border-color 0.15s;
}

.pshow-metric-card:hover { border-color: #cbd5e1; }

.pshow-metric-card--price {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.pshow-metric-card--highlight {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}

.pshow-metric-card--zero {
  opacity: 0.75;
}

.pshow-metric-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.pshow-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pshow-metric-card--price .pshow-metric-value { color: var(--color-primary); }
.pshow-metric-card--highlight .pshow-metric-value { color: var(--color-success); }

.pshow-metric-sub {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pshow-margin-badge {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  color: var(--color-success);
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
}

/* Card section title (consistent h2 with icon) */
.card-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0 !important;
}

@media (max-width: 900px) {
  .pshow-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .pshow-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   VEHICLE COMPATIBILITY SECTION
   ═══════════════════════════════════════════════════════ */

.compat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.compat-brand-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.compat-brand-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.compat-brand-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}

.compat-brand-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  text-transform: uppercase;
}

.compat-brand-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.compat-brand-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compat-brand-count {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.compat-models-list {
  padding: 0.4rem 0;
}

.compat-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  transition: background 0.1s;
}

.compat-model-row:hover {
  background: #fafbfe;
}

.compat-model-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compat-year-range {
  flex-shrink: 0;
}

.compat-year-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.compat-year-badge--all {
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-color: var(--color-border);
}

.compat-empty-card {
  padding: 1rem 1.25rem;
}

@media (max-width: 640px) {
  .compat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 400px) {
  .compat-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   PRODUCT METADATA FOOTER
   ═══════════════════════════════════════════════════════ */

.product-meta-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.6rem 0;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.product-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.product-meta-sep {
  color: var(--color-border);
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════
   SUPPLIER PRODUCT SHOW — Layout & Components
   ═══════════════════════════════════════════════════════ */

.spshow-grid {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.spshow-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.spshow-aside {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Link Status Cards */
.spshow-link-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.spshow-link-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
}

.spshow-link-header--linked {
  background: linear-gradient(135deg, #14532d 0%, #15803d 100%);
  color: #fff;
}

.spshow-link-header--unlinked {
  background: linear-gradient(135deg, #78350f 0%, #d97706 100%);
  color: #fff;
}

.spshow-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spshow-link-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}

.spshow-link-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
  margin-top: 0.1rem;
}

.spshow-link-body {
  padding: 1rem 1.1rem;
  background: var(--color-surface);
}

/* Linked product info row */
.spshow-product-ref {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.spshow-product-ref:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.spshow-product-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--color-primary-light);
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spshow-product-ref-sku {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-primary);
  display: block;
}

.spshow-product-ref-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  display: block;
  line-height: 1.3;
}

/* Price Breakdown */
.spshow-price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.spshow-price-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border);
}

.spshow-price-row:last-child { border-bottom: none; }

.spshow-price-operator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.spshow-price-operator--plus {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.spshow-price-operator--eq {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--color-primary);
  font-size: 1rem;
}

.spshow-price-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex: 1;
}

.spshow-price-value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

.spshow-price-value--total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
}

.spshow-store-block {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.spshow-store-block + .spshow-store-block {
  margin-top: 0.5rem;
}

.spshow-store-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Photo Gallery */
.spshow-gallery-main {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.spshow-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0.5rem;
}

.spshow-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.18s ease;
  flex-direction: column;
}

.spshow-gallery-main:hover .spshow-gallery-overlay { opacity: 1; }

.spshow-gallery-thumbs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.spshow-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.spshow-thumb:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

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

.spshow-thumb-more {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  border: 1px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-bg);
}

/* Compatibility list inside supplier product show */
.spshow-compat-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.spshow-compat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background 0.12s;
}

.spshow-compat-row:last-child { border-bottom: none; }
.spshow-compat-row:hover { background: var(--color-bg); }

.spshow-compat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  text-transform: uppercase;
}

.spshow-compat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.spshow-compat-brand {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  line-height: 1;
}

.spshow-compat-model {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.25;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spshow-compat-years {
  flex-shrink: 0;
}

/* Raw data pre */
.spshow-raw pre {
  background: #0f172a;
  color: #94a3b8;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.72rem;
  font-family: 'DM Mono', ui-monospace, monospace;
  overflow-x: auto;
  line-height: 1.6;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 0.75rem;
}

/* Supplier info in aside - buy URL button */
.spshow-buy-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  justify-content: center;
}

.spshow-buy-btn:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

@media (max-width: 860px) {
  .spshow-grid {
    grid-template-columns: 1fr;
  }
  .spshow-aside {
    position: static;
    order: -1;
  }
  .spshow-gallery-main {
    max-width: 240px;
  }
}

/* ═══════════════════════════════════════════════════════
   PRODUCT SHOW — KPI STRIP (replaces pshow-metrics)
   ═══════════════════════════════════════════════════════ */

.ps-kpi-strip {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.ps-kpi {
  padding: 1.1rem 1.4rem;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ps-kpi:last-child { border-right: none; }

.ps-kpi--price {
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 100%);
  border-right-color: rgba(255,255,255,0.12);
}

.ps-kpi--stock-ok {
  background: linear-gradient(145deg, #14532d 0%, #15803d 100%);
  border-right-color: rgba(255,255,255,0.12);
}

.ps-kpi-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
  display: block;
}

.ps-kpi--price .ps-kpi-eyebrow,
.ps-kpi--stock-ok .ps-kpi-eyebrow {
  color: rgba(255,255,255,0.6);
}

.ps-kpi-number {
  display: block;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.ps-kpi--price .ps-kpi-number,
.ps-kpi--stock-ok .ps-kpi-number {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ps-kpi-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
  line-height: 1.3;
}

.ps-kpi--price .ps-kpi-sub,
.ps-kpi--stock-ok .ps-kpi-sub {
  color: rgba(255,255,255,0.65);
}

.ps-kpi-margin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  margin-top: 0.45rem;
  width: fit-content;
}

.ps-kpi-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.45rem;
  width: fit-content;
}

@media (max-width: 860px) {
  .ps-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }
  .ps-kpi {
    border-bottom: 1px solid var(--color-border);
  }
  .ps-kpi:nth-child(2n) { border-right: none; }
  .ps-kpi:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 480px) {
  .ps-kpi-strip { grid-template-columns: 1fr; }
  .ps-kpi { border-right: none !important; }
  .ps-kpi:last-child { border-bottom: none; }
}

/* ═══════════════════════════════════════════════════════
   SUPPLIER CARDS — Enhanced Design
   ═══════════════════════════════════════════════════════ */

/* vs-best badge on non-cheapest suppliers */
.sp-vs-best {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-warning);
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 100px;
  padding: 0.08rem 0.45rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Price value gets monospace treatment */
.sp-metric-value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Price comparison mini-bar */
.sp-price-bar-track {
  height: 3px;
  border-radius: 100px;
  background: var(--color-border);
  overflow: hidden;
  margin-top: 0.2rem;
}

.sp-price-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp-price-bar-fill--mid {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.sp-price-bar-fill--high {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

/* Best card gets a subtle top-accent stripe */
.sp-card--best {
  border-top: 3px solid var(--color-success);
  border-color: #16a34a;
}

.sp-card--best:hover {
  border-color: #15803d;
  box-shadow: 0 4px 16px rgba(22,163,74,0.12);
}

.sp-card--best .sp-supplier-avatar {
  background: #16a34a;
}

.sp-best-badge {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

/* Improved supplier card SKU — monospace */
.sp-card-sku-value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 400;
}

/* Images: slightly larger thumbs */
.sp-thumb-link {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
}

.sp-thumb-more {
  width: 48px;
  height: 48px;
}

/* ═══════════════════════════════════════════════════════
   COMPATIBILITY — Enhanced Cards
   ═══════════════════════════════════════════════════════ */

.compat-brand-card {
  border-top: 3px solid var(--color-primary);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.compat-brand-card:hover {
  border-color: var(--color-primary-dark);
  box-shadow: 0 6px 16px rgba(37,99,235,0.1);
  transform: translateY(-1px);
}

.compat-brand-avatar {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  font-weight: 800;
  letter-spacing: 0.02em;
}

.compat-model-row {
  padding: 0.35rem 0;
}

.compat-year-badge {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  color: var(--color-text);
  white-space: nowrap;
}

.compat-year-badge--all {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════
   PRODUCT INFO CARD — Enhanced ficha
   ═══════════════════════════════════════════════════════ */

/* SKU/OEM codes use DM Mono */
.product-sku,
.oem-chip {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* WooCommerce section: monospace IDs */
code {
  font-family: 'DM Mono', ui-monospace, monospace;
}

/* ═══════════════════════════════════════════════════════
   MOBILE — Product show & SupplierProduct show
   ═══════════════════════════════════════════════════════ */

/* ── Very small screens: tighter content padding ────────── */
@media (max-width: 480px) {
  .main-content {
    padding: 0.875rem 0.875rem;
  }
}

/* ── Page header: stack and wrap actions on mobile ──────── */
@media (max-width: 680px) {
  .page-header {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .page-header .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  /* Make WooCommerce dropdown expand properly */
  .page-header .woo-dropdown {
    flex: 1;
  }

  .page-header .woo-dropdown-btn {
    width: 100%;
    justify-content: center;
  }

  .page-header h1 {
    font-size: 1.2rem;
  }
}

/* ── detail-grid: stack on small phones ─────────────────── */
@media (max-width: 480px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.15rem 0;
  }

  .detail-label {
    margin-top: 0.625rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
  }

  .detail-label:first-child {
    margin-top: 0;
  }
}

/* ── ps-kpi-strip: keep 2×2 grid until very small ──────── */
/* Override the previous 1-col at 480px — keep 2-col until 380px */
@media (max-width: 480px) {
  .ps-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }

  .ps-kpi {
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
  }

  .ps-kpi:nth-child(2n) { border-right: none; }
  .ps-kpi:nth-last-child(-n+2) { border-bottom: none; }

  .ps-kpi-number {
    font-size: 1.45rem;
  }

  .ps-kpi {
    padding: 0.875rem 0.875rem;
  }
}

@media (max-width: 360px) {
  .ps-kpi-strip {
    grid-template-columns: 1fr;
  }

  .ps-kpi {
    border-right: none !important;
  }

  .ps-kpi:not(:last-child) {
    border-bottom: 1px solid var(--color-border) !important;
  }
}

/* ── breadcrumb: wrap on narrow screens ─────────────────── */
.breadcrumb {
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .breadcrumb {
    font-size: 0.78rem;
  }
}

/* ── spshow-grid: don't reorder on mobile ───────────────── */
/* Photos should appear BELOW the main content on mobile */
@media (max-width: 860px) {
  .spshow-aside {
    position: static;
    order: 2; /* keep below main content */
  }

  .spshow-gallery-main {
    max-width: 100%;
  }

  .spshow-buy-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── spshow-link-body: make select full-width on mobile ─── */
@media (max-width: 600px) {
  .spshow-link-body .filter-input {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100%;
  }

  .spshow-link-body form > div {
    flex-wrap: wrap;
  }

  .spshow-link-body .btn {
    flex-shrink: 0;
  }
}

/* ── WooCommerce table (product show): card layout ──────── */
@media (max-width: 700px) {
  .woo-stores-table,
  .woo-stores-table tbody {
    display: block;
  }

  .woo-stores-table thead {
    display: none;
  }

  .woo-stores-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-bottom: 0.625rem;
    padding: 0.75rem;
    position: relative;
    gap: 0;
  }

  /* Store name: full width header */
  .woo-stores-table td.woo-td-store {
    flex: 0 0 100%;
    padding: 0 7rem 0.625rem 0; /* room for sync badge */
    border-bottom: 1px solid var(--color-border) !important;
    border: none;
  }

  /* Sync status: absolute top-right */
  .woo-stores-table td[data-label="Sync"] {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0;
    border: none !important;
  }

  .woo-stores-table td[data-label="Sync"]::before {
    display: none;
  }

  /* Other cells: 2-column grid */
  .woo-stores-table td[data-label] {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0.375rem 0.5rem 0;
    border: none !important;
    font-size: 0.875rem;
  }

  .woo-stores-table td[data-label="Precio"],
  .woo-stores-table td[data-label="Última sync"] {
    align-items: flex-end;
    padding-left: 0.375rem;
    padding-right: 0;
    text-align: right;
  }

  .woo-stores-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: block;
    margin-bottom: 0.2rem;
  }

  /* Actions */
  .woo-stores-table td.col-actions {
    flex: 0 0 100%;
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0 0;
    border-top: 1px solid var(--color-border) !important;
    border: none;
    margin-top: 0.25rem;
  }

  /* Divider between left/right meta columns */
  .woo-stores-table td[data-label="ID Woo"],
  .woo-stores-table td[data-label="Última sync"] {
    /* these are the right-side cells, no left divider needed */
  }
}

/* ── Supplier product show: margin form ─────────────────── */
@media (max-width: 560px) {
  /* The inline-styled margin form needs flex-wrap */
  .card form > div[style*="display:flex"] {
    flex-wrap: wrap !important;
  }
}

/* ── Raw data pre: always scrollable ───────────────────── */
.spshow-raw pre {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════
   PATENTE SEARCH BAR
   ═══════════════════════════════════════════════════════ */

.patente-search-bar {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.patente-form {
  margin: 0;
}

.patente-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  transition: border-color 0.15s, background 0.15s;
}

.patente-input-group:focus-within {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.55);
}

.patente-icon {
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}

.patente-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.25rem;
  min-width: 0;
}

.patente-input::placeholder {
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 0;
}

.patente-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  color: var(--color-primary);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.patente-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.patente-btn:active {
  transform: scale(0.97);
}

.patente-result-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  color: #fff;
  flex-wrap: wrap;
}

.patente-vehicle-label {
  font-weight: 600;
}

.patente-raw-model {
  color: rgba(255,255,255,0.65);
  font-size: 0.8rem;
  font-style: italic;
}

.patente-clear-link {
  margin-left: auto;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}

.patente-clear-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

@media (max-width: 600px) {
  .patente-search-bar {
    padding: 1rem;
    border-radius: var(--radius);
  }

  .patente-btn {
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
  }

  .patente-btn span {
    display: none;
  }
}
