/* ═══════════════════════════════════════════════════════
   DJI Enterprise Product Selection Tool
   Strict Black & White Enterprise UI
   ═══════════════════════════════════════════════════════ */

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

:root {
  --black:      #0a0a0a;
  --ink:        #1a1a1a;
  --dark:       #333333;
  --mid:        #666666;
  --muted:      #999999;
  --light:      #bbbbbb;
  --border:     #e0e0e0;
  --border-lt:  #eeeeee;
  --bg:         #f5f5f5;
  --bg-off:     #fafafa;
  --white:      #ffffff;
  --sh-xs:      0 1px 3px rgba(0,0,0,.06);
  --sh-sm:      0 2px 8px rgba(0,0,0,.08);
  --sh-md:      0 4px 20px rgba(0,0,0,.10);
  --r:          6px;
  --r-md:       10px;
  --font:       'Inter', system-ui, sans-serif;
  --header-h:   56px;
  --topbar-h:   60px;
  /* category column width */
  --col-w:      210px;
}

html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ─── UTILITIES ─────────────────────────────────────── */
.hidden { display: none !important; }
.page   { display: none; }
.page.active { display: block; }

/* ═══════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════ */
#main-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 2px solid var(--black);
  position: sticky; top: 0; z-index: 300;
  box-shadow: var(--sh-xs);
}
.header-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 14px;
}
.header-logo img { height: 32px; width: auto; display: block; flex-shrink: 0; }
.header-title {
  flex: 1; font-size: 0.78rem; font-weight: 600;
  color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav-btn {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--dark); padding: 6px 16px; border-radius: 20px;
  font-family: var(--font); font-size: 0.77rem; font-weight: 600;
  cursor: pointer; transition: all .14s;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.nav-btn:hover { border-color: var(--dark); }
.nav-btn.active { background: var(--black); color: var(--white); border-color: var(--black); }
/* Admin gate button — pinned to extreme right */
.nav-btn-admin-gate {
  background: var(--black); color: var(--white);
  border-color: var(--black);
  margin-left: auto;
}
.nav-btn-admin-gate:hover { background: #333; border-color: #333; color: var(--white); }
.nav-btn-admin-gate i { color: rgba(255,255,255,.75); }

/* ── Admin Gate Modal ── */
.admin-gate-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9100;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.admin-gate-overlay.active { display: flex; }

.admin-gate-modal {
  background: var(--white);
  border-radius: var(--r-md);
  width: 100%; max-width: 380px;
  box-shadow: 0 16px 56px rgba(0,0,0,.22);
  display: flex; flex-direction: column;
  animation: fbSlideIn .20s ease;
  overflow: hidden;
}

.admin-gate-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px 13px;
  background: var(--black);
}
.admin-gate-title-row {
  display: flex; align-items: center; gap: 10px;
}
.admin-gate-icon {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.12); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: .92rem;
}
.admin-gate-header h3 {
  font-size: .95rem; font-weight: 800; color: var(--white); letter-spacing: .01em;
}
.admin-gate-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.55); font-size: .95rem;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: all .12s;
}
.admin-gate-close:hover { color: var(--white); background: rgba(255,255,255,.12); }

.admin-gate-body {
  padding: 20px 22px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.admin-gate-sub {
  font-size: .80rem; color: var(--muted); margin-bottom: 2px;
}
.admin-gate-err {
  font-size: .75rem; font-weight: 600; color: #b91c1c;
  display: flex; align-items: center; gap: 6px;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 5px; padding: 7px 10px;
}
.admin-gate-field { display: flex; flex-direction: column; }

.admin-gate-input-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--r);
  background: var(--white); overflow: hidden;
  transition: border-color .13s;
}
.admin-gate-input-wrap:focus-within { border-color: var(--dark); }
.admin-gate-lock-ico {
  padding: 0 10px; color: var(--muted); font-size: .80rem; flex-shrink: 0;
}
.admin-gate-pw {
  flex: 1; border: none; outline: none; padding: 10px 6px;
  font-family: var(--font); font-size: .84rem; color: var(--ink);
  background: transparent;
}
.admin-gate-eye {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 0 12px; font-size: .82rem;
  transition: color .12s;
}
.admin-gate-eye:hover { color: var(--dark); }

.admin-gate-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border-lt);
}
.admin-gate-cancel {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--dark); padding: 8px 16px; border-radius: var(--r);
  font-family: var(--font); font-size: .79rem; font-weight: 600;
  cursor: pointer; transition: all .13s;
}
.admin-gate-cancel:hover { background: var(--bg); border-color: var(--dark); }
.admin-gate-submit {
  background: var(--black); border: 1.5px solid var(--black);
  color: var(--white); padding: 8px 18px; border-radius: var(--r);
  font-family: var(--font); font-size: .79rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: all .13s;
}
.admin-gate-submit:hover { background: #333; border-color: #333; }

/* ═══════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════ */
#loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.97);
  z-index: 999; display: flex; align-items: center; justify-content: center;
}
.loading-box { text-align: center; }
.loading-spinner {
  width: 38px; height: 38px;
  border: 3px solid #ddd; border-top-color: var(--black);
  border-radius: 50%; animation: spin .7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box p { font-weight: 600; color: var(--dark); font-size: .88rem; }

/* ═══════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════ */
#hero-section {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 0;
}
.hero-inner { max-width: 900px; margin: 0 auto; }

.hero-top { text-align: center; margin-bottom: 32px; }

.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--black); color: var(--white);
  font-size: .64rem; font-weight: 700; letter-spacing: .12em;
  padding: 5px 14px; border-radius: 20px;
  margin-bottom: 18px; text-transform: uppercase;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #aaa; animation: blink 1.8s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.hero-top h1 {
  font-size: 2.8rem; font-weight: 900;
  color: var(--black); line-height: 1.05; letter-spacing: -.02em;
}
.hero-top h2 {
  font-size: 2rem; font-weight: 300;
  color: var(--mid); letter-spacing: -.01em;
  margin-bottom: 14px; line-height: 1.1;
}
.hero-desc {
  font-size: .86rem; color: var(--muted);
  max-width: 560px; margin: 0 auto; line-height: 1.65;
}

