:root {
  --primary: #c0c1ff;
  --primary-container: #8083ff;
  --primary-deep: #6f00be;
  --on-primary: #1000a9;
  --secondary: #ddb7ff;
  --tertiary: #ffb783;
  --eci: #005c3e;
  --eci-light: rgba(0, 92, 62, 0.15);
  --mm: #e2001a;
  --mm-light: rgba(226, 0, 26, 0.15);
  --bg: #0b0e14;
  --surface: #13131b;
  --surface-low: #1b1b23;
  --surface-mid: #1f1f27;
  --surface-high: #292932;
  --surface-highest: #34343d;
  --on-surface: #e4e1ed;
  --on-surface-variant: #c7c4d7;
  --outline: #908fa0;
  --outline-variant: #464554;
  --green: #4ade80;
  --red: #f87171;
  --danger: #f87171;
  --radius: 1rem;
  --radius-lg: 2rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(192, 193, 255, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(111, 0, 190, 0.06) 0%, transparent 50%);
  color: var(--on-surface);
  min-height: 100vh;
  line-height: 1.5;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline-variant); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* Header */
.header {
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  color: var(--primary);
}

.logo-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.logo-link:hover .logo-icon {
  filter: drop-shadow(0 0 8px rgba(192, 193, 255, 0.5));
}
.subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--outline);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.last-scrape {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--outline);
}

.last-scrape .material-symbols-outlined {
  font-size: 1rem;
}

/* ── Header toolbar ── */
.header-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.toolbar-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.toolbar-btn-wrap .btn {
  width: 100%;
  min-width: 80px;
  justify-content: center;
}

.scrape-timer {
  font-size: 0.55rem;
  color: var(--outline);
  white-space: nowrap;
  line-height: 1;
  min-height: 0.8rem;
  transition: color 0.3s;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.scrape-timer.running {
  color: var(--primary);
  font-weight: 600;
}

.scrape-timer.done {
  color: var(--green);
}

/* Toolbar buttons — same size as nav-tab */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 2rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(192, 193, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(192, 193, 255, 0.35);
}

.btn-secondary {
  background: var(--surface-high);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.25);
  border-color: var(--red);
}

/* Icon-only button (circular) */
.btn-icon-only {
  padding: 0.35rem;
  min-width: 32px;
  min-height: 32px;
  justify-content: center;
  border-radius: 2rem;
}

.btn-eci {
  background: rgba(0, 92, 62, 0.2);
  color: #4ade80;
  border-color: rgba(0, 92, 62, 0.4);
}
.btn-eci:hover {
  background: rgba(0, 92, 62, 0.35);
  border-color: #4ade80;
}

.btn-eci-danger {
  background: rgba(0, 92, 62, 0.1);
  color: rgba(74, 222, 128, 0.8);
  border-color: rgba(0, 92, 62, 0.25);
}
.btn-eci-danger:hover {
  background: rgba(0, 92, 62, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

.btn-mm {
  background: rgba(226, 0, 26, 0.15);
  color: #f87171;
  border-color: rgba(226, 0, 26, 0.3);
}
.btn-mm:hover {
  background: rgba(226, 0, 26, 0.3);
  border-color: #f87171;
}

.btn-mm-danger {
  background: rgba(226, 0, 26, 0.1);
  color: rgba(248, 113, 113, 0.8);
  border-color: rgba(226, 0, 26, 0.2);
}
.btn-mm-danger:hover {
  background: rgba(226, 0, 26, 0.2);
  border-color: #f87171;
  color: #f87171;
}

/* Stats bar */
.header-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(192, 193, 255, 0.1);
  border: 1px solid rgba(192, 193, 255, 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.65rem 0.2rem 0.5rem;
  margin-left: 0.75rem;
  vertical-align: middle;
}

.header-stat-icon {
  font-size: 0.9rem;
  color: var(--primary);
}

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

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

.btn-small {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  min-height: 32px;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-small:hover {
  opacity: 0.85;
}

/* Scraping status */
.scraping-status {
  max-width: 1400px;
  margin: 1rem auto 0;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(192, 193, 255, 0.08);
  border: 1px solid rgba(192, 193, 255, 0.2);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}

.scraping-status.hidden { display: none; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spinning { animation: spin 1s linear infinite; }

/* Main layout */
.main-layout {
  max-width: 1400px;
  margin: 0 auto 1.5rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  min-height: calc(100vh - 100px);
}

/* Sidebar */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
}

/* ── Planograma ── */

.planograma-view {
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 1.5rem auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - 130px);
}

.planograma-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
}

.planograma-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
}

