@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Root variables ─────────────────────────────────────────────────────── */
:root {
  --ffr-bg:        #f8f9fa;
  --ffr-surface:   #ffffff;
  --ffr-surface2:  #f1f3f5;
  --ffr-border:    #dee2e6;
  --ffr-border2:   #ced4da;
  --ffr-accent:    #0d6efd;
  --ffr-accent-hover: #0b5ed7;
  --ffr-green:     #198754;
  --ffr-text:      #212529;
  --ffr-muted:     #6c757d;
  --ffr-danger:    #dc3545;
  --ffr-mono:      'IBM Plex Mono', monospace;
  --ffr-sans:      'Inter', sans-serif;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  background: var(--ffr-bg);
  color: var(--ffr-text);
  font-family: var(--ffr-sans);
  font-size: 14px;
}

.fs-7 {
    font-size: 0.9rem !important;
}

.fs-8 {
    font-size: 0.8rem !important;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--ffr-surface) !important;
  border-bottom: 1px solid var(--ffr-border);
  padding-top: 0;
  padding-bottom: 0;
  min-height: 54px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.navbar-brand {
  font-family: var(--ffr-mono);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ffr-accent) !important;
  letter-spacing: 0.03em;
}
.navbar .nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ffr-muted) !important;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
@media (min-width: 992px) {
  .navbar .nav-link {
    height: 54px;
    padding: 0 1rem;
  }
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--ffr-text) !important;
  border-bottom-color: var(--ffr-accent);
}
.navbar .nav-user {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ffr-muted) !important;
}
.nav-user-dropdown {
  min-width: 160px;
  border: 1px solid var(--ffr-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 0.25rem 0;
}
.nav-user-dropdown .dropdown-item {
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
}
.nav-user-dropdown .dropdown-item.text-danger:hover {
  background: #fff5f5;
  color: var(--ffr-danger) !important;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--ffr-surface);
  border: 1px solid var(--ffr-border);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-clip {
  overflow: hidden;
}
.card-body { padding: 1.5rem; }
.product-group-select .bootstrap-select { display: block !important; margin: 0; width: 100% !important; }
.product-group-select .bootstrap-select > .dropdown-toggle { width: 100%; }
.bundle-select-col .dropdown-menu { width: 100%; }
.bundle-select-col .dropdown-menu .inner { min-width: 0 !important; }
.bundle-select-col .dropdown-menu li a span.text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-toggle-btn { cursor: pointer; user-select: none; }
.filter-toggle-btn .bi { transition: transform 0.2s; }
.filter-toggle-btn.collapsed .bi { transform: rotate(180deg); }
.card-vs-header {
  display: flex;
  align-items: center;
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ffr-muted);
  background: var(--ffr-surface-2, #f5f5f5);
  border-bottom: 1px solid var(--ffr-border);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

/* ── Page header ─────────────────────────────────────────────────────────── */




/* ── Bulk-edit modal sidebar ─────────────────────────────────────────────── */
.bm-body {
  min-height: 340px;
  max-height: 75vh;
}
.bm-sidebar {
  width: 175px;
  min-width: 175px;
  padding: 1rem 0.75rem;
  background: var(--ffr-surface2);
  border-right: 1px solid var(--ffr-border);
  border-bottom-left-radius: var(--bs-modal-inner-border-radius);
}
.bm-sidebar .list-group-item {
  font-size: 0.82rem;
}
.bm-content {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}
#bulkEditModal.bm-quick-edit .bm-sidebar {
  display: none;
}
/* Quick edit / bulk edit element visibility */
.bm-quick-edit-only { display: none; }
#bulkEditModal.bm-quick-edit .bm-bulk-only { display: none !important; }
#bulkEditModal.bm-quick-edit .bm-quick-edit-only { display: block !important; }
/* VS flags always visible in quick edit (overrides d-none), JS toggles them in bulk mode */
#bulkEditModal.bm-quick-edit #bm-vs-flags { display: flex !important; }
/* In quick edit: value status, visibility, collecting on one row */
#bulkEditModal.bm-quick-edit .bm-vs-vis-wrap { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
#bulkEditModal.bm-quick-edit .bm-vs-vis-item { flex: 0 0 auto; }
/* Quick edit image thumbnails */
.bm-img-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.bm-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--ffr-border);
}
.bm-img-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  padding: 0;
  font-size: 0.5rem;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  opacity: 1;
}
.bm-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ffr-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.bm-price-input {
  max-width: 110px;
}


.bundle-item-header {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}