/* ─── Search row ─────────────────────────────────────── */
.search-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 28px;
}
.search-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 20px 16px;
  box-shadow: var(--sh-xs);
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.search-card:hover { border-color: #c0c0c0; box-shadow: var(--sh-sm); }

.search-card-icon-row {
  display: flex; align-items: flex-start;
  gap: 10px; margin-bottom: 14px;
}
.search-card-icon {
  width: 30px; height: 30px;
  background: var(--black); color: var(--white);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; flex-shrink: 0; margin-top: 2px;
}
.search-card-icon.secondary-icon { background: var(--dark); }
.search-card-icon-row strong { display: block; font-size: .90rem; font-weight: 800; color: var(--black); }
.search-card-icon-row span   { font-size: .72rem; color: var(--muted); }

/* Input wrapper */
.input-wrap {
  position: relative; margin-bottom: 10px;
}
.input-wrap input {
  width: 100%; padding: 10px 38px 10px 36px;
  border: 1.5px solid var(--border); border-radius: var(--r);
  font-family: var(--font); font-size: .85rem;
  color: var(--ink); background: var(--bg-off);
  outline: none; transition: border-color .15s;
}
.input-wrap input:focus { border-color: var(--black); background: var(--white); }
.input-wrap input::placeholder { color: var(--light); }
.input-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .80rem; pointer-events: none;
}
.input-clear-btn {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px; font-size: .78rem;
  transition: color .12s;
}
.input-clear-btn:hover { color: var(--black); }

.input-wrap.centered-input { max-width: 560px; margin: 0 auto 6px; }

/* Buttons */
.primary-btn {
  width: 100%; background: var(--black); color: var(--white);
  border: none; padding: 11px 16px; border-radius: var(--r);
  font-family: var(--font); font-size: .82rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: background .14s; letter-spacing: .01em;
}
.primary-btn:hover { background: var(--ink); }
.secondary-btn {
  width: 100%; background: var(--dark); color: var(--white);
  border: none; padding: 11px 16px; border-radius: var(--r);
  font-family: var(--font); font-size: .82rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: background .14s;
}
.secondary-btn:hover { background: var(--black); }

/* Suggestions dropdown */
.suggestions-box {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white);
  border: 1.5px solid var(--black); border-top: none;
  border-radius: 0 0 var(--r) var(--r);
  z-index: 80; max-height: 280px; overflow-y: auto;
  display: none; box-shadow: var(--sh-md);
}
.suggestions-box.open { display: block; }
.suggestions-box.centered-suggestions {
  position: relative; max-width: 560px;
  margin: 0 auto; margin-top: -6px;
}
.sug-item {
  padding: 9px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border-lt);
  transition: background .1s;
  display: flex; flex-direction: column; gap: 2px;
}
.sug-item:last-child { border-bottom: none; }
.sug-item:hover { background: var(--bg); }
.sug-name { font-size: .84rem; font-weight: 600; color: var(--ink); }
.sug-meta { font-size: .71rem; color: var(--muted); font-family: 'Courier New', monospace; }
.sug-empty { padding: 12px 14px; color: var(--muted); font-size: .82rem; text-align: center; }

/* Stats strip */
.stats-strip {
  display: flex; justify-content: center;
  gap: 12px; margin-bottom: 32px;
}
.stat-tile {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 28px;
  text-align: center; box-shadow: var(--sh-xs);
  min-width: 110px;
}
.stat-tile strong { display: block; font-size: 1.65rem; font-weight: 900; color: var(--black); line-height: 1.1; }
.stat-tile span   { font-size: .68rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }

/* Quick Access */
.quick-access { max-width: 900px; padding-bottom: 40px; }
.section-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-label { font-size: .86rem; font-weight: 800; color: var(--black); display: flex; align-items: center; gap: 6px; }
.section-label i { color: var(--mid); }
.section-badge { background: var(--bg); border: 1px solid var(--border); font-size: .70rem; font-weight: 600; color: var(--mid); padding: 2px 10px; border-radius: 12px; }
.qa-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.qa-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 14px;
  cursor: pointer; box-shadow: var(--sh-xs);
  transition: border-color .14s, box-shadow .14s, transform .12s;
}
.qa-card:hover { border-color: var(--black); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.qa-card-name {
  font-size: .79rem; font-weight: 700; color: var(--ink);
  line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.qa-card-ean  { font-size: .66rem; color: var(--muted); font-family: 'Courier New', monospace; margin-bottom: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-card-type { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--bg); color: var(--mid); border: 1px solid var(--border); padding: 2px 7px; border-radius: 3px; }

/* ═══════════════════════════════════════════════════════
   PRODUCT DETAIL — TOP BAR
   ═══════════════════════════════════════════════════════ */
#product-detail { background: var(--bg); min-height: calc(100vh - var(--header-h)); }

.detail-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: var(--header-h); z-index: 200;
  box-shadow: var(--sh-xs);
}
.back-btn {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--dark); padding: 7px 14px; border-radius: var(--r);
  font-family: var(--font); font-size: .77rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: all .13s; flex-shrink: 0;
}
.back-btn:hover { background: var(--black); color: var(--white); border-color: var(--black); }