.planograma-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.planograma-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--outline);
  font-size: 1.25rem;
  pointer-events: none;
}

.planograma-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border-radius: 1rem;
  border: 1px solid var(--outline-variant);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.planograma-search input:focus {
  border-color: var(--primary);
}

.planograma-stats {
  font-size: 0.85rem;
  color: var(--outline);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.planograma-selected-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem 0;
}

.planograma-selected-toolbar .btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
}

/* Two-column body */
.planograma-body {
  flex: 1;
  display: flex;
  gap: 0.75rem;
  overflow: hidden;
}

/* Left column — all products (model names) */
.planograma-products-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--surface-high);
  min-width: 0;
}

.planograma-col-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--surface-high);
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface-variant);
}

.planograma-products-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0;
  min-width: 0;
}

#planogramaFilterChips {
  padding: 0.25rem 1rem 0.5rem;
  flex-shrink: 0;
}

.planograma-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.85rem;
  overflow: hidden;
  min-width: 0;
}

.planograma-item:hover {
  background: var(--surface-mid);
}

.planograma-item.selected {
  background: rgba(192, 193, 255, 0.1);
}

.planograma-item.out-of-stock-item {
  opacity: 0.55;
}

.planograma-item-icon {
  font-size: 1.1rem !important;
  color: var(--outline);
  flex-shrink: 0;
}

.planograma-item.selected .planograma-item-icon {
  color: var(--primary);
}

.planograma-item-modelo {
  font-weight: 500;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}


/* Right column — selected products */
.planograma-selected-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--primary-container);
  background: rgba(192, 193, 255, 0.03);
}

.planograma-selected-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.planograma-selected-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--surface-high);
}
.planograma-selected-card .psc-modelo {
  flex: 1;
}

.planograma-selected-card:last-child {
  margin-bottom: 0;
}

.psc-modelo {
  font-weight: 600;
  font-size: 0.88rem;
  font-family: 'Space Grotesk', monospace;
}

.psc-ref {
  font-family: monospace;
  color: var(--on-surface-variant);
}

.planograma-selected-remove {
  font-size: 1rem !important;
  color: var(--outline-variant);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}
.planograma-selected-remove:hover {
  color: var(--red);
}

/* Actions at bottom of right column */
.planograma-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.planograma-actions .btn {
  min-width: 0;
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  justify-content: center;
}

.page-title {
  max-width: 1400px;
  margin: 1.5rem auto 0;
  padding: 0 2rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.sidebar-search {
  padding: 0 1.25rem 0.75rem;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1.75rem;
  top: 0.65rem;
  font-size: 1.1rem;
  color: var(--outline);
}

.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.75rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search input:focus {
  border-color: var(--primary);
}

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem 0.75rem;
  overflow-x: auto;
  flex-shrink: 0;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 0.35rem 0.85rem;
  border-radius: 2rem;
  border: 1px solid var(--outline-variant);
  background: rgba(31, 31, 39, 0.6);
  color: var(--outline);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--on-surface-variant);
}
.chip.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.product-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.5rem 0.5rem;
}

.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.product-item:hover {
  background: var(--surface-mid);
}

.product-item.active {
  background: rgba(192, 193, 255, 0.1);
  border: 1px solid rgba(192, 193, 255, 0.3);
}

.product-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
}

.product-item-prices {
  text-align: right;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.product-original-price-line {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--on-surface);
  white-space: nowrap;
}
.product-original-price-line.has-discount {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--outline);
  text-decoration: line-through;
}

.product-store-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.price-eci { color: var(--eci); }
.price-mm { color: var(--mm); }
.price-na { color: var(--outline-variant); }

.promo-list-badge {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--tertiary);
  background: rgba(255, 183, 131, 0.15);
  padding: 0.05rem 0.3rem;
  border-radius: 0.3rem;
  margin-left: 0.25rem;
  white-space: nowrap;
}


