/* ==========================================================================
   Price Survey v2 — app-specific styles.
   Extends css/base-theme.css (linked before this file). Uses ONLY the tokens
   defined there — no new colors/radii/shadows are invented here.
   ========================================================================== */

/* ---- App scaffold ---------------------------------------------------- */
.app-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
  font-size: 13px; font-weight: 600; color: var(--text2);
  text-decoration: none; padding: 7px 12px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--accent-lt); color: var(--accent); }

.brand-logo { height: 30px; width: auto; display: block; }
.header-user { font-size: 13px; color: var(--text2); font-weight: 600; }
.header-user .role-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--bg); color: var(--text3); border: 1px solid var(--border);
  border-radius: 12px; padding: 1px 8px; margin-left: 6px; text-transform: uppercase;
}

/* Diversa Intranet: link back to the portal (sessions that came from the portal) and
   the display name under a username in Admin > Users. */
.portal-link { text-decoration: none; margin-right: 4px; }
.td-sub { font-size: 12px; color: var(--text3); font-weight: 400; margin-top: 2px; }
/* Phones: the header wraps instead of pushing Log out off-screen (it already overflowed
   before the portal link; base-theme.css is not edited, so the override lives here). */
@media (max-width: 720px) {
  .app-header { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 16px; row-gap: 6px; }
  .header-left { flex-wrap: wrap; row-gap: 4px; }
  .app-nav { margin-left: 0; }
  .header-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .header-actions .btn-text-action { white-space: nowrap; }
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { color: var(--text2); font-size: 13px; margin-top: 2px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  text-decoration: none; margin-bottom: 12px;
}
.back-link:hover { color: var(--accent); }

/* ---- Login ----------------------------------------------------------- */
.login-logo { display: block; margin: 0 auto 18px; height: 44px; width: auto; }
.gateway-card h1.login-title { text-align: center; margin-bottom: 4px; }
.gateway-card .login-tag { text-align: center; margin-bottom: 24px; }
.login-field { text-align: left; margin-bottom: 14px; }

/* ---- Dashboard: survey grid ----------------------------------------- */
.survey-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .survey-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .survey-grid { grid-template-columns: repeat(3, 1fr); } }

.survey-card { display: flex; flex-direction: column; gap: 10px; }
.survey-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.survey-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.survey-date { font-size: 12px; color: var(--text3); font-family: 'JetBrains Mono', monospace; }
.survey-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text2); }
.survey-stats b { font-family: 'JetBrains Mono', monospace; color: var(--text); font-weight: 600; }
.survey-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }

/* ---- Tabs ------------------------------------------------------------ */
.ps-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.ps-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text2);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s; margin-bottom: -1px;
}
.ps-tab:hover { color: var(--text); }
.ps-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ps-tab svg { flex-shrink: 0; }

/* ---- Supermarket selector (grid of pills) --------------------------- */
.sm-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sm-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border2); background: var(--surface); color: var(--text2);
  cursor: pointer; transition: all .15s;
}
.sm-pill:hover { border-color: var(--accent); color: var(--accent); }
.sm-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sm-pill .sm-count { font-family: 'JetBrains Mono', monospace; font-size: 11px; opacity: .8; }