.detail-topbar-info { flex: 1; min-width: 0; }
.detail-topbar-info h2 {
  font-size: 1.05rem; font-weight: 900; color: var(--black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.ean-tag {
  display: inline-block; background: var(--black); color: var(--white);
  font-size: .65rem; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  font-family: 'Courier New', monospace; letter-spacing: .04em; margin-top: 2px;
}
/* topbar meta row: EAN + status side by side */
.detail-topbar-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px;
}
/* Product status tag — topbar */
.prod-status-tag {
  display: inline-block;
  font-size: .60rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; padding: 2px 8px; border-radius: 3px;
}
.prod-status-tag.hidden { display: none; }
.ps-end-of-life          { background: rgba(245,158,11,.15); color: #b45309; border: 1px solid rgba(245,158,11,.40); }
.ps-discontinued         { background: rgba(239,68,68,.13);  color: #b91c1c; border: 1px solid rgba(239,68,68,.35); }
.ps-not-for-individual-sale { background: rgba(99,102,241,.13); color: #4338ca; border: 1px solid rgba(99,102,241,.35); }
.ps-newly-updated        { background: rgba(14,165,233,.13); color: #0369a1; border: 1px solid rgba(14,165,233,.35); }

/* Item status tag — inside item card (compatible items panel) */
.item-status-tag {
  margin-top: 5px; padding-left: 23px;
  font-size: .60rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; display: inline-block;
}
.is-end-of-life          { color: #b45309; }
.is-discontinued         { color: #b91c1c; }
.is-not-for-individual-sale { color: #4338ca; }
.is-newly-updated        { color: #0369a1; }

/* topbar actions area kept but empty — exports moved to inbox panel */
.detail-topbar-actions { display: flex; gap: 7px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   PRODUCT DETAIL — SPLIT BODY
   ═══════════════════════════════════════════════════════ */

/*
  The detail body is a fixed-height flex row that fills the viewport
  below the header (56px) and topbar (60px).
  Both panels are flex columns; left panel has fixed 300px width,
  right panel takes the remaining space.
  IMPORTANT: overflow:hidden on .detail-body means scrolling happens
  inside each panel, not on the page.
*/
.detail-body {
  display: flex;
  flex-direction: row;
  height: calc(100vh - var(--header-h) - var(--topbar-h));
  overflow: hidden; /* no page scroll — panels scroll internally */
  position: relative;
}

/* ─── LEFT PANEL: In The Box ─────────────────────────── */
.panel-inbox {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 2px solid var(--black);
  display: flex;
  flex-direction: column;
  height: 100%; /* fill parent flex height */
  overflow: hidden;
}

/* ─── Panel header bar (shared base) ────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 42px;          /* fixed height so header never wraps */
  min-height: 42px;
  background: var(--black);
  color: var(--white);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;         /* never shrink */
  white-space: nowrap;
  overflow: hidden;
}
.panel-header i { font-size: .78rem; opacity: .85; flex-shrink: 0; }
.panel-header > span.panel-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.panel-count {
  background: rgba(255,255,255,.18);
  color: var(--white);
  font-size: .63rem; font-weight: 800;
  padding: 2px 7px; border-radius: 10px;
  flex-shrink: 0;
}

/* ─── Inbox export buttons (inside left panel header) ── */
.inbox-export-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 4px;
}
.inbox-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: .63rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .13s;
  border: 1.5px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.10);
  color: var(--white);
  letter-spacing: .01em;
  line-height: 1;
}
.inbox-export-btn:hover {
  background: rgba(255,255,255,.26);
  border-color: rgba(255,255,255,.55);
}
.inbox-export-xls { background: rgba(34,197,94,.22); border-color: rgba(34,197,94,.50); }
.inbox-export-xls:hover { background: rgba(34,197,94,.42); border-color: rgba(34,197,94,.75); }
.inbox-export-pdf { background: rgba(220,60,60,.30); border-color: rgba(220,60,60,.50); }
.inbox-export-pdf:hover { background: rgba(220,60,60,.50); border-color: rgba(220,60,60,.75); }

/* ─── Inbox item list (scrollable area below header) ─── */
.inbox-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  min-height: 0; /* critical: allow flex child to shrink & scroll */
}
.inbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-lt);
  transition: background .1s;
}
.inbox-item:last-child { border-bottom: none; }
.inbox-item:hover { background: var(--bg); }
.inbox-num {
  font-size: .65rem; font-weight: 700; color: var(--light);
  min-width: 18px; text-align: right; flex-shrink: 0;
}
.inbox-qty {
  background: var(--ink); color: var(--white);
  font-size: .64rem; font-weight: 800;
  padding: 2px 7px; border-radius: 3px;
  white-space: nowrap; flex-shrink: 0;
  min-width: 30px; text-align: center;
}
.inbox-name {
  font-size: .81rem; font-weight: 500; color: var(--ink);
  line-height: 1.35; flex: 1;
}

/* ─── RIGHT PANEL: Compatible Items ─────────────────── */
/*
  The right panel is also a flex column filling the remaining width.
  Its own .compat-scroll area is a horizontal-scroll flex container
  where each category column sits side by side.
  Key: .panel-compat must have overflow:hidden and height:100%
  so .compat-scroll can flex:1 and scroll.
*/
.panel-compat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* Compat panel header (slightly different bg) */
.compat-panel-header {
  background: var(--ink); /* slightly lighter than pure black */
}
.compat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.must-add-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.12);
  color: var(--white); font-size: .65rem; font-weight: 700;
  padding: 3px 9px; border-radius: 10px;
  letter-spacing: .02em; white-space: nowrap;
}
.select-all-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--white);
  padding: 4px 10px; border-radius: var(--r);
  font-family: var(--font); font-size: .70rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  transition: background .13s; white-space: nowrap;
}
.select-all-btn:hover { background: rgba(255,255,255,.22); }

/* Must-add info notice (below compat header) */
.must-add-notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 14px;
  background: var(--bg-off);
  border-bottom: 1px solid var(--border);
  font-size: .79rem; color: var(--dark); line-height: 1.5;
  flex-shrink: 0;
}
.must-add-notice i { color: var(--dark); margin-top: 2px; flex-shrink: 0; }

/* ─── COMPAT SCROLL AREA ────────────────────────────────
   This is the horizontal scroll container.
   - flex:1 with min-height:0 so it fills remaining panel height
   - overflow-x:auto scrolls columns horizontally
   - overflow-y:hidden — vertical scrolling is per-column
   - display:flex; align-items:stretch — columns stretch to full height
─────────────────────────────────────────────────────── */
.compat-scroll {
  flex: 1;
  min-height: 0;           /* allow flex child to shrink */
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;    /* each cat-col fills full height */
  background: var(--bg);
}