.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ffr-border);
}
.page-header h1, .bundle-item-header h1 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ffr-text);
  margin: 0;
}
.page-header h1 .count, .bundle-item-header h1 .count {
  font-weight: 400;
  color: var(--ffr-muted);
  font-size: 0.9rem;
  margin-left: 0.35rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.btn {
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--ffr-accent);
  border-color: var(--ffr-accent);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--ffr-accent-hover);
  border-color: var(--ffr-accent-hover);
}
.btn-secondary {
  background: var(--ffr-surface);
  border-color: var(--ffr-border2);
  color: var(--ffr-text);
}
.btn-secondary:hover {
  background: var(--ffr-surface2);
  border-color: var(--ffr-border2);
  color: var(--ffr-text);
}
.btn-danger {
  background: transparent;
  border-color: var(--ffr-danger);
  color: var(--ffr-danger);
}
.btn-danger:hover {
  background: var(--ffr-danger);
  color: #fff;
}
.btn-sm { padding: 0.25rem 0.35rem; font-size: 0.75rem; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-responsive {
  background: var(--ffr-surface);
}
.table {
  margin-bottom: 0;
  font-size: 0.84rem;
  color: var(--ffr-text);
}
.table thead th {
  background: var(--ffr-surface2);
  color: var(--ffr-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ffr-border);
  border-top: none;
  padding: 0.6rem 1rem;
  white-space: nowrap;
}
.table tbody td {
  border-color: var(--ffr-border);
  padding: 0.65rem 1rem;
  vertical-align: middle;
}
.table tbody tr { transition: background 0.1s; }
.table tbody tr:last-child td { border-bottom: none; }
.table > :not(caption) > * > * { padding: 0.2rem 0.5rem !important; }

.td-mono   { font-family: var(--ffr-mono); font-size: 0.75rem; color: var(--ffr-muted); }
.td-empty  { color: #ced4da; }
.td-actions   { white-space: nowrap; text-align: right; padding: 0.4rem 0.75rem; }
.td-input-num { min-width: 7rem; width: 7rem; }
.td-actions > * + * { margin-left: 2px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ffr-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.form-control,
.form-select {
  background: var(--ffr-surface);
  border: 1px solid var(--ffr-border2);
  border-radius: 4px;
  color: var(--ffr-text);
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"],
input[type="number"].form-control { font-family: var(--ffr-mono); }

.form-control:focus,
.form-select:focus {
  border-color: var(--ffr-accent);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.12);
  outline: none;
}
.form-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ffr-accent);
  border-top: 1px solid var(--ffr-border);
  padding-top: 1rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
.form-section-label .form-check-input[role="switch"] {
  cursor: pointer;
  margin-top: 0;
  vertical-align: middle;
}
.btn-icon {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}
.list-search {
  max-width: 300px;
}
.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
}
.errorlist li {
  font-size: 0.75rem;
  color: var(--ffr-danger);
}
.field-errors {
  min-height: 1.1rem;
  font-size: 0.75rem;
  color: var(--ffr-danger);
  margin-top: 0.2rem;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  font-size: 0.84rem;
  border-radius: 5px;
  padding: 0.65rem 1rem;
}
.alert-danger  { background: #f8d7da; color: #58151c; border-color: #f1aeb5; }
.alert-warning { background: #fff3cd; color: #664d03; border-color: #ffe69c; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-ffr {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: #e9ecef;
  border: 1px solid var(--ffr-border);
  color: var(--ffr-muted);
}

.badge-vs {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--ffr-border);
  color: var(--ffr-muted);
  line-height: 1.4;
  flex-shrink: 0;
}

/* ── Search bar ──────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
.search-bar .form-control { max-width: 260px; }
.search-bar .form-select  { max-width: 190px; }

/* ── Product detail ──────────────────────────────────────────────────────── */
.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.product-image-col {
  position: relative;
}
.detail-right-col {
  min-width: 0;
}
.product-image-placeholder {
  width: 400px;
  height: 400px;
  flex-shrink: 0;
  background: var(--ffr-surface2);
  border: 1px solid var(--ffr-border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #ced4da;
}
.detail-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ffr-muted);
  margin-bottom: 0.2rem;
}
.detail-value { font-size: 0.9rem; color: var(--ffr-text); }
.detail-value.notes-clamp { white-space: pre-wrap; max-height: 5.4em; overflow: hidden; border: 1px solid var(--ffr-border); border-radius: 0.375rem; padding: 0.4rem 0.6rem; }
.detail-value.notes-clamp.expanded { max-height: none; }
.notes-toggle { font-size: 0.7rem; padding: 0.05rem 0.4rem; line-height: 1.4; }
.detail-value.is-mono  { font-family: var(--ffr-mono); font-size: 0.82rem; }
.form-control.is-mono  { font-family: var(--ffr-mono); }
.detail-value.is-empty { color: #ced4da; }

.values-row {
  background: var(--ffr-surface2);
  border: 1px solid var(--ffr-border);
  border-radius: 5px;
  padding: 1rem;
  overflow: hidden;
}
.values-row-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ffr-muted);
  text-align: center;
  background: var(--ffr-border);
  padding: 0.2rem 0.5rem;
  margin: -1rem -1rem 0.75rem -1rem;
}
.value-cell { text-align: center; }
.value-cell .value-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ffr-muted);
  display: block;
  margin-bottom: 0.25rem;
}
.value-cell .value-amount {
  font-family: var(--ffr-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ffr-green);
}
.value-cell .value-amount.is-empty {
  font-size: 0.8rem;
  color: #ced4da;
}
.value-cell .value-amount.value-amount-override {
  color: #e07b00;
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* ── Confirm delete ──────────────────────────────────────────────────────── */
.confirm-card {
  border-color: #f1aeb5 !important;
  max-width: 480px;
  background: #fff9f9 !important;
}
.confirm-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ffr-danger);
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ffr-bg);
}
.login-card {
  max-width: 380px;
  width: 100%;
}
.login-card .login-brand {
  font-family: var(--ffr-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ffr-accent);
  margin-bottom: 0.25rem;
}
.login-card .login-sub {
  font-size: 0.82rem;
  color: var(--ffr-muted);
  margin-bottom: 1.75rem;
}