/* ---- Photo card grid (price entry) ---------------------------------- */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pc {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: visible;
  display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s;
}
.pc.saved { border-color: var(--success); }
.pc.noprice { border-color: var(--warning-text); }
.pc-photo-wrap { position: relative; height: 180px; background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; cursor: zoom-in; }
.pc-photo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-photo-flag {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.pc-photo-flag.saved { background: var(--success); color: #fff; }
.pc-photo-flag.noprice { background: var(--warning-text); color: #fff; }
.pc-body { padding: 12px; display: flex; flex-direction: column; gap: 9px; }

/* searchable product combobox (inline) */
.pc-combo { position: relative; }
.pc-selected {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 9px; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; /* click the label to change / choose the product */
}

/* Hover magnifier (loupe) over photo cards — follows the cursor, shows the area
   under it at ~2.2x. Positioned and filled from JS (setup loupe in app.js). */
.img-loupe {
  position: fixed; width: 190px; height: 190px; border-radius: 50%;
  border: 3px solid #fff; background-color: var(--bg); background-repeat: no-repeat;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .12);
  pointer-events: none; z-index: 1200; display: none;
}
.pc-selected .muted { color: var(--text3); font-weight: 500; }
.pc-selected .clear-x { color: var(--text3); cursor: pointer; font-size: 14px; line-height: 1; }
.pc-selected .clear-x:hover { color: var(--danger); }
.pc-search { padding: 8px 11px; font-size: 13px; }
.pc-options {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.14); max-height: 240px; overflow-y: auto; display: none;
}
.pc-options.open { display: block; }
.pc-option { padding: 8px 11px; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid var(--border); }
.pc-option:last-child { border-bottom: none; }
.pc-option:hover { background: var(--accent-lt); }
.pc-option .po-brand { font-weight: 700; }
.pc-option .po-meta { color: var(--text3); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.pc-option-new { color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.pc-options-note { padding: 7px 11px; font-size: 11px; color: var(--text3); }

.pc-price-row { display: flex; gap: 7px; align-items: stretch; }
.pc-price-input { flex: 1; padding: 8px 11px; font-family: 'JetBrains Mono', monospace; text-align: center; font-weight: 600; }
.pc-actions { display: flex; gap: 7px; }
.pc-actions .btn { flex: 1; padding: 9px 10px; font-size: 13px; }

/* ---- Price table ----------------------------------------------------- */
.pt-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pt-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: auto; max-height: 74vh;
}
.pt { width: 100%; border-collapse: separate; border-spacing: 0; }
.pt th, .pt td { padding: 9px 12px; font-size: 13px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.pt thead th {
  background: #f8f9fb; position: sticky; top: 0; z-index: 3;
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text2);
}
.pt thead th.pt-sm { text-align: center; }
.pt thead th.pt-stat { text-align: right; color: var(--accent); }
/* sortable headers (click to sort; caret marks the active column) */
.pt thead th.pt-sortable { cursor: pointer; user-select: none; }
.pt thead th.pt-sortable:hover { color: var(--accent); }
.pt thead th.pt-sorted { color: var(--accent); }
.pt .pt-th-in { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.pt .pt-th-in svg { flex: none; }
/* sticky identity columns */
.pt .pt-sticky-1 { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 120px; }
.pt .pt-sticky-2 { position: sticky; left: 120px; z-index: 2; background: var(--surface); min-width: 150px; }
.pt thead .pt-sticky-1, .pt thead .pt-sticky-2 { z-index: 4; background: #f8f9fb; }
.pt tbody tr:hover td { background: #fafbff; }
.pt tbody tr:hover .pt-sticky-1, .pt tbody tr:hover .pt-sticky-2 { background: #fafbff; }
.pt-brand { font-weight: 700; }
.pt-cat .chip { font-weight: 600; }
.pt-size { color: var(--text2); font-family: 'JetBrains Mono', monospace; }
.pt-cell { text-align: center; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.pt-cell.empty { color: var(--text3); font-weight: 400; }
.pt-cell.lo { background: var(--success-lt); color: #007a48; }
.pt-cell.hi { background: var(--danger-lt); color: var(--danger); }
.pt-price-link { color: inherit; text-decoration: none; cursor: pointer; border-bottom: 1px dotted currentColor; }
.pt-present { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); font-family: 'Inter', sans-serif; }
.pt-stat-cell { text-align: right; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.pt-pres-pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.pres-high { background: var(--success-lt); color: #007a48; }
.pres-mid  { background: var(--warning-lt); color: var(--warning-text); }
.pres-low  { background: var(--danger-lt); color: var(--danger); }
/* Brand presence summary (above the Price Table) */
/* ---- Analysis tab (markup from js/analysis.js; the standalone styles the
   same classes with its own palette in api/export.php) ------------------ */
.an { display: flex; flex-direction: column; gap: 22px; }
.an-intro { font-size: 13px; color: var(--text2); background: var(--accent-lt); border-radius: var(--radius); padding: 12px 14px; line-height: 1.5; }
.an-sec h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.an-sec h3 span, .an-sec h4 span { font-weight: 500; color: var(--text3); font-size: 13px; }
.an-sec h4 { font-size: 13px; font-weight: 700; margin: 16px 0 8px; color: var(--text2); }
.an-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
.an-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; background: #f8f9fb; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.an-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.an-table tr:last-child td { border-bottom: 0; }
.an-table.an-compact td { padding: 7px 10px; }
.an-num { text-align: right; white-space: nowrap; }
.an-mono { font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.an-note { color: var(--text3); font-size: 12px; }
.an-prod { display: flex; align-items: center; gap: 8px; }
.an-pres { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.an-pres.an-hi, .an-bar-fill.an-hi { background: var(--success-lt); color: #007a48; }
.an-pres.an-mid, .an-bar-fill.an-mid { background: var(--warning-lt); color: var(--warning-text); }
.an-pres.an-lo, .an-bar-fill.an-lo { background: var(--danger-lt); color: var(--danger); }
.an-bar { display: inline-block; vertical-align: middle; width: 140px; height: 10px; border-radius: 6px; background: var(--bg); overflow: hidden; margin-right: 8px; }
.an-bar-fill { height: 100%; }
.an-bar-fill.an-hi { background: var(--success); } .an-bar-fill.an-mid { background: var(--warning); } .an-bar-fill.an-lo { background: var(--danger); }
.an-barpct { font-size: 12px; color: var(--text2); }
.an-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .an-cards { grid-template-columns: 1fr 1fr; } .an-cards.an-cards-1 { grid-template-columns: 1fr; } }
.an-cards-2 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .an-cards-2 { grid-template-columns: 1fr 1fr; } }
.an-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow-x: auto; }
.an-card .an-table { border: 0; }
.an-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.an-kpi { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); }
.an-vs-pick { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.an-vs-pick select { width: auto; min-width: 180px; }
.an-vs-pick span { font-weight: 700; color: var(--text3); }
.an-verdict { font-size: 14px; margin-bottom: 10px; }
.an-up { color: var(--danger); } .an-down { color: #007a48; }
.an-empty { color: var(--text3); font-size: 13px; padding: 18px; text-align: center; }
.an-empty.an-small { padding: 8px; text-align: left; }
.an-sec .an-table { display: block; overflow-x: auto; }
@media (min-width: 900px) { .an-sec > .an-table { display: table; } }

/* ---- Data / export tab ---------------------------------------------- */
.export-grid { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 520px; }
@media (min-width: 560px) { .export-grid { grid-template-columns: 1fr 1fr; } }
.export-btn {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: var(--radius); cursor: pointer; text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.export-btn:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.export-btn .eb-ico { color: var(--accent); flex-shrink: 0; }
.export-btn .eb-title { font-weight: 700; font-size: 14px; }
.export-btn .eb-desc { font-size: 12px; color: var(--text2); }

/* ---- Admin: dedup + tables ------------------------------------------ */
.admin-sub { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.sim-badge { font-family: 'JetBrains Mono', monospace; font-weight: 700; padding: 2px 9px; border-radius: 12px; font-size: 12px; }
.sim-high { background: var(--success-lt); color: #007a48; }
.sim-mid  { background: var(--warning-lt); color: var(--warning-text); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.merge-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-lt); border: 1px solid rgba(0,115,234,.2);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}

/* ---- Lightbox -------------------------------------------------------- */
#lightbox {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88);
  z-index: 2000; align-items: center; justify-content: center;
  cursor: zoom-out; backdrop-filter: blur(4px);
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 24px 64px rgba(0,0,0,.5); object-fit: contain; }
#lightbox-caption {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.8); font-size: 13px; background: rgba(0,0,0,.55);
  padding: 6px 18px; border-radius: 20px; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
#lightbox-close { position: fixed; top: 20px; right: 24px; color: #fff; font-size: 26px; cursor: pointer; opacity: .75; line-height: 1; }
#lightbox-close:hover { opacity: 1; }

/* ---- Toasts ---------------------------------------------------------- */
#toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.22);
  animation: anim-fade-up var(--duration-base) var(--ease-out) both;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--text); }

/* ---- Misc ------------------------------------------------------------ */
.inline-error {
  background: var(--danger-lt); border: 1px solid rgba(226,68,92,.25);
  border-radius: var(--radius); padding: 14px 16px; color: var(--danger); font-size: 13px;
}
.field-error { color: var(--danger); font-size: 12px; margin-top: 6px; display: none; }
.field-error.show { display: block; }
.spin-inline { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .65s linear infinite; }
.dz {
  border: 2px dashed var(--border2); border-radius: var(--radius); padding: 28px 20px;
  text-align: center; color: var(--text2); font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s;
}
.dz:hover, .dz.over { border-color: var(--accent); background: var(--accent-lt); }
.dz strong { color: var(--text); }
.mb-16 { margin-bottom: 16px; }


/* ======================================================================
   Compare view (cross-survey)
   ====================================================================== */
.cmp-toggle {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--text2); cursor: pointer; user-select: none; white-space: nowrap;
}
.cmp-toggle input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.cmp-picker { display: flex; flex-direction: column; gap: 8px; }
.cmp-prod {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; cursor: pointer; font: inherit; color: inherit;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.cmp-prod:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cmp-prod-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cmp-prod-name { font-size: 14px; }
.cmp-prod-name .po-brand { font-weight: 700; }

/* Catalog thumbnails. The -empty variants keep the row height stable when a
   product has no image, so a list of mixed products does not jump around. */
.cmp-thumb, .cmp-head-thumb {
  border-radius: 8px; background: var(--bg); object-fit: contain; flex: none;
  border: 1px solid var(--border);
}
.cmp-thumb { width: 40px; height: 40px; }
.cmp-head-thumb { width: 56px; height: 56px; }
.cmp-thumb-empty, .cmp-head-thumb-empty, .po-thumb-empty {
  display: inline-flex; align-items: center; justify-content: center; color: var(--text3);
}
.cmp-head-left { display: flex; align-items: center; gap: 14px; }

.cmp-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.cmp-card { display: flex; flex-direction: column; gap: 4px; }
.cmp-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cmp-card-name { font-weight: 700; font-size: 14px; }
.cmp-avg {
  font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700;
  margin-top: 4px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.cmp-card-stats {
  display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text2); margin-top: 2px;
}
.cmp-card-stats b { font-family: 'JetBrains Mono', monospace; color: var(--text); }

.cmp-delta {
  display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; white-space: nowrap;
}
.cmp-delta.up   { background: var(--danger-lt);  color: var(--danger); }   /* price went up = bad for us */
.cmp-delta.down { background: var(--success-lt); color: #007a48; }
.cmp-delta.flat { background: var(--bg); color: var(--text3); font-family: 'Inter', sans-serif; font-weight: 600; }

.cmp-table .pt-cell { white-space: nowrap; }
.cmp-table .pt-cell .cmp-delta { margin-left: 6px; }
.cmp-table thead th.pt-sm { text-align: center; min-width: 130px; }

/* Ghost button that means "destructive" — same weight as the other card
   actions until hovered, so it does not shout on every survey card. */
.btn-danger-ghost { color: var(--text3); padding-left: 9px; padding-right: 9px; }
.btn-danger-ghost:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-lt); }

/* Product thumbnail inside the price-entry combobox and the price table. */
.po-thumb {
  width: 26px; height: 26px; border-radius: 5px; object-fit: contain;
  background: var(--bg); border: 1px solid var(--border); flex: none; vertical-align: middle;
}
.pc-option { display: flex; align-items: center; gap: 8px; }
.pc-option .po-text { flex: 1; min-width: 0; }
.pt-prod-cell { display: flex; align-items: center; gap: 8px; }

/* ---- Photo card: remove product / delete photo ----------------------- */
/* Text button, not a third pill next to Save / No Price: it undoes an
   assignment, and must not be hit by accident while capturing. */
.pc-unassign {
  display: block; width: 100%; margin-top: 8px; padding: 4px 0;
  background: none; border: 0; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 12px; color: var(--text3); text-align: center;
}
.pc-unassign:hover { color: var(--danger); text-decoration: underline; }
/* Admin-only delete over the photo (top-left; the saved flag sits top-right). */
.pc-photo-del {
  position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text2);
  cursor: pointer; box-shadow: var(--shadow);
}
.pc-photo-del:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

/* "Duplicate picture" — any user, bottom-left of the photo (delete sits top-left,
   the price flag top-right). Lets you record a second product on the same picture. */
.pc-dup {
  position: absolute; bottom: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(255, 255, 255, .93); border: 1px solid var(--border); color: var(--text2);
  font-size: 11px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
}
.pc-dup:hover { color: var(--accent); border-color: var(--accent); }

/* A thumbnail that opens the lightbox on click. */
.zoomable { cursor: zoom-in; }

/* ---- Dedup queue photo picker: which photos came from the folder ------ */
.ar-tools { font-size: 12px; margin-bottom: 8px; color: var(--text3); }
.ar-tools a { color: var(--accent); text-decoration: none; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 46vh; overflow-y: auto; }
.ar-photo {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; margin: 0; cursor: pointer;
  border: 1.5px solid var(--border2); border-radius: var(--radius); background: var(--surface);
  text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 11px;
}
.ar-photo.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,115,234,.12); background: var(--accent-lt); }
.ar-photo input { position: absolute; top: 10px; left: 10px; width: auto; margin: 0; }
.ar-photo img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; background: var(--bg); }
.ar-tag { display: inline-block; align-self: flex-start; padding: 1px 6px; border-radius: 999px; background: var(--bg); color: var(--text2); overflow-wrap: anywhere; }
.ar-tag.ar-mine { background: var(--accent-lt); color: var(--accent); font-weight: 600; }
.ar-tag.ar-unknown { background: var(--warning-lt); color: var(--warning-text); font-weight: 600; }
.ar-tag.ar-price { background: var(--success-lt); color: var(--text2); }

/* ---- Merge chooser: two records side by side, pick the one that stays - */
.mc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .mc-grid { grid-template-columns: 1fr 1fr; } }
.mc-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--border2); border-radius: var(--radius); background: var(--surface);
  text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 13px; color: var(--text); margin: 0;
}
.mc-card.mc-keep { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,115,234,.12); background: var(--accent-lt); }
.mc-radio { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }
.mc-radio input { width: auto; margin: 0; }
.mc-head { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.mc-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: contain; background: var(--bg); border: 1px solid var(--border); }
.mc-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--text3); }
.mc-row { display: flex; justify-content: space-between; gap: 10px; }
.mc-row span { color: var(--text3); }
.mc-row b { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.mc-summary { font-size: 13px; color: var(--text2); background: var(--bg); border-radius: var(--radius); padding: 10px 12px; }

/* ---- New Product from a photo: reference photo beside the form ------- */
.np-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.np-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.np-ref { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.np-ref img {
  width: 100%; max-height: 30vh; object-fit: contain; cursor: zoom-in;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.np-ref-hint { display: flex; align-items: center; gap: 5px; color: var(--text3); font-size: 12px; }
@media (min-width: 760px) {
  .np-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  /* The photo stays in view while the form column scrolls. */
  .np-ref { position: sticky; top: 0; }
  .np-ref img { max-height: 62vh; }
  /* base-theme caps .modal-body at 60vh; with a photo there is room for more. */
  .np-box-photo .modal-body { max-height: 74vh; }
}

/* ---- Size editor in the New Product modal (value + unit rows) -------- */
.size-rows { display: flex; flex-direction: column; gap: 8px; }
.size-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 112px auto; gap: 8px; align-items: center;
}
/* "Other…" adds a free unit box next to the select (class set by wireSizeEditor). */
.size-row.has-other { grid-template-columns: minmax(0, 1fr) 112px 92px auto; }
.size-row .sz-val { text-align: left; }
.size-row .sz-del { padding: 8px; color: var(--text3); }
.size-row .sz-del:hover { color: var(--danger); }
.sz-add { margin-top: 8px; }
.sz-hint { color: var(--text3); font-size: 12px; margin-top: 6px; }
/* Edit Product: an old free-text size that cannot be shown as rows. */
.sz-legacy {
  background: var(--warning-lt); border: 1px solid var(--warning); border-radius: var(--radius);
  padding: 8px 10px; font-size: 12px; color: var(--text2); margin-bottom: 8px;
}

/* Numeric table column (counts) — right-aligned so digits line up. */
.td-num { text-align: right; }

/* ---- Fixes over base-theme (do not edit base-theme.css) -------------- */
/* base-theme sets `padding: 10px 14px` on input[type="text"] (specificity 0,1,1),
   which outranks its own `.search-input { padding-left: 38px }` (0,1,0) — so the
   magnifier icon sat on top of the placeholder in every search box. */
input[type="text"].search-input { padding-left: 38px; }
/* base-theme uppercases every <label>; the compare toggle is a sentence, not a field label. */
.cmp-toggle { text-transform: none; letter-spacing: normal; font-weight: 500; font-size: 13px; }
/* base-theme blurs (2px) and darkens (.55) everything behind a modal. For New
   Product the page behind is reference material — the other shelf photos — so
   it stays sharp and only lightly dimmed (José, 2026-11-12). Other modals keep
   the base look. */
.modal-overlay.modal-overlay-clear { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(0,0,0,.22); }
/* Destructive confirm in a modal: the default confirm button is green (success),
   which reads as "go ahead" on an irreversible delete. */
.btn-modal-confirm.btn-modal-danger { background: var(--danger); }

/* ---- Research home (tools as tiles, same look as the Diversa portal; rose = this
   module's color family in the portal) ---- */
.header-home { color: inherit; text-decoration: none; }
.header-home:hover { color: var(--accent); }
.nav-tool { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; margin: 0 4px 0 6px; }
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid #993556; border-radius: var(--radius, 10px); transition: box-shadow .15s, transform .15s; }
.tool-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); transform: translateY(-2px); }
.tool-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; }
.tool-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: inherit; }
.tool-tile { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #F8DFE8; color: #72243E; }
.tool-tile svg { stroke: currentColor; }
.tool-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tool-name { font-size: 14px; font-weight: 700; }
.tool-desc { font-size: 12px; color: var(--text2); line-height: 1.35; }
.tool-arrow { color: var(--text3); display: grid; }
@media (prefers-reduced-motion: reduce) { .tool-card, .tool-card:hover { transition: none; transform: none; } }