/* ─── Category column ───────────────────────────────────
   Each column is a fixed-width flex column.
   Header is NOT position:sticky — it doesn't work inside
   an overflow:hidden parent. Instead the header is just
   a non-scrolling flex child above the scrollable body.
─────────────────────────────────────────────────────── */
.cat-col {
  display: flex;
  flex-direction: column;
  width: var(--col-w);
  min-width: var(--col-w);
  max-width: var(--col-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--white);
  height: 100%; /* fills stretch height from parent */
  overflow: hidden;
}
.cat-col:last-child { border-right: none; }

/* Column header — dark bar, always visible at top of column */
.cat-col-hdr {
  flex-shrink: 0;          /* never shrink — always visible */
  background: var(--dark);
  color: var(--white);
  padding: 9px 11px 8px;
  border-bottom: 2px solid var(--black);
  /* NOT position:sticky — parent overflow:hidden prevents it */
}
.cat-col-hdr-top {
  display: flex; align-items: center; gap: 6px;
}
.cat-col-icon {
  width: 20px; height: 20px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: .56rem; flex-shrink: 0;
}
.cat-col-title {
  font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  line-height: 1.1; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-col-count {
  background: rgba(255,255,255,.20);
  font-size: .60rem; font-weight: 800;
  padding: 1px 6px; border-radius: 9px; flex-shrink: 0;
}
.cat-col-sub {
  font-size: .61rem; color: rgba(255,255,255,.55);
  padding-left: 26px; margin-top: 3px;
  line-height: 1.2;
}

/* Column body — scrolls vertically, items listed below header */
.cat-col-body {
  flex: 1;
  min-height: 0;           /* required so this flex child can scroll */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 7px 7px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ─── Item card ─────────────────────────────────────── */
.item-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  transition: border-color .12s, box-shadow .12s;
  cursor: default;
}
.item-card:hover { border-color: #bbb; box-shadow: var(--sh-xs); }
.item-card.is-selected {
  border-color: var(--ink); border-width: 1.5px;
  background: #fafafa;
}
.item-card.is-must-add {
  border-color: #999; border-width: 1.5px;
  background: #fafafa;
}
/* Dependency pair items — amber left border to stand out */
.item-card.is-dep-must {
  border-color: #c97c00; border-width: 1.5px;
  background: #fffbf2;
}
.item-card.is-dep-must:hover { border-color: #a66500; box-shadow: var(--sh-xs); }

/* ─── Dependency pair group ──────────────────────────── */
.dep-pair {
  border: 2px solid #c97c00;
  border-radius: 7px;
  background: #fffcf4;
  overflow: visible;
  margin-bottom: 2px;
  display: block;
  width: 100%;
  box-sizing: border-box;
}
/* Notice banner at the top of the pair */
.dep-pair-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  background: #c97c00;
  color: #fff;
  font-size: .70rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
}
.dep-pair-notice i { font-size: .74rem; flex-shrink: 0; }
/* The two item cards inside the pair */
.dep-pair .item-card {
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-top: 1px solid #ffe4b0 !important;
  border-radius: 0 !important;
  background: #fffcf4 !important;
  margin: 0 !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.dep-pair .item-card:hover { border-color: #ffe4b0; background: rgba(201,124,0,.04); }
.dep-pair .item-card.is-selected {
  background: rgba(201,124,0,.08);
  border-color: #ffe4b0;
}
/* "— OR —" divider between the two options */
.dep-pair-or {
  text-align: center;
  font-size: .68rem;
  font-weight: 800;
  color: #c97c00;
  letter-spacing: .08em;
  padding: 3px 0;
  background: #fff3d8;
  border-top: 1px dashed #f0c87a;
  border-bottom: 1px dashed #f0c87a;
}

/* Checkbox + name */
.item-card-top {
  display: flex; align-items: flex-start;
  gap: 8px; margin-bottom: 5px;
}
.item-cb {
  width: 15px; height: 15px;
  border: 1.5px solid var(--border); border-radius: 3px;
  background: var(--white); cursor: pointer;
  flex-shrink: 0; margin-top: 2px;
  appearance: none; -webkit-appearance: none;
  position: relative; transition: all .1s;
}
.item-cb:checked { background: var(--black); border-color: var(--black); }
.item-cb:checked::after {
  content: '✓'; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  color: var(--white); font-size: 9px; font-weight: 900; line-height: 1;
}
.item-cb:disabled { opacity: .55; cursor: not-allowed; }
.item-name {
  font-size: .77rem; font-weight: 600; color: var(--ink);
  line-height: 1.35; flex: 1;
}

/* Badges */
.item-badges {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 4px; padding-left: 23px;
}

/* Item description — Option A: subtle grey italic note */
.item-desc {
  margin-top: 6px;
  padding-left: 23px;
  font-size: .72rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.45;
  display: flex;
  gap: 5px;
}
.item-desc i {
  font-size: .68rem;
  margin-top: 2px;
  flex-shrink: 0;
  color: #9ca3af;
  font-style: normal;
}
.badge {
  font-size: .58rem; font-weight: 800; padding: 2px 6px;
  border-radius: 2px; letter-spacing: .03em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 3px;
}
.badge-must   { background: var(--ink); color: var(--white); }
.badge-cond   { background: #555; color: var(--white); }
.badge-dep    { background: #c97c00; color: #fff; }
.badge-alt    { background: var(--bg); color: var(--mid); border: 1px solid var(--border); }
.badge-ean    { background: var(--bg); color: var(--muted); border: 1px solid var(--border-lt);
                font-family: 'Courier New',monospace; font-weight: 500; letter-spacing: 0; }
.badge-qty    { background: var(--bg); color: var(--dark); border: 1px solid var(--border); }

/* ─── Selection summary ──────────────────────────────── */
.selection-summary {
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.summary-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--black); color: var(--white);
  font-size: .80rem; font-weight: 700;
  gap: 8px;
}
/* Actions group: kit export buttons + clear button */
.summary-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
/* Kit export buttons */
.kit-export-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(34,197,94,.18); border: 1px solid rgba(34,197,94,.45);
  color: #86efac;
  padding: 4px 11px; border-radius: 4px;
  font-family: var(--font); font-size: .70rem; font-weight: 700;
  cursor: pointer; letter-spacing: .02em;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.kit-export-btn:hover {
  background: rgba(34,197,94,.35); border-color: rgba(34,197,94,.70);
  color: #bbf7d0;
}
.kit-export-pdf {
  background: rgba(220,60,60,.18); border-color: rgba(220,60,60,.45);
  color: #fca5a5;
}
.kit-export-pdf:hover {
  background: rgba(220,60,60,.35); border-color: rgba(220,60,60,.70);
  color: #fecaca;
}
.summary-clear-btn {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20);
  color: rgba(255,255,255,.75); padding: 4px 10px; border-radius: 4px;
  font-size: .70rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px; transition: background .12s;
  white-space: nowrap;
}
.summary-clear-btn:hover { background: rgba(255,255,255,.22); color: var(--white); }

/* Kit export buttons — locked/disabled state */
.kit-export-btn.kit-export-locked,
.kit-export-btn:disabled {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.28) !important;
  cursor: not-allowed !important;
  opacity: 1;
}
.kit-export-btn.kit-export-locked:hover,
.kit-export-btn:disabled:hover {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.28) !important;
}

/* Warning strip shown below summary bar when dep pairs unresolved */
.kit-export-warning {
  display: flex; align-items: flex-start; gap: 7px;
  background: #7c4a00;
  border-top: 2px solid #f59e0b;
  padding: 8px 14px;
  font-size: .72rem; color: #fff8e1;
  line-height: 1.5;
}
.kit-export-warning i {
  color: #fcd34d; font-size: .82rem;
  flex-shrink: 0; margin-top: 2px;
}
.kit-export-warning em {
  font-style: normal; font-weight: 700; color: #fcd34d;
}
.summary-chips {
  padding: 8px 14px 10px;
  display: flex; flex-wrap: wrap; gap: 5px;
  max-height: 100px; overflow-y: auto;
}
.summary-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 9px; font-size: .76rem;
}
.chip-cat {
  font-size: .58rem; font-weight: 700; text-transform: uppercase;
  background: var(--dark); color: var(--white); padding: 1px 5px; border-radius: 2px;
}
.chip-name { font-weight: 500; color: var(--ink); }
.chip-must { font-size: .58rem; font-weight: 800; background: var(--black); color: var(--white); padding: 1px 5px; border-radius: 2px; }
.chip-remove {
  background: none; border: none; color: var(--light);
  cursor: pointer; padding: 1px 2px; font-size: .72rem; transition: color .1s;
}
.chip-remove:hover { color: var(--black); }

/* ═══════════════════════════════════════════════════════
   ITEM COMPAT RESULTS PAGE
   (from home Card 2 and from BOQ Builder page)
   Each product row shows a dark header + category columns
   ═══════════════════════════════════════════════════════ */
#item-results-section { background: var(--bg); min-height: calc(100vh - var(--header-h)); }

.item-results-body {
  max-width: 1400px; margin: 0 auto;
  padding: 24px 24px 48px;
}

.result-name-em { font-style: normal; font-weight: 900; color: var(--black); }

/* ── Item compatibility results — new flat layout ── */

/* Searched item header card */
.irc-item-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--black); border-radius: var(--r-md);
  padding: 18px 22px; margin-bottom: 14px;
  gap: 16px;
}
.irc-item-header-left {
  display: flex; align-items: center; gap: 14px; min-width: 0;
}
.irc-item-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.10);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.80); font-size: 1rem; flex-shrink: 0;
}
.irc-item-title {
  font-size: 1.05rem; font-weight: 900; color: var(--white);
  line-height: 1.25; margin-bottom: 5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Status badges — Find Compatibility results */
.irc-status-badge {
  font-size: .58rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 7px; border-radius: 3px;
  white-space: nowrap; flex-shrink: 0;
}
/* On dark header background */
.irc-status-inline.irc-status-end-of-life          { background: rgba(245,158,11,.25); color: #fde68a; border: 1px solid rgba(245,158,11,.50); }
.irc-status-inline.irc-status-discontinued         { background: rgba(239,68,68,.25);  color: #fecaca; border: 1px solid rgba(239,68,68,.50); }
.irc-status-inline.irc-status-not-for-individual-sale { background: rgba(165,180,252,.20); color: #c7d2fe; border: 1px solid rgba(165,180,252,.40); }
.irc-status-inline.irc-status-newly-updated        { background: rgba(125,211,252,.20); color: #bae6fd; border: 1px solid rgba(125,211,252,.40); }
/* On white product row background */
.irc-status-end-of-life          { background: rgba(245,158,11,.15); color: #b45309; border: 1px solid rgba(245,158,11,.40); }
.irc-status-discontinued         { background: rgba(239,68,68,.13);  color: #b91c1c; border: 1px solid rgba(239,68,68,.35); }
.irc-status-not-for-individual-sale { background: rgba(99,102,241,.13); color: #4338ca; border: 1px solid rgba(99,102,241,.35); }
.irc-status-newly-updated        { background: rgba(14,165,233,.13); color: #0369a1; border: 1px solid rgba(14,165,233,.35); }
.irc-item-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.irc-item-ean-badge {
  font-family: 'Courier New', monospace;
  font-size: .72rem; font-weight: 600;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.80);
  padding: 2px 9px; border-radius: 4px; letter-spacing: .03em;
}
.irc-item-type-badge {
  font-size: .67rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  padding: 2px 8px; border-radius: 3px;
}
.irc-item-count-badge {
  flex-shrink: 0; text-align: right;
  font-size: .78rem; color: rgba(255,255,255,.60); font-weight: 500;
  white-space: nowrap;
}
.irc-item-count-badge strong {
  display: block; font-size: 1.6rem; font-weight: 900;
  color: var(--white); line-height: 1;
}

/* Flat product table */
.irc-flat-table {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.irc-flat-thead {
  display: flex; align-items: center;
  padding: 9px 18px;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  font-size: .68rem; font-weight: 800;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
.irc-flat-tbody { display: flex; flex-direction: column; }
.irc-flat-row {
  display: flex; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-lt);
  transition: background .12s;
}
.irc-flat-row:last-child { border-bottom: none; }
.irc-flat-row:hover { background: var(--bg); }

/* Column widths — shared between header and rows */
.irc-flat-col-num  { width: 36px; flex-shrink: 0; font-size: .72rem; font-weight: 800; color: var(--muted); }
.irc-flat-col-name { flex: 1; min-width: 0; font-size: .85rem; font-weight: 600; color: var(--ink); padding-right: 16px; }
.irc-flat-col-ean  { width: 180px; flex-shrink: 0; }
.irc-flat-col-action { width: 130px; flex-shrink: 0; display: flex; justify-content: flex-end; }

.irc-prod-ean-pill {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: .71rem; font-weight: 500;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--border-lt);
  padding: 3px 8px; border-radius: 4px; letter-spacing: .02em;
}

.irc-flat-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--black); color: var(--white);
  border: none; padding: 6px 13px; border-radius: var(--r);
  font-family: var(--font); font-size: .73rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .13s;
}
.irc-flat-view-btn:hover { background: #333; }
.irc-flat-view-btn i { font-size: .68rem; }

/* Empty state */
.irc-empty {
  text-align: center; padding: 60px 24px;
  color: var(--muted); font-size: .88rem;
}

/* Responsive */
@media (max-width: 600px) {
  .irc-flat-col-ean { display: none; }
  .irc-flat-col-action { width: 100px; }
  .irc-item-count-badge strong { font-size: 1.2rem; }
}

/* ═══════════════════════════════════════════════════════
   INNER HERO (Find Compatibility page)
   ═══════════════════════════════════════════════════════ */
.inner-hero {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 44px 24px 32px; text-align: center;
}
.inner-hero h2 { font-size: 1.5rem; font-weight: 900; color: var(--black); margin-bottom: 8px; }
.inner-hero p  { font-size: .86rem; color: var(--muted); margin-bottom: 22px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ═══════════════════════════════════════════════════════
   ADMIN PORTAL
   ═══════════════════════════════════════════════════════ */
.admin-header-bar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 22px 24px;
}
.admin-header-bar h2 { font-size: 1.15rem; font-weight: 900; color: var(--black); display: flex; align-items: center; gap: 9px; margin-bottom: 3px; }
.admin-header-bar p  { color: var(--muted); font-size: .83rem; }

.admin-grid {
  max-width: 1400px; margin: 0 auto; padding: 22px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.admin-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.admin-card-wide { grid-column: 1 / -1; }
.admin-card-title {
  background: var(--black); color: var(--white);
  padding: 11px 16px; font-size: .81rem; font-weight: 800;
  display: flex; align-items: center; gap: 8px; letter-spacing: .02em;
}
.admin-card-body { padding: 18px; }

.upload-zone { border: 2px dashed var(--border); border-radius: var(--r); padding: 18px; text-align: center; margin-bottom: 12px; background: var(--bg-off); transition: border-color .13s; }
.upload-zone:hover { border-color: var(--dark); }
.upload-zone i { color: var(--muted); margin-bottom: 8px; display: block; }
.upload-zone p { font-size: .82rem; font-weight: 600; color: var(--dark); margin-bottom: 10px; }
.upload-zone input[type="file"] { display: none; }
.upload-btn { display: inline-block; background: var(--black); color: var(--white); padding: 7px 16px; border-radius: var(--r); font-size: .75rem; font-weight: 700; cursor: pointer; transition: background .13s; }
.upload-btn:hover { background: var(--dark); }
.upload-file-name { display: block; font-size: .71rem; color: var(--muted); margin-top: 5px; }

.admin-primary-btn { width: 100%; padding: 10px; border-radius: var(--r); font-family: var(--font); font-size: .83rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: all .13s; border: 1.5px solid var(--black); background: var(--black); color: var(--white); margin-top: 8px; }
.admin-primary-btn:hover { background: var(--dark); }
.admin-secondary-btn { width: 100%; padding: 10px; border-radius: var(--r); font-family: var(--font); font-size: .83rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: all .13s; border: 1.5px solid var(--black); background: var(--white); color: var(--black); margin-top: 8px; }
.admin-secondary-btn:hover { background: var(--black); color: var(--white); }

#sync-status { margin-top: 10px; padding: 9px 12px; border-radius: var(--r); font-size: .78rem; font-weight: 600; display: none; }
#sync-status.ok  { background: var(--bg); color: var(--black); border: 1px solid var(--border); display: block; }
#sync-status.err { background: #fff5f5; color: #c00; border: 1px solid #fcc; display: block; }

/* ═══════════════════════════════════════════════════════
   FEEDBACK SYSTEM
   ═══════════════════════════════════════════════════════ */

/* ── Shared pulse animation for all feedback triggers ── */
@keyframes fbPulseRing {
  0%   { box-shadow: 0 0 0 0   rgba(109,40,217,.50), 0 3px 12px rgba(109,40,217,.32); }
  60%  { box-shadow: 0 0 0 8px rgba(109,40,217,.00), 0 3px 12px rgba(109,40,217,.22); }
  100% { box-shadow: 0 0 0 0   rgba(109,40,217,.00), 0 3px 12px rgba(109,40,217,.22); }
}
@keyframes fbIconWiggle {
  0%,100% { transform: rotate(0deg); }
  20%      { transform: rotate(-14deg); }
  40%      { transform: rotate(12deg); }
  60%      { transform: rotate(-8deg); }
  80%      { transform: rotate(6deg); }
}

/* ── Header nav feedback button (Home page — lives in the top nav bar) ── */
.fb-header-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: #ffffff;
  border: none;
  padding: 7px 15px; border-radius: 20px;
  font-family: var(--font); font-size: .76rem; font-weight: 700;
  letter-spacing: .025em;
  cursor: pointer;
  animation: fbPulseRing 2.4s ease-out infinite;
  transition: transform .15s, filter .15s;
  white-space: nowrap;
}
.fb-header-btn:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.12);
  animation: none;
  box-shadow: 0 5px 18px rgba(109,40,217,.55);
}
.fb-header-btn:active { transform: scale(.97); filter: brightness(.95); }
.fb-header-btn i {
  font-size: .80rem;
  animation: fbIconWiggle 3s ease-in-out infinite;
}

/* ── Find Compatibility page trigger row (kept for that page) ── */
.fb-trigger-row {
  display: flex; align-items: center; justify-content: center;
  margin-top: 24px;
}
.fb-trigger-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: #ffffff;
  border: none;
  padding: 11px 26px; border-radius: 28px;
  font-family: var(--font); font-size: .82rem; font-weight: 700;
  letter-spacing: .025em;
  cursor: pointer;
  animation: fbPulseRing 2.4s ease-out infinite;
  transition: transform .15s, filter .15s;
  position: relative;
}
.fb-trigger-btn::before {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,0));
  pointer-events: none;
}
.fb-trigger-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.10);
  animation: none;
  box-shadow: 0 6px 20px rgba(109,40,217,.55);
}
.fb-trigger-btn:active { transform: scale(.97); filter: brightness(.95); }
.fb-trigger-btn i {
  font-size: .90rem;
  animation: fbIconWiggle 3s ease-in-out infinite;
}
.fb-trigger-sm { font-size: .77rem; padding: 8px 18px; }