/* Content */
.content {
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.sidebar-search {
  padding: 1rem 1.25rem 0.75rem;
  position: relative;
}

.content-header {
  text-align: center;
  padding: 0 0 0.75rem;
}

.content-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--outline);
  text-align: center;
  gap: 0.75rem;
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.3;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--on-surface-variant);
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 300px;
}

.hidden { display: none !important; }

/* Detail view */
.detail-view {
  animation: fadeIn 0.3s ease;
}

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

.detail-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.detail-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.badge-cat {
  background: rgba(192, 193, 255, 0.15);
  color: var(--primary);
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-eci-link {
  font-size: 0.72rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.product-eci-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.product-eci-link .material-symbols-outlined {
  font-size: 0.9rem;
}



/* Price comparison */
.price-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.store-card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.store-card.eci { border-left: 3px solid var(--eci); }
.store-card.mm { border-left: 3px solid var(--mm); }

.store-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: 0.75rem;
}

.store-logo {
  height: 1.4rem;
  width: auto;
  border-radius: 3px;
}

.eci .store-logo {
  height: 1.8rem;
  padding: 4px 6px;
}

.store-price {
  margin-bottom: 0.5rem;
}

.price-original-label {
  display: block;
  font-size: 1rem;
  color: var(--outline);
  text-decoration: line-through;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.price-current-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.store-card.eci .price-value { color: var(--eci); }
.store-card.mm .price-value { color: var(--mm); }

.price-status {
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.store-product-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--outline-variant);
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  line-height: 1.4;
}

.store-modelo {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--on-surface);
}

.store-ref,
.store-ean {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--outline);
}

.store-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.15rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.store-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.store-link .material-symbols-outlined {
  font-size: 0.85rem;
}

.store-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--outline);
}

.store-edit-price {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.store-edit-price input {
  width: 100px;
  padding: 0.3rem 0.5rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.5rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
}

.store-edit-price input:focus {
  border-color: var(--primary);
}

.promotion-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--tertiary);
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  margin: 0.25rem 0 0;
  background: rgba(255, 183, 131, 0.1);
  border-radius: 0.5rem;
  width: fit-content;
}

.promotion-date .material-symbols-outlined {
  font-size: 0.9rem;
  font-variation-settings: 'FILL' 1;
}

.diff-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.diff-up { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.diff-down { background: rgba(74, 222, 128, 0.15); color: var(--green); }
.diff-same { background: rgba(144, 143, 160, 0.15); color: var(--outline); }

/* Stats row */
.stats-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.mini-stat {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  flex: 1;
  min-width: 100px;
}

.mini-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--outline);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.mini-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.diff-highlight {
  border-color: var(--primary);
  background: rgba(192, 193, 255, 0.05);
}

/* Chart */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chart-tab {
  padding: 0.4rem 1rem;
  border: 1px solid var(--outline-variant);
  border-radius: 2rem;
  background: transparent;
  color: var(--outline);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chart-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chart-tab.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* Table */
.table-container {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.table-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.table-controls {
  margin-bottom: 0.75rem;
}

.table-controls select {
  padding: 0.4rem 0.75rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.5rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--outline-variant);
  color: var(--outline);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(70, 69, 84, 0.3);
}

tbody tr:hover {
  background: var(--surface-mid);
}

.store-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.store-badge.eci { background: var(--eci-light); color: var(--eci); }
.store-badge.mm { background: var(--mm-light); color: var(--mm); }

.stock-yes { color: var(--green); }
.stock-no { color: var(--red); }

/* Responsive */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    max-height: 300px;
  }
  .price-comparison {
    grid-template-columns: 1fr;
  }
  .header {
    padding: 0.75rem 1rem;
  }
  .main-layout {
    padding: 0 1rem;
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface-high);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  animation: slideUp 0.3s ease;
  font-size: 0.9rem;
  max-width: 400px;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.success { border-color: rgba(74, 222, 128, 0.3); }
.toast.error { border-color: rgba(248, 113, 113, 0.3); }
.toast .material-symbols-outlined { font-size: 1.25rem; }
.toast.success .material-symbols-outlined { color: var(--green); }
.toast.error .material-symbols-outlined { color: var(--red); }