/* ── Thumb ───────────────────────────────────────────────────────────────── */
.thumb-wrap {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid var(--ffr-border);
  vertical-align: middle;
  background: var(--ffr-surface2);
  display: block;
}
.thumb-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--ffr-surface);
  border: 1px solid var(--ffr-border);
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  padding: 6px;
  pointer-events: none;
}
.thumb-popup img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  display: block;
  border-radius: 3px;
}
/* ── Custom icons (Bootstrap Icons compatible) ───────────────────────────── */
.bi-ebay::before {
    display: inline-block;
    width: 1em;
    height: 1em;
    content: "" !important;
    font-family: unset !important;
    background-image: url("../img/ebay-icon.svg");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    vertical-align: -0.125em;
}
/* Action buttons only: switch to mask so currentColor controls the tint.
   btn-outline-secondary is grey by default and turns white on hover — no
   extra rules needed, Bootstrap handles it automatically. */
.td-actions .bi-ebay::before,
.ebay-action-btn .bi-ebay::before {
    background-image: none;
    background-color: currentColor;
    -webkit-mask-image: url("../img/ebay-icon.svg");
    mask-image: url("../img/ebay-icon.svg");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}



/* ── Misc ────────────────────────────────────────────────────────────────── */
a { color: var(--ffr-accent); }
a:hover { color: var(--ffr-accent-hover); }
.text-muted { color: var(--ffr-muted) !important; }
hr { border-color: var(--ffr-border); }

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.78rem;
  margin-bottom: 1rem;
  padding: 0;
  background: none;
}
.breadcrumb-item a {
  color: var(--ffr-muted);
  text-decoration: none;
}
.breadcrumb-item a:hover { color: var(--ffr-accent); }
.breadcrumb-item.active { color: var(--ffr-text); }
.breadcrumb-item + .breadcrumb-item::before { color: #ced4da; }

/* ── Delete modal ────────────────────────────────────────────────────────── */
.modal-content {
  border: 1px solid var(--ffr-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.modal-header .modal-title { font-size: 0.95rem; font-weight: 600; }

/* ── Sortable table headers ──────────────────────────────────────────────── */
.sortable-th {
  white-space: nowrap;
  user-select: none;
}
.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ffr-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.sort-link:hover { color: var(--ffr-accent); }
.sort-active .sort-link { color: var(--ffr-text); }
.sort-icon { font-size: 0.6rem; opacity: 0.5; }
.sort-active .sort-icon { opacity: 1; color: var(--ffr-accent); }

/* ── Bulk action toolbar ─────────────────────────────────────────────────── */
.col-bulk-check { width: 36px; padding-right: 0 !important; vertical-align: middle; text-align: center; }

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

/* ── Product name truncation ─────────────────────────────────────────────── */
.col-thumb { width: 42px; padding-right: 0 !important; }
.col-name  { min-width: 180px; max-width: 280px; width: 280px; }
.td-thumb-cell { width: 42px; padding-right: 0 !important; vertical-align: middle; }
.td-name { max-width: 280px; white-space: nowrap; overflow: hidden; }
.td-name-inner { display: flex; align-items: baseline; gap: 0.35rem; min-width: 0; overflow: hidden; }

.product-name-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 220px;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ffr-text);
  text-decoration: none;
  font-weight: 500;
}
.product-name-link:hover { color: var(--ffr-accent); }

/* ── Tooltips — white background to match popovers ──────────────────────── */
.tooltip .tooltip-inner {
  background-color: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  border: 1px solid var(--bs-border-color, #dee2e6);
  box-shadow: var(--bs-box-shadow-sm, 0 .125rem .25rem rgba(0,0,0,.075));
}
.tooltip .tooltip-arrow::before {
  border-top-color: var(--bs-border-color, #dee2e6) !important;
  border-right-color: var(--bs-border-color, #dee2e6) !important;
  border-bottom-color: var(--bs-border-color, #dee2e6) !important;
  border-left-color: var(--bs-border-color, #dee2e6) !important;
}

/* ── Image popover ───────────────────────────────────────────────────────── */
.bundle-action-popover .popover-header {
  padding: 4px 8px;
  font-size: 0.75rem;
}
.bundle-action-popover .popover-body {
  padding: 4px 8px;
  font-size: 0.8rem;
}
.img-popover-popup.popover {
  max-width: 262px !important;
  width: 262px;
}
.img-popover-popup .popover-body {
  padding: 4px;
}
.img-preview-img {
  display: block;
  width: 250px;
  height: 250px;
  object-fit: contain;
}

/* ── No-image placeholder (table thumb) ──────────────────────────────────── */
.thumb-no-image {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px dashed var(--ffr-border2);
  background: var(--ffr-surface2);
  color: #ced4da;
  font-size: 0.8rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── No-image placeholder (detail page) ─────────────────────────────────── */
.product-image-placeholder {
  width: 400px;
  height: 400px;
  flex-shrink: 0;
  background: var(--ffr-surface2);
  border: 2px dashed var(--ffr-border2);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.no-image-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: #ced4da;
}
.no-image-inner i   { font-size: 2.5rem; }
.no-image-inner span { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }

/* ── Navbar Products dropdown ────────────────────────────────────────────── */
.nav-products-dropdown {
  min-width: 220px;
  font-size: 0.82rem;
  border: 1px solid var(--ffr-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 6px;
}
.nav-products-dropdown .dropdown-item {
  padding: 0.35rem 1rem;
  color: var(--ffr-text);
  font-size: 0.82rem;
}
.nav-products-dropdown .dropdown-item:hover,
.nav-products-dropdown .dropdown-item.active {
  background: var(--ffr-surface2);
  color: var(--ffr-accent);
}
.nav-products-dropdown .dropdown-divider { margin: 0.25rem 0; }

/* ── Navbar Products submenu (brand → groups, Bootstrap dropend) ─────────── */
/* Toggle button layout */
.nav-products-dropdown .dropend .dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Hide Bootstrap's built-in caret — we use bi-chevron-right */
.nav-products-dropdown .dropend .dropdown-toggle::after { display: none; }
.nav-products-dropdown .dropend .dropdown-toggle .bi-chevron-right {
  font-size: 0.65rem;
  opacity: 0.6;
}
/* Submenu panel — let Bootstrap/Popper handle positioning */
.nav-products-submenu {
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 0.82rem;
  border: 1px solid var(--ffr-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 6px;
}


.dropdown-item.disabled, .dropdown-item:disabled {
    color: var(--bs-dropdown-link-disabled-color) !important;
    cursor: not-allowed !important;
}

.nav-products-submenu .dropdown-item {
  padding: 0.35rem 1rem;
  color: var(--ffr-text);
  font-size: 0.82rem;
}
.nav-products-submenu .dropdown-item:hover {
  background: var(--ffr-surface2);
  color: var(--ffr-accent);
}
.nav-products-submenu .dropdown-divider { margin: 0.25rem 0; }

/* Keep dropdown nav-link height consistent */
.navbar .nav-link.dropdown-toggle {
  border-bottom: 2px solid transparent;
}
.navbar .nav-item.dropdown:hover > .nav-link,
.navbar .nav-item.dropdown .nav-link.active {
  color: var(--ffr-text) !important;
  border-bottom-color: var(--ffr-accent);
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.8rem;
}
.pagination-info {
  color: var(--ffr-muted);
}
.pagination .page-link {
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  color: var(--ffr-text);
  border-color: var(--ffr-border);
  background: var(--ffr-surface);
}
.pagination .page-link:hover {
  background: var(--ffr-surface2);
  color: var(--ffr-accent);
  border-color: var(--ffr-border);
}
.pagination .page-item.active .page-link {
  background: var(--ffr-accent);
  border-color: var(--ffr-accent);
  color: #fff;
}
.pagination .page-item.disabled .page-link {
  color: #ced4da;
  background: var(--ffr-surface);
}

/* ── Page actions dropdown ───────────────────────────────────────────────── */
.page-actions-dropdown {
  min-width: 180px;
  font-size: 0.82rem;
  border: 1px solid var(--ffr-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 6px;
}
.page-actions-dropdown .dropdown-item {
  padding: 0.35rem 1rem;
  color: var(--ffr-text);
  font-size: 0.82rem;
}
.page-actions-dropdown .dropdown-item:hover {
  background: var(--ffr-surface2);
  color: var(--ffr-accent);
}
.page-actions-dropdown .dropdown-item.text-danger:hover {
  background: var(--ffr-surface2);
  color: #e74c3c;
}
.page-actions-dropdown .dropdown-divider { margin: 0.25rem 0; }

/* ── Catalog dropdown ────────────────────────────────────────────────────── */
.nav-catalog-dropdown {
  min-width: 180px;
  font-size: 0.82rem;
  border: 1px solid var(--ffr-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 6px;
}
.nav-catalog-dropdown .dropdown-item {
  padding: 0.4rem 1rem;
  color: var(--ffr-text);
  font-size: 0.82rem;
}
.nav-catalog-dropdown .dropdown-item:hover,
.nav-catalog-dropdown .dropdown-item.active {
  background: var(--ffr-surface2);
  color: var(--ffr-accent);
}

/* ── Table name cells ────────────────────────────────────────────────────── */
.td-name-primary { font-weight: 500; }
.col-icon-sm     { width: 40px; }
.td-icon         { width: 2rem; }
.td-truncate     { font-size: .85rem; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-small        { font-size: .8rem; }
.result-count    { font-size: .9rem; }
.badge-title              { font-size: .6em; vertical-align: middle; border: 1px solid black; }
.badge-title.badge-ffr    { border: none; }
.upc-input-wrap  { max-width: 360px; }
.btn-static      { cursor: default; }
.page-actions-dropdown-wide { min-width: 240px; }
.btn-check-readonly + label { pointer-events: none; text-transform: none; letter-spacing: normal; }
.btn-check-readonly:not(:checked) + label {
  opacity: 0.35;
  filter: grayscale(1);
}
.values-row-compact {
  width: 100%;
  min-width: 90px;
}
.product-form-img-wrap {
  width: 38px;
  height: 38px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--ffr-border);
  border-radius: 4px;
  background: var(--ffr-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.product-form-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.product-form-img-wrap .no-img-icon {
  font-size: 1rem;
  color: var(--ffr-border2);
}

/* ── Inline icons ────────────────────────────────────────────────────────── */
.icon-list    { font-size: 1.1rem; color: var(--ffr-muted); }
.icon-preview { font-size: 1.4rem; color: var(--ffr-muted); }

/* ── Form hint spans ─────────────────────────────────────────────────────── */
.form-hint {
  font-family: var(--ffr-sans);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--ffr-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Empty state (product list) ──────────────────────────────────────────── */
.empty-state-cell { color: var(--ffr-muted); }
.empty-state-icon { font-size: 1.5rem; }

/* ── Confirm delete ──────────────────────────────────────────────────────── */
.confirm-text { color: var(--ffr-muted); font-size: 0.9rem; }
.confirm-name { color: var(--ffr-text); }

/* ── Login alert ─────────────────────────────────────────────────────────── */
.login-alert { font-size: 0.82rem; }

/* ── Default image preview (product form) ────────────────────────────────── */
.default-image-preview {
  width: 100%;
  max-width: 240px;
  height: 220px;
  object-fit: contain;
  border: 1px solid var(--ffr-border);
  border-radius: 5px;
  background: var(--ffr-surface2);
  display: block;
}
.default-image-empty {
  width: 100%;
  max-width: 240px;
  height: 220px;
  border: 1px dashed var(--ffr-border2);
  border-radius: 5px;
  background: var(--ffr-surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #ced4da;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.default-image-empty i { font-size: 2rem; }

/* ── Upload preview wrap ─────────────────────────────────────────────────── */
.upload-preview-wrap          { display: none; margin-top: 0.6rem; }
.upload-preview-wrap.is-visible { display: inline-block; }

/* ── Detail value modifiers ──────────────────────────────────────────────── */
.detail-value.is-muted { color: var(--ffr-muted); }

/* ── Delete form ─────────────────────────────────────────────────────────── */
#deleteForm { display: inline; }

/* ── Navbar search ───────────────────────────────────────────────────────── */
.nav-search-form {
  width: 340px;
  flex-shrink: 1;
}
.nav-search-form .input-group {
  width: 100%;
}
.nav-search-input {
  font-size: 0.85rem;
}

/* ── Facet bar (horizontal) ──────────────────────────────────────────────── */
.facet-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.facet-bar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.facet-bar-divider {
  width: 1px;
  height: 1.4rem;
  background: var(--ffr-border2);
  margin: 0 0.2rem;
  flex-shrink: 0;
}
.facet-btn {
  background: var(--ffr-surface);
  border: 1px solid var(--ffr-border2);
  color: var(--ffr-text);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.28rem 0.65rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
}
.facet-btn:hover, .facet-btn:focus {
  background: var(--ffr-surface2);
  color: var(--ffr-text);
  border-color: var(--ffr-border2);
  box-shadow: none;
  outline: none;
}
.facet-btn.has-selection {
  background: rgba(13, 110, 253, 0.07);
  border-color: rgba(13, 110, 253, 0.35);
  color: var(--ffr-accent);
}
.facet-btn-badge {
  background: var(--ffr-accent);
  color: #fff;
  border-radius: 10px;
  padding: 0 0.38rem;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.6;
  min-width: 18px;
  text-align: center;
}
.facet-menu {
  padding: 0.35rem 0;
  min-width: 210px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--ffr-border);
  border-radius: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.facet-check-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.85rem;
  cursor: pointer;
  font-size: 0.81rem;
  color: var(--ffr-text);
  font-weight: 400;
  white-space: nowrap;
  margin: 0;
  transition: background 0.1s;
}
.facet-check-item:hover {
  background: var(--ffr-surface2);
  color: var(--ffr-text);
}
.facet-check-item input[type=checkbox] {
  flex-shrink: 0;
  accent-color: var(--ffr-accent);
  cursor: pointer;
}
.facet-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.facet-count {
  font-size: 0.67rem;
  color: var(--ffr-muted);
  background: var(--ffr-surface2);
  border: 1px solid var(--ffr-border);
  border-radius: 10px;
  padding: 0 0.38rem;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.65;
}
.facet-check-item input:checked ~ .facet-count {
  background: rgba(13, 110, 253, 0.1);
  border-color: rgba(13, 110, 253, 0.3);
  color: var(--ffr-accent);
}
a.facet-check-item {
  text-decoration: none;
  color: var(--ffr-text);
}
a.facet-check-item.active {
  background: rgba(13, 110, 253, 0.07);
  color: var(--ffr-accent);
  font-weight: 500;
}
.facet-date-group {
  background: var(--ffr-surface);
  border: 1px solid var(--ffr-border2);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ffr-text);
}
.facet-date-group.has-selection {
  background: rgba(13, 110, 253, 0.07);
  border-color: rgba(13, 110, 253, 0.35);
  color: var(--ffr-accent);
}
.facet-date-input {
  border: none;
  background: transparent;
  font-size: 0.78rem;
  color: var(--ffr-text);
  padding: 0;
  outline: none;
  width: 118px;
  font-family: var(--ffr-sans);
}
.facet-date-sep {
  color: var(--ffr-muted);
  font-size: 0.78rem;
}

/* ── Value trend indicator ───────────────────────────────────────────────── */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.35rem;
  font-size: 0.75rem;
  line-height: 1.5;
  border-radius: 0.2rem;
  cursor: default;
  pointer-events: auto;
  vertical-align: middle;
}
.trend-up       { color: #198754; background: rgba(25,135,84,0.1);  border: 1px solid rgba(25,135,84,0.25); }
.trend-down     { color: #dc3545; background: rgba(220,53,69,0.1);  border: 1px solid rgba(220,53,69,0.25); }
.trend-neutral  { color: #495057; background: rgba(73,80,87,0.08);  border: 1px solid rgba(73,80,87,0.2); }
.trend-disabled { color: #868e96; background: transparent;           border: 1px solid #adb5bd; cursor: default; }
.trend-indicator-lg { width: 2.2rem; height: 2.2rem; padding: 0; font-size: 1rem; }
.ebay-diff-low  { color: #dc3545 !important; }
.ebay-diff-ok   { color: #198754 !important; }
.btn.btn-tint-danger  { --bs-btn-color: #dc3545; color: #dc3545 !important; background: rgba(220,53,69,0.08);  border-color: rgba(220,53,69,0.3); }
.btn.btn-tint-danger:hover  { --bs-btn-color: #dc3545; color: #dc3545 !important; background: rgba(220,53,69,0.15); border-color: rgba(220,53,69,0.5); }
.btn.btn-tint-success { --bs-btn-color: #198754; color: #198754 !important; background: rgba(25,135,84,0.08);  border-color: rgba(25,135,84,0.3); }
.btn.btn-tint-success:hover { --bs-btn-color: #198754; color: #198754 !important; background: rgba(25,135,84,0.15); border-color: rgba(25,135,84,0.5); }
.ebay-action-btn { width: 2.5rem; height: 2.5rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; cursor: default !important; }
.trend-pop-row { display: flex; justify-content: space-between; gap: 1rem; }
.trend-pop-label { font-size: 0.78rem; color: var(--ffr-muted); }
.trend-pop-threshold { opacity: 0.55; font-size: 0.72rem; margin-top: 0.1rem; }
.trend-pop hr { border-color: rgba(0,0,0,0.15); }


/* ── Product search typeahead ────────────────────────────────────────────── */
.ac-wrap {
  position: absolute;
  z-index: 9999;
  background: var(--ffr-surface);
  border: 1px solid var(--ffr-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.ac-group-hdr {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ffr-muted);
  padding: 0.5rem 0.75rem 0.2rem;
  background: var(--ffr-surface2);
  border-bottom: 1px solid var(--ffr-border);
  position: sticky;
  top: 0;
}
.ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
  color: var(--ffr-text);
  cursor: pointer;
  border-bottom: 1px solid var(--ffr-border);
  transition: background 0.1s;
}
.ac-item:last-child { border-bottom: none; }
.ac-empty-action {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  color: var(--ffr-muted);
  cursor: pointer;
}
.ac-empty-action:hover {
  background: var(--ffr-surface2);
  color: var(--ffr-text);
}
.ac-item.ac-active { background: var(--ffr-surface2); }
.ac-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--ffr-surface2);
}
.ac-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ffr-muted);
  font-size: 0.9rem;
}
.ac-content { flex: 1; min-width: 0; }
.ac-line1 { display: flex; align-items: center; gap: 0.3rem; overflow: hidden; }
.ac-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-cond { font-size: 0.7rem; color: var(--ffr-muted); white-space: nowrap; flex-shrink: 0; }
.ac-line2 { display: flex; gap: 0.5rem; font-size: 0.72rem; color: var(--ffr-muted); margin-top: 1px; }
.ac-hl { background: none; font-weight: 700; color: var(--ffr-accent); padding: 0; }
.ac-item[data-status-color="success"]  { background: #d1e7dd; border-bottom-color: #a7b9b1; }
.ac-item[data-status-color="warning"]  { background: #fff3cd; border-bottom-color: #ccc2a4; }
.ac-item[data-status-color="danger"]   { background: #f8d7da; border-bottom-color: #c6acae; }
.ac-item[data-status-color="info"]     { background: #cff4fc; border-bottom-color: #a6c3ca; }
.ac-item[data-status-color="secondary"]{ background: #e2e3e5; border-bottom-color: #b5b6b7; }
.ac-item[data-status-color="primary"]  { background: #cfe2ff; border-bottom-color: #a6b5cc; }
.ac-item[data-status-color="success"].ac-active   { background: #c1d6cc; }
.ac-item[data-status-color="warning"].ac-active   { background: #ece1be; }
.ac-item[data-status-color="danger"].ac-active    { background: #e5c7ca; }
.ac-item[data-status-color="info"].ac-active      { background: #bfe2e9; }
.ac-item[data-status-color="secondary"].ac-active { background: #d1d2d4; }
.ac-item[data-status-color="primary"].ac-active   { background: #bfd1ec; }
.ac-pid {
  font-family: var(--ffr-mono);
  font-size: 0.68rem;
  color: var(--ffr-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
/* ── Product detail mobile ───────────────────────────────────────────────── */
@media (max-width: 767px) {
  .detail-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .product-image-col {
    display: flex;
    justify-content: center;
  }
  .product-image-col .gallery,
  .product-image-col .product-image-placeholder {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    max-width: 340px;
  }
}

/* ── Clickable table rows ────────────────────────────────────────────────── */
tr[data-href] { cursor: pointer; }

/* ── Disabled button wrapper (prevents row cursor bleed-through) ─────────── */
/* The span intercepts mouse events that pointer-events:none passes through,  */
/* so the table row's cursor:pointer doesn't bleed onto a disabled button.    */
.btn-disabled-wrap {
  display: inline-block;
  cursor: default;
}

/* ── Mobile nav ──────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .navbar-collapse {
    background: var(--ffr-surface);
    border-top: 1px solid var(--ffr-border);
    padding: 0.5rem 0 1rem;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .navbar .nav-link {
    height: auto !important;
    border-bottom: none !important;
    padding: 0.45rem 0.75rem;
    border-radius: 4px;
  }
  .navbar .nav-link:hover,
  .navbar .nav-link.active {
    background: var(--ffr-surface2);
    border-bottom: none !important;
  }
  .navbar .dropdown-menu {
    box-shadow: none;
    border: none;
    background: var(--ffr-surface2);
    border-radius: 4px;
    margin-left: 1rem;
    margin-top: 0.25rem;
  }
  .navbar-nav.ms-auto {
    flex-direction: row;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--ffr-border);
    margin-top: 0.25rem;
  }
}

/* ── Item Stats Card ─────────────────────────────────────────────────────── */
.item-stats-card { overflow: hidden; } /* keep for financials row border-radius */
.item-stats-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  border-top: 1px solid var(--ffr-border);
}
.item-stats-row .stat-cell {
  flex: 1 0 auto;
  border-bottom: none;
  border-right: 1px solid var(--ffr-border);
}
.item-stats-row .stat-cell:last-child {
  border-right: none;
}
.card > .item-stats-row:first-child {
  border-top: none;
}
.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 1rem;
  border-right: 1px solid var(--ffr-border);
  border-bottom: 1px solid var(--ffr-border);
  align-items: flex-end;
  text-align: right;
}
.stat-label {
  font-size: 0.67rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ffr-muted);
  white-space: nowrap;
}
.stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ffr-text);
  font-family: var(--ffr-mono);
}
.val-num { white-space: nowrap; }
.stat-value-input {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ffr-text);
  font-family: var(--ffr-mono);
  text-align: right;
  width: 100%;
  background: transparent;
  border: 1px solid var(--ffr-border);
  border-radius: 4px;
  outline: none;
  padding: 0.1rem 0.25rem;
  -moz-appearance: textfield;
}
.stat-value-input:focus {
  border-color: var(--bs-primary);
}
.stat-value-input::-webkit-outer-spin-button,
.stat-value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.stat-value-input::placeholder {
  color: var(--ffr-muted);
  font-weight: 400;
}
.stat-cell-trend { align-items: center; justify-content: center; }

/* ── Value Status Breakdown Card ─────────────────────────────────────────── */
.vs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.vs-th-label {
  width: 72px;
  padding: 0.3rem 0.75rem;
}
.vs-th-col {
  text-align: right;
  padding: 0.3rem 0.75rem;
  font-weight: 600;
  color: var(--ffr-muted);
  white-space: nowrap;
  min-width: 72px;
  border-bottom: 1px solid var(--ffr-border);
}
.vs-td-label {
  padding: 0.3rem 0.75rem;
  color: var(--ffr-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.vs-td-val {
  text-align: right;
  padding: 0.3rem 0.75rem;
}
.vs-tr-all td {
  background: var(--ffr-surface2);
  font-weight: 600;
  color: var(--ffr-text);
  border-bottom: 1px solid var(--ffr-border);
}
.vs-tr-all .vs-td-label {
  color: var(--ffr-text);
}
.vs-money {
  font-family: var(--ffr-mono);
  font-size: 0.78rem;
}
.vs-count {
  font-weight: 500;
}
.vs-empty {
  color: var(--ffr-border2);
}
.stat-cell-trend .trend-indicator {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  font-size: 1rem;
}

/* ── Selling summary row — wrap to 2 lines instead of scrolling ──────────── */
.buying-summary-wrap {
  flex-wrap: wrap;
  overflow-x: visible;
}
.buying-summary-wrap .stat-cell {
  flex: 1 1 auto;
  border-bottom: none;
}
.buying-row-divider {
  border-top: 1px solid var(--ffr-border);
}

.selling-summary-wrap {
  flex-wrap: wrap;
  overflow-x: visible;
}
.selling-summary-wrap .stat-cell {
  flex: 1 1 auto;
  border-bottom: 1px solid var(--ffr-border);
}
.selling-summary-wrap .stat-cell:last-child {
  border-bottom: none;
}

/* ── Sales Dashboard ─────────────────────────────────────────────────────── */
.dashboard-chart-wrap {
  position: relative;
  height: 280px;
}

.dashboard-chart-wrap--tall {
  height: 500px;
}

/* ── Thermometer ─────────────────────────────────────────────────────────── */
.thermometer {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.thermometer-tube {
  width: 22px;
  height: 160px;
  background: var(--ffr-border);
  border-radius: 11px 11px 0 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.thermometer-fill {
  width: 100%;
  height: 0;
  border-radius: 11px 11px 0 0;
  transition: height 1s cubic-bezier(.4,0,.2,1);
}
.thermometer-fill.below,
.thermometer-bulb.below  { background: var(--ffr-danger); }
.thermometer-fill.near,
.thermometer-bulb.near   { background: #ffc107; }
.thermometer-fill.reached,
.thermometer-bulb.reached { background: var(--ffr-green); }
.thermometer-bulb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-top: -2px;
  border: 3px solid var(--ffr-surface);
  box-shadow: 0 0 0 2px var(--ffr-border);
}
.thermometer-amount {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--ffr-mono);
  line-height: 1;
}
.thermometer-amount.below   { color: var(--ffr-danger); }
.thermometer-amount.near    { color: #b58a00; }
.thermometer-amount.reached { color: var(--ffr-green); }
.thermometer-pct {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ffr-muted);
}

/* ── Scan error feedback ──────────────────────────────────────────────────── */
@keyframes scan-error-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.scan-error {
  animation: scan-error-shake 0.4s ease;
  border-color: var(--ffr-danger) !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* ── Bundle table column widths ──────────────────────────────────────────── */
.col-w-6 { width: 6rem; }
.col-w-7 { width: 7rem; }
.th-pid  { font-size: 0.8em; }
.bundle-condition { min-width: 8rem; }

/* ── Bundle header toggle buttons ────────────────────────────────────────── */
.bundle-toggle-header { padding-top: 0.01rem; padding-bottom: 0.01rem; }

/* ── Receipt preview ─────────────────────────────────────────────────────── */
.receipt-preview {
  border: 1px solid var(--ffr-border);
  border-radius: 5px;
  background: var(--ffr-surface2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
.receipt-preview img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}
.receipt-preview iframe {
  width: 100%;
  height: 360px;
  border: none;
  display: block;
}
.receipt-preview-placeholder {
  text-align: center;
  color: var(--ffr-muted);
  padding: 2rem;
}
.receipt-preview-placeholder i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}


/* Bundle form collapse toggle */
#bundle-form-header {
  cursor: pointer;
  user-select: none;
}
#bundle-form-header .bundle-collapse-icon {
  transition: transform 0.2s ease;
}
#bundle-form-header[aria-expanded="true"] .bundle-collapse-icon {
  transform: rotate(180deg);
}