/* ── Product Detail floating feedback button ── */
.fb-sticky-bar {
  display: flex; justify-content: flex-end;
  padding: 8px 20px 0;
  background: transparent;
  position: relative; z-index: 10;
}
.fb-floating-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: #ffffff;
  border: none;
  padding: 7px 16px; border-radius: 20px;
  font-family: var(--font); font-size: .76rem; font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(109,40,217,.40);
  animation: fbPulseRing 2.4s ease-out infinite;
  transition: transform .15s, filter .15s;
}
.fb-floating-btn:hover {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.10);
  animation: none;
  box-shadow: 0 6px 20px rgba(109,40,217,.55);
}
.fb-floating-btn:active { transform: scale(.97); }
.fb-floating-btn i {
  font-size: .78rem;
  animation: fbIconWiggle 3s ease-in-out infinite;
}

/* "NEW" badge inside feedback buttons */
.fb-new-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ffffff;
  color: #6d28d9;
  font-size: .58rem; font-weight: 900;
  letter-spacing: .07em;
  padding: 2px 6px; border-radius: 8px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(109,40,217,.25);
}

/* Overlay */
.fb-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.fb-overlay.active { display: flex; }

/* Modal panel */
.fb-modal {
  background: var(--white);
  border-radius: var(--r-md);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  animation: fbSlideIn .22s ease;
}
@keyframes fbSlideIn {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Modal header */
.fb-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border-lt);
  background: var(--black);
  border-radius: var(--r-md) var(--r-md) 0 0;
  flex-shrink: 0;
}
.fb-modal-title-row {
  display: flex; align-items: center; gap: 10px;
}
.fb-modal-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); border-radius: 8px;
  color: var(--white); font-size: 1rem;
}
.fb-modal-header h3 {
  font-size: .97rem; font-weight: 800; color: var(--white);
  letter-spacing: .01em;
}
.fb-close-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.6); font-size: 1rem;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: all .13s;
}
.fb-close-btn:hover { color: var(--white); background: rgba(255,255,255,.12); }