/* ── Flag Button ── */
.btn-flag {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--outline);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-flag:hover {
  background: rgba(255, 183, 131, 0.15);
  color: var(--tertiary);
}

/* ── Flagged state on store cards ── */
.store-card.flagged {
  border-color: var(--tertiary) !important;
  background: rgba(255, 183, 131, 0.05);
  box-shadow: 0 0 12px rgba(255, 183, 131, 0.1);
}

/* ── Flagged price in sidebar ── */
.price-eci.flagged,
.price-mm.flagged {
  position: relative;
}
.price-eci.flagged { color: var(--tertiary); }
.price-mm.flagged { color: var(--tertiary); }

/* ── Flag Modal ── */
.flag-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.flag-modal {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

.flag-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--outline-variant);
  font-weight: 600;
}
.flag-modal-header .material-symbols-outlined { color: var(--tertiary); }

.btn-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--outline);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.flag-modal-body {
  padding: 1.5rem;
}

.flag-modal-body p {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--on-surface-variant);
}

.flag-modal-body textarea {
  width: 100%;
  min-height: 80px;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.75rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
}
.flag-modal-body textarea:focus {
  border-color: var(--primary);
}

.flag-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--outline-variant);
}

/* ── Flags Panel (Admin) ── */
.flags-panel {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.flags-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
.flags-panel-header:hover {
  color: var(--tertiary);
}
.flags-panel-header .material-symbols-outlined:first-child {
  color: var(--tertiary);
}
.flags-panel-header .chevron {
  margin-left: auto;
  font-size: 1.25rem;
}
.flags-panel-header .badge {
  background: rgba(255, 183, 131, 0.15);
  color: var(--tertiary);
}

.flags-panel-body {
  border-top: 1px solid var(--outline-variant);
  max-height: 400px;
  overflow-y: auto;
}

.flag-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(70, 69, 84, 0.3);
}
.flag-item:last-child {
  border-bottom: none;
}

.flag-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.flag-icon {
  font-size: 1.1rem;
  color: var(--tertiary);
  margin-top: 2px;
}

.flag-item-info {
  flex: 1;
}
.flag-item-info strong {
  font-size: 0.85rem;
  display: block;
}
.flag-meta {
  font-size: 0.75rem;
  color: var(--outline);
}

.btn-flag-resolve {
  background: none;
  border: none;
  color: var(--outline);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-flag-resolve:hover {
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
}

.flag-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--outline);
  margin-left: 1.6rem;
}

.flag-item-notes {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  margin-left: 1.6rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 183, 131, 0.06);
  border-radius: 0.4rem;
}

/* Flag indicator in sidebar */
.product-item.has-flag {
  border-left: 3px solid var(--tertiary);
}

/* ── Header Navigation Tabs ── */

.header-nav {
  display: flex;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 2rem;
  padding: 0.2rem;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  min-height: 32px;
  border: none;
  border-radius: 2rem;
  background: transparent;
  color: var(--outline);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--on-surface-variant);
}

.nav-tab.active {
  background: var(--surface-high);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.nav-tab .material-symbols-outlined {
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:not(.btn-icon-only) .material-symbols-outlined,
.toolbar-btn-wrap .material-symbols-outlined {
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.last-scrape .material-symbols-outlined {
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Changes View ── */

.changes-view {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 2rem 2rem;
  animation: fadeIn 0.3s ease;
}

.changes-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.changes-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.changes-store-chips {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.changes-store-chips .filter-chips {
  padding: 0.5rem 1.25rem 0.75rem;
}

.changes-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.changes-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--outline);
  font-weight: 500;
}

.changes-filter select {
  padding: 0.4rem 0.6rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.5rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
}

.changes-filter input[type="date"] {
  padding: 0.4rem 0.6rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.5rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  color-scheme: dark;
}

.changes-filter input[type="date"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(192, 193, 255, 0.15);
}

.changes-filter input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.changes-filter input[type="text"] {
  padding: 0.4rem 0.6rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.5rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  width: 140px;
}
.changes-filter input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(192, 193, 255, 0.15);
}

.changes-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  overflow-x: auto;
}

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

.changes-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--outline-variant);
  color: var(--outline);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.changes-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(70, 69, 84, 0.3);
  vertical-align: middle;
}