/* Context badge */
.fb-context-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 20px;
  background: #f8f8f8;
  border-bottom: 1px solid var(--border-lt);
  font-size: .73rem; font-weight: 700; color: var(--mid);
  letter-spacing: .04em; text-transform: uppercase;
  flex-shrink: 0;
}
.fb-context-badge i { font-size: .71rem; color: var(--muted); }

/* Modal body */
.fb-modal-body {
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Fields */
.fb-field { display: flex; flex-direction: column; gap: 6px; }
.fb-label {
  font-size: .77rem; font-weight: 700; color: var(--dark);
  display: flex; align-items: center; gap: 6px;
}
.fb-label i { color: var(--muted); font-size: .73rem; }
.fb-required { color: #c00; font-weight: 800; }
.fb-optional { color: var(--muted); font-weight: 400; font-size: .72rem; }

/* Category grid */
.fb-category-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px;
}
.fb-cat-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--r); font-family: var(--font);
  font-size: .75rem; font-weight: 600; color: var(--dark);
  cursor: pointer; transition: all .13s; text-align: left;
}
.fb-cat-btn i { font-size: .75rem; color: var(--muted); flex-shrink: 0; }
.fb-cat-btn:hover {
  background: var(--bg-off); border-color: var(--dark); color: var(--ink);
}
.fb-cat-btn:hover i { color: var(--dark); }
.fb-cat-btn.selected {
  background: var(--black); border-color: var(--black);
  color: var(--white);
}
.fb-cat-btn.selected i { color: rgba(255,255,255,.7); }