.changes-table tbody tr:hover {
  background: var(--surface-mid);
}

.changes-table tbody tr:last-child td {
  border-bottom: none;
}

.change-store {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.change-store.eci {
  background: var(--eci-light);
  color: var(--eci);
}

.change-store.mm {
  background: var(--mm-light);
  color: var(--mm);
}

.change-store-link {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.3rem;
  text-decoration: none;
  opacity: 0.6;
}
.change-store-link:hover {
  opacity: 1;
}
.change-store-link .material-symbols-outlined {
  font-size: 0.85rem;
}

.change-old {
  color: var(--outline);
  text-decoration: line-through;
  font-size: 0.8rem;
}

.change-new {
  color: var(--red);
  font-weight: 700;
  font-size: 0.9rem;
}
.out-of-stock {
  color: var(--orange);
  font-weight: 600;
  font-size: 0.8rem;
}

/* ── Pagination ── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  flex-wrap: wrap;
}
.pagination-bar.hidden {
  display: none;
}
.page-numbers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--outline-variant);
  border-radius: 0.4rem;
  background: var(--surface);
  color: var(--on-surface-variant);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.page-btn:hover:not(:disabled) {
  background: var(--surface-high);
  color: var(--on-surface);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.page-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.page-ellipsis {
  padding: 0 0.25rem;
  color: var(--outline);
  font-size: 0.8rem;
}
.pagination-info {
  font-size: 0.8rem;
  color: var(--outline);
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* ── Promo chip ── */
.chip.promo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 183, 131, 0.08);
  border: 1px solid rgba(255, 183, 131, 0.2);
  color: var(--tertiary);
}
.chip.promo-chip.active {
  background: rgba(255, 183, 131, 0.2);
  border-color: var(--tertiary);
  color: var(--tertiary);
}

/* ── Preview Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--outline-variant);
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.modal-header .material-symbols-outlined:first-child {
  color: var(--primary);
}

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

.modal-actions .btn-small {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  background: var(--surface-high);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: 2rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
}

.modal-actions .btn-small:hover {
  background: var(--surface-highest);
  border-color: var(--primary);
  color: var(--primary);
}

.modal-actions .btn-small .material-symbols-outlined {
  font-size: 1rem;
}

.modal-actions .btn-close {
  margin-left: 0.5rem;
  background: none;
  border: none;
  color: var(--outline);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
  transition: color 0.2s;
}

.modal-actions .btn-close:hover {
  color: var(--red);
}

.modal-body {
  flex: 1;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* ── Selection icons ── */

.sel-cell {
  width: 36px;
  text-align: center;
}

.sel-icon {
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
}

.sel-off {
  color: var(--outline-variant);
}

.sel-off:hover {
  color: var(--primary);
}

.sel-on {
  color: var(--primary);
  font-variation-settings: 'FILL' 1;
}

.sel-all-icon {
  font-size: 1.2rem;
  vertical-align: middle;
  color: var(--outline);
  cursor: pointer;
  transition: color 0.15s;
}

.sel-all-icon:hover {
  color: var(--primary);
}

.changes-table tbody tr {
  cursor: pointer;
}

.changes-table tbody tr.selected {
  background: rgba(192, 193, 255, 0.06);
}

.changes-table tbody tr.selected:hover {
  background: rgba(192, 193, 255, 0.1);
}

/* ── Selection Bar ── */