/* Inputs */
.fb-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r);
  font-family: var(--font); font-size: .82rem; color: var(--ink);
  background: var(--white); outline: none;
  transition: border-color .13s;
}
.fb-input:focus { border-color: var(--dark); }

.fb-textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r);
  font-family: var(--font); font-size: .82rem; color: var(--ink);
  background: var(--white); outline: none; resize: vertical;
  min-height: 100px; line-height: 1.55;
  transition: border-color .13s;
}
.fb-textarea:focus { border-color: var(--dark); }
.fb-char-count {
  font-size: .69rem; color: var(--muted); text-align: right;
}

/* Upload area */
.fb-upload-area {
  border: 2px dashed var(--border); border-radius: var(--r);
  padding: 18px; text-align: center;
  cursor: pointer; transition: all .14s;
  background: var(--bg);
  position: relative; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.fb-upload-area:hover { border-color: var(--dark); background: var(--bg-off); }
.fb-upload-idle i { font-size: 1.6rem; color: var(--light); margin-bottom: 6px; }
.fb-upload-idle p { font-size: .78rem; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.fb-upload-idle span { font-size: .70rem; color: var(--muted); }
.fb-upload-preview {
  display: flex !important; flex-direction: column; align-items: center;
  gap: 6px; width: 100%;
}
.fb-upload-preview img {
  max-width: 100%; max-height: 140px; border-radius: 4px;
  border: 1px solid var(--border); object-fit: contain;
}
.fb-preview-name {
  font-size: .70rem; color: var(--muted); word-break: break-all; text-align: center;
}
.fb-remove-img {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.55); color: var(--white);
  border: none; border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; cursor: pointer; transition: background .12s;
}
.fb-remove-img:hover { background: rgba(0,0,0,.8); }

/* Modal footer */
.fb-modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-lt);
  flex-shrink: 0;
}
.fb-cancel-btn {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--dark); padding: 8px 18px; border-radius: var(--r);
  font-family: var(--font); font-size: .80rem; font-weight: 600;
  cursor: pointer; transition: all .13s; display: inline-flex; align-items: center; gap: 6px;
}
.fb-cancel-btn:hover { background: var(--bg); border-color: var(--dark); }
.fb-submit-btn {
  background: var(--black); border: 1.5px solid var(--black);
  color: var(--white); padding: 8px 20px; border-radius: var(--r);
  font-family: var(--font); font-size: .80rem; font-weight: 700;
  cursor: pointer; transition: all .13s; display: inline-flex; align-items: center; gap: 6px;
}
.fb-submit-btn:hover { background: var(--dark); }
.fb-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Validation error highlight */
.fb-field.has-error .fb-category-grid,
.fb-field.has-error .fb-textarea { outline: 2px solid #c00; border-radius: var(--r); }
.fb-error-msg {
  font-size: .71rem; color: #c00; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}

/* Responsive */
@media (max-width: 520px) {
  .fb-category-grid { grid-template-columns: 1fr; }
  .fb-modal { max-height: 95vh; }
  .fb-modal-footer { flex-direction: column-reverse; }
  .fb-cancel-btn, .fb-submit-btn { width: 100%; justify-content: center; }
}

.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-lt); font-size: .83rem; }
.stat-row:last-of-type { border-bottom: none; }
.stat-row span { color: var(--mid); }
.stat-row strong { font-weight: 800; font-size: .98rem; }

.admin-filter-input { margin-left: auto; padding: 4px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; background: rgba(255,255,255,.12); color: var(--white); font-family: var(--font); font-size: .75rem; outline: none; min-width: 160px; }
.admin-filter-input::placeholder { color: rgba(255,255,255,.45); }

.admin-table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .77rem; }
.admin-table thead th { background: var(--bg); color: var(--dark); font-weight: 800; padding: 9px 12px; text-align: left; border-bottom: 2px solid var(--black); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.admin-table tbody tr { border-bottom: 1px solid var(--border-lt); }
.admin-table tbody tr:hover { background: var(--bg); }
.admin-table tbody td { padding: 8px 12px; color: var(--ink); vertical-align: middle; }
.admin-tag { font-size: .63rem; font-weight: 700; padding: 2px 7px; border-radius: 2px; background: var(--black); color: var(--white); white-space: nowrap; }
.admin-tag.off { background: var(--muted); }
.admin-view-btn { background: var(--white); border: 1.5px solid var(--black); color: var(--black); padding: 3px 10px; border-radius: 4px; font-size: .71rem; font-weight: 700; cursor: pointer; transition: all .1s; }
.admin-view-btn:hover { background: var(--black); color: var(--white); }

/* ═══════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════ */
#toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 400; display: flex; flex-direction: column; gap: 6px; }
.toast { background: var(--black); color: var(--white); padding: 10px 16px; border-radius: var(--r); font-size: .81rem; font-weight: 600; box-shadow: var(--sh-md); animation: slideup .2s ease; display: flex; align-items: center; gap: 8px; min-width: 240px; max-width: 360px; }
@keyframes slideup { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Item result rows (name + EAN only) ─────────────── */
.irc-result-list {
  padding: 4px 0 6px;
  display: flex;
  flex-direction: column;
}

.irc-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-lt);
  transition: background .1s;
}
.irc-result-row:last-child { border-bottom: none; }
.irc-result-row:hover { background: var(--bg); }

.irc-result-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  flex: 1;
}

.irc-result-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.irc-result-ean {
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  font-weight: 600;
  color: var(--white);
  background: var(--ink);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .03em;
}
.irc-result-ean.no-ean {
  background: var(--light);
  color: var(--white);
}

.irc-result-cat {
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--mid);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
}

/* Empty state */
.irc-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--dark);
  font-size: .90rem;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .qa-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 860px) {
  .search-row { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: repeat(2,1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  /* On small screens: stack panels vertically */
  .detail-body {
    flex-direction: column;
    height: auto;
    overflow: visible;
    min-height: calc(100vh - var(--header-h) - var(--topbar-h));
  }
  .panel-inbox {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    max-height: 360px;
    border-right: none;
    border-bottom: 2px solid var(--black);
  }
  .panel-compat {
    height: auto;
    min-height: 500px;
  }
  .compat-scroll {
    height: 500px;
    min-height: 0;
    overflow-y: hidden;
  }
  .cat-col {
    height: 500px;
  }
}
@media (max-width: 600px) {
  .header-title { display: none; }
  .header-inner { padding: 0 14px; }
  #hero-section { padding: 28px 14px 0; }
  .hero-top h1 { font-size: 2rem; }
  .hero-top h2 { font-size: 1.4rem; }
  .qa-grid { grid-template-columns: repeat(2,1fr); }
  .detail-topbar { padding: 0 14px; }
  .item-results-body { padding: 16px 14px 32px; }
}