.selection-bar {
  position: sticky;
  top: 72px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  margin-bottom: 1rem;
  background: rgba(11, 14, 20, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(192, 193, 255, 0.3);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  flex-wrap: wrap;
  animation: fadeIn 0.2s ease;
  justify-content: space-between;
}

.selection-bar.hidden {
  display: none;
}

.selection-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.selection-actions .btn-small {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  background: var(--surface-high);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: 2rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.selection-actions .btn-small .material-symbols-outlined {
  font-size: 1rem;
}

.selection-actions .btn-email {
  background: rgba(192, 193, 255, 0.12);
  border-color: rgba(192, 193, 255, 0.3);
  color: var(--primary);
}

.selection-actions .btn-email:hover {
  background: rgba(192, 193, 255, 0.2);
  border-color: var(--primary);
}

.selection-actions .btn-clear {
  padding: 0.35rem;
  border: none;
  background: transparent;
  color: var(--outline);
}

.selection-actions .btn-clear:hover {
  color: var(--red);
  background: rgba(248, 113, 113, 0.1);
}

/* ── Modal small (email modal) ── */

.modal-sm {
  max-width: 480px;
  height: auto;
  min-height: 0;
  border-radius: var(--radius);
}

.modal-body-padded {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--outline-variant);
}

/* ── Email Modal ── */

.email-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.email-field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--on-surface-variant);
}

.email-field input {
  padding: 0.65rem 0.85rem;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.75rem;
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.email-field input:focus {
  border-color: var(--primary);
}

.email-error {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--red);
  font-weight: 500;
}

.email-success {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 500;
}

.email-error.hidden,
.email-success.hidden {
  display: none;
}

/* ── Hamburger button ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--on-surface);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  margin-right: 0.5rem;
}

/* ── Mobile Navigation Drawer ── */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--surface);
  border-right: 1px solid var(--outline-variant);
  z-index: 201;
  display: flex;
  flex-direction: column;
  animation: slideInLeft 0.25s ease;
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--outline-variant);
}

.mobile-nav-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--outline);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-nav-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--on-surface-variant);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-nav-item .material-symbols-outlined {
  font-size: 1.5rem;
}

.mobile-nav-item:hover {
  background: var(--surface-mid);
}

.mobile-nav-item.active {
  background: rgba(192, 193, 255, 0.12);
  color: var(--primary);
}

.mobile-nav-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--outline-variant);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-scrape-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-nav-footer .user-name {
  text-align: center;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .planograma-body {
    flex-direction: column;
  }
  .planograma-products-col,
  .planograma-selected-col {
    max-height: 50vh;
  }
  .planograma-actions {
    flex-wrap: wrap;
  }
  .planograma-actions .btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
  }
  .chart-container canvas {
    max-width: 100%;
    height: auto !important;
  }
  .hamburger {
    display: inline-flex;
    align-items: center;
  }

  .header-nav {
    display: none;
  }

  .header {
    padding: 0.5rem 0.75rem;
  }

  .header-inner {
    gap: 0.5rem;
  }

  .logo h1 {
    font-size: 1rem;
  }

  .logo-icon {
    font-size: 1.5rem;
  }

  .header-stat {
    display: none;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .last-scrape span:not(.material-symbols-outlined) {
    display: none;
  }

  .header-toolbar {
    gap: 0.25rem;
  }

  .toolbar-btn-wrap {
    gap: 0.15rem;
  }

  .btn-label {
    display: none;
  }

  .scrape-timer {
    display: none;
  }

  .btn-primary {
    padding: 0.5rem 0.65rem;
    min-width: unset;
  }

  .main-layout {
    padding: 0 0.75rem;
    margin: 0.75rem auto;
    gap: 0.75rem;
  }

  .sidebar {
    max-height: calc(100vh - 130px);
    border-radius: var(--radius);
  }

  .sidebar-search {
    padding: 0 0.75rem 0.5rem;
  }

  .search-icon {
    left: 1.25rem;
    top: 0.5rem;
    font-size: 0.95rem;
  }

  .sidebar-search input {
    padding: 0.4rem 0.6rem 0.4rem 2rem;
    font-size: 0.8rem;
  }

  .filter-chips {
    padding: 0 0.75rem 0.5rem;
  }

  .chip {
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
  }

  .product-list {
    padding: 0 0.25rem 0.25rem;
  }

  .product-item {
    padding: 0.5rem 0.5rem;
  }

  .product-item-name {
    font-size: 0.78rem;
  }

  .content {
    min-height: 200px;
    padding: 1rem;
  }

  .detail-header h2 {
    font-size: 1.15rem;
  }

  .price-comparison {
    gap: 0.75rem;
  }

  .store-card {
    padding: 0.85rem 1rem;
  }

  .price-value {
    font-size: 1.5rem;
  }

  .stats-row {
    gap: 0.5rem;
  }

  .mini-stat {
    padding: 0.5rem 0.75rem;
    min-width: calc(50% - 0.25rem);
    flex: none;
  }

  .mini-value {
    font-size: 0.95rem;
  }

  .chart-container {
    padding: 0.85rem;
  }

  .table-container {
    padding: 0.85rem;
  }

  .table-wrapper {
    margin: 0 -0.85rem;
    padding: 0 0.85rem;
  }

  .changes-view {
    padding: 0 0.75rem;
  }

  .changes-header h2,
  .content-header h2 {
    font-size: 1rem;
  }

  .selection-bar {
    top: 60px;
    padding: 0.5rem 0.85rem;
  }

  .modal-overlay {
    padding: 0.5rem;
  }

  .modal {
    height: 95vh;
    border-radius: var(--radius);
  }

  .flag-modal {
    width: 95%;
  }

  .scraping-status {
    margin: 0.5rem 0.75rem 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .pagination-bar {
    gap: 0.3rem;
    padding: 0.75rem 0.25rem;
  }
  .page-btn {
    min-width: 1.6rem;
    height: 1.6rem;
    font-size: 0.7rem;
    padding: 0 0.3rem;
  }
  .pagination-info {
    display: none;
  }

  .changes-store-chips {
    justify-content: flex-start;
    margin-bottom: 0.5rem;
  }

  .changes-store-chips .filter-chips {
    padding: 0;
  }

  .modal-header {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .modal-actions {
    gap: 0.35rem;
  }

  .modal-actions .btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }

  .flag-modal {
    margin: 0.5rem;
  }

  .flag-modal-body textarea {
    font-size: 16px;
  }}

/* Hide columns on small screens */
@media (max-width: 640px) {
  .changes-actions {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .changes-filter {
    flex: 1 1 auto;
    min-width: 0;
  }
  .changes-filter.model-filter {
    width: 100%;
  }
  .changes-filter.model-filter input[type="text"] {
    width: 100%;
  }
  .date-filter {
    width: 100%;
  }
  .date-filter input[type="date"] {
    width: 100%;
  }
  .changes-table th:nth-child(7),
  .changes-table td:nth-child(7),
  .changes-table th:nth-child(10),
  .changes-table td:nth-child(10) {
    display: none;
  }

  .store-product-info .store-ref,
  .store-product-info .store-ean {
    display: none;
  }

  .empty-state {
    min-height: 250px;
  }

  thead th,
  tbody td {
    padding: 0.4rem 0.5rem;
  }

  .changes-table th,
  .changes-table td {
    padding: 0.5rem 0.5rem;
  }

  .email-field input {
    font-size: 16px;
  }

  #historyTable {
    font-size: 0.75rem;
  }
  #historyTable th,
  #historyTable td {
    padding: 0.35rem 0.4rem;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .changes-table th:nth-child(4),
  .changes-table td:nth-child(4),
  .changes-table th:nth-child(6),
  .changes-table td:nth-child(6) {
    display: none;
  }
  .sidebar {
    max-height: calc(100vh - 120px);
  }

  .header-actions {
    gap: 0.35rem;
  }

  .user-name {
    display: none;
  }

  .price-comparison {
    gap: 0.5rem;
  }

  .store-card {
    padding: 0.65rem 0.75rem;
  }

  .price-value {
    font-size: 1.25rem;
  }

  .mini-stat {
    min-width: 100%;
  }

  .stats-row {
    flex-direction: column;
    gap: 0.35rem;
  }

  .changes-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .changes-actions .filter-chips {
    justify-content: flex-start;
  }

  .selection-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .selection-actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .flag-modal-body {
    padding: 1rem;
  }

  .flag-modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column;
  }

  .flag-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  #historyTable {
    font-size: 0.7rem;
  }
  #historyTable th,
  #historyTable td {
    padding: 0.25rem 0.3rem;
  }
}

/* ── Fichas iframe view ── */
.fichas-view {
  position: fixed;
  inset: 56px 0 0 0;
  z-index: 1;
}

.fichas-view .fichas-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0b0e14;
}

@media (max-width: 768px) {
  .fichas-view {
    inset: 56px 0 0 0;
  }
}
