:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5f6b7a;
  --sidebar: #0f1c2e;
  --sidebar-text: #d7e0ec;
  --sidebar-active: #2f6fed;
  --primary: #2f6fed;
  --danger: #d64545;
  --warning: #d9822b;
  --success: #2f9e6b;
  --border: #d9e2ef;
  --shadow: 0 10px 30px rgba(15, 28, 46, 0.08);
  --radius: 12px;
  --font: "Segoe UI", "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}
body {
  font-family: var(--font);
  background: linear-gradient(180deg, #eaf0f8 0%, var(--bg) 220px);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-x: clip;
}
.sidebar {
  width: 260px;
  flex: 0 0 260px;
  max-width: 260px;
  background: linear-gradient(180deg, #12233a, var(--sidebar));
  color: var(--sidebar-text);
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  overflow: hidden;
}
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: .15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.35) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.32);
  border-radius: 8px;
}
.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
  padding: .5rem .75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-link {
  display: block;
  color: var(--sidebar-text);
  padding: .5rem .85rem;
  border-radius: 8px;
  margin-bottom: .12rem;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  background: rgba(47,111,237,.2);
  color: #fff;
  text-decoration: none;
}
.nav-link.active { border-left: 3px solid var(--sidebar-active); }
.nav-section {
  color: rgba(255,255,255,.45);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .55rem .85rem .2rem;
  margin-top: .15rem;
}
.nav-link-sub { padding-left: 2.35rem; font-size: .92rem; }
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--sidebar-text);
  background: transparent;
  border: 0;
  padding: .5rem .85rem;
  border-radius: 8px;
  margin-bottom: .12rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nav-group-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-group-label { display: flex; align-items: center; gap: .55rem; }
.nav-group-icon { flex: none; color: rgba(255,255,255,.65); }
.nav-group-chevron { transition: transform .15s ease; }
.nav-group-toggle[aria-expanded="true"] .nav-group-chevron { transform: rotate(180deg); }
.nav-group-items { margin-bottom: .05rem; }
/* APP-034: grupy menu modułów (Sprzedaż → Allegro → …) */
.nav-module-title { color: rgba(255,255,255,.55); font-size: .78rem; font-weight: 700; padding: .35rem .85rem .15rem 2.35rem; }
.nav-link-d2 { padding-left: 3.1rem; font-size: .86rem; }
.nav-link-d3 { padding-left: 3.85rem; font-size: .82rem; }

.main {
  /* bez width:100% — w flexie z sidebarem dawało 100%+260px i blokowało dopasowanie */
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: .85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.content {
  padding: 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
}
.breadcrumb { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.breadcrumb-alert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  color: #9a5b12;
}
.breadcrumb-alert-text { color: inherit; font-size: .9rem; text-decoration: none; }
.breadcrumb-alert-text:hover { text-decoration: underline; }
.breadcrumb-alert-text strong { font-weight: 700; }

/* —— Ustawienia produktów: menu boczne sekcji + treść (styl Base) —— */
.settings-shell { display: flex; gap: 1.25rem; align-items: flex-start; }
.settings-subnav {
  flex: none;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .5rem;
}
.settings-subnav-link {
  display: block;
  padding: .55rem .7rem;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: .92rem;
}
.settings-subnav-link:hover { background: #f1f5fb; text-decoration: none; }
.settings-subnav-link.active { background: #e3edfd; color: var(--accent, #2563eb); font-weight: 600; }
.settings-subcontent { flex: 1 1 auto; min-width: 0; }
.settings-collapsible summary { cursor: pointer; margin-bottom: .5rem; }
.settings-collapsible summary h2 { margin: 0; display: inline; }
.settings-collapsible[open] summary { margin-bottom: 1rem; }
.settings-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.settings-list-header h2 { margin: 0; }
.settings-list-table .settings-list-star {
  width: 28px;
  text-align: center;
  color: #c6ccd6;
  font-size: 1.05rem;
}
.settings-list-table .settings-list-star.is-default { color: #f5b400; }
.settings-list-table td.col-actions { width: 44px; text-align: center; }
.link-btn {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.link-btn:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .settings-shell { flex-direction: column; }
  .settings-subnav { width: 100%; flex-direction: row; flex-wrap: wrap; }
}
.page-title { margin: 0 0 1rem; font-size: 1.55rem; }

.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card, .stat-card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card { padding: 1rem 1.1rem; }
.stat-card .label { color: var(--muted); font-size: .85rem; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; margin-top: .25rem; }
.panel { padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.panel h2, .panel h3 { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 8px; padding: .65rem 1rem; cursor: pointer;
  font-weight: 600; background: var(--primary); color: #fff;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn-secondary { background: #44546a; }
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--warning); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-success { background: #16a34a; border-radius: 999px; padding: .6rem 1.15rem; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }
/* .btn { display:inline-flex } nadpisywało atrybut HTML hidden */
.btn[hidden], [hidden] { display: none !important; }
.is-busy { pointer-events: none; opacity: .75; cursor: wait; }
.btn.is-busy {
  position: relative;
  opacity: .85;
}
.btn.is-busy::before {
  content: '';
  width: .85em;
  height: .85em;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bpm-spin .7s linear infinite;
  flex-shrink: 0;
}
.btn-outline.is-busy::before {
  border-color: rgba(47,111,237,.25);
  border-top-color: var(--primary);
}
@keyframes bpm-spin { to { transform: rotate(360deg); } }

.bpm-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}
.bpm-toast {
  pointer-events: auto;
  padding: .75rem 1rem;
  border-radius: 10px;
  background: #1e293b;
  color: #fff;
  box-shadow: 0 8px 24px rgba(15,23,42,.25);
  font-size: .92rem;
  font-weight: 600;
  animation: bpm-toast-in .2s ease-out;
}
.bpm-toast.is-ok { background: #166534; }
.bpm-toast.is-err { background: #991b1b; }
.bpm-toast.is-info { background: #1e40af; }
@keyframes bpm-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: .92rem; }
input, select, textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: .65rem .75rem;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,111,237,.25); border-color: var(--primary); }

.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th, table.data td { padding: .7rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: #f7faff; color: #334155; font-size: .85rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: #e8eef8; color: #27406a;
}
.badge-ok { background: #e5f7ee; color: #176b45; }
.badge-warn { background: #fff2e4; color: #9a5b12; }
.badge-error { background: #fde8e8; color: #9f2424; }
.badge-idle { background: #eef2f7; color: #475569; }

.alert { padding: .85rem 1rem; border-radius: 8px; margin-bottom: .85rem; }
.alert-success { background: #e8f8f0; color: #176b45; border: 1px solid #b7e6cb; }
.alert-error { background: #fdecec; color: #9f2424; border: 1px solid #f0b4b4; }
.alert-warning { background: #fff5e8; color: #9a5b12; border: 1px solid #f0d0a8; }
.alert-info { background: #eaf2ff; color: #1e4b99; border: 1px solid #bfd3f7; }

.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  padding: .55rem .9rem; border-radius: 999px; background: #e8eef8; color: #27406a;
  text-decoration: none; font-weight: 600;
}
.tab.active { background: var(--primary); color: #fff; }

.price-below-cost { color: var(--danger); font-weight: 700; }
.price-below-min { color: var(--danger); }
.price-low-margin { color: var(--warning); }
.price-promo { color: #1d6fd8; }
.price-sync-synced { color: var(--text); }
.price-sync-different { color: var(--danger); }
.price-sync-pending { color: var(--warning); }
.price-sync-error { color: var(--danger); font-weight: 700; }
.price-sync-unknown { color: #7a8699; }
.price-group-cell { margin-bottom: .45rem; }
.lock-icon { color: #7c3aed; margin-left: .25rem; }

.progress {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb 0%, #93c5fd 45%, #60a5fa 70%, #2563eb 100%);
  background-size: 220% 100%;
  transition: width .5s ease;
}
.progress.is-active > span {
  animation: bpm-progress-shine 1.6s linear infinite;
}
.progress.is-done > span {
  background: #16a34a;
  animation: none;
}
.progress-lg { height: 16px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .35rem;
  font-size: .9rem;
}
@keyframes bpm-progress-shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.thumb {
  width: 42px; height: 42px; object-fit: cover; border-radius: 6px; background: #eef2f7;
}
.thumb-placeholder {
  width: 42px; height: 42px; border-radius: 6px; background: #e8eef8; display: inline-block;
}
.settings-check { display: block; margin: .35rem 0; }
.checkbox-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .65rem;
}
.checkbox-list .settings-check { margin: .25rem 0; }
.tag-multiselect {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem;
}
.tag-multiselect-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .4rem;
}
.tag-multiselect-tags:empty { display: none; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #eef2f7;
  color: var(--text);
  border-radius: 999px;
  padding: .25rem .55rem .25rem .7rem;
  font-size: .85rem;
}
.tag-chip.is-fixed { background: #f5f7fa; color: var(--muted); }
.tag-chip-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 .15rem;
}
.tag-chip-remove:hover { color: var(--danger); }
.tag-multiselect select { width: 100%; }
.sync-chip {
  display: inline-block;
  margin: .1rem .25rem .1rem 0;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .8rem;
  background: #eceff4;
  color: #4b5563;
  white-space: nowrap;
}
.sync-chip.is-in { background: #e3f2fd; color: #0b6fa4; }
.sync-chip.is-out { background: #eef6e6; color: #4d7c1f; }

/* —— Lista produktów (kompaktowa, bez poziomego scrolla) —— */
.products-page {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.products-page .page-title { margin-bottom: .65rem; }
.content:has(.products-page) { padding: .85rem 1rem; }

.products-filters.is-compact {
  padding: .5rem .65rem;
  margin-bottom: .55rem;
}
.products-search-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.products-search-field { flex: 1 1 auto; min-width: 0; }
.products-search-mqty {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex: 0 0 auto;
}
.products-search-mqty select,
.products-search-mqty input {
  height: 32px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem .4rem;
}
.products-search-mqty select { max-width: 8.2rem; }
.products-search-mqty input { width: 4.6rem; }
.products-search-field input {
  width: 100%;
  height: 32px;
  padding: .3rem .55rem;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.products-search-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
}
.btn-sm {
  height: 32px;
  padding: .25rem .65rem;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.products-active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  margin-top: .45rem;
}
.products-active-chips-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.adv-filter-badge {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0 .28rem;
  margin-left: .2rem;
  border-radius: 99px;
  background: #2f6fed;
  color: #fff;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
}
#toggleAdvancedFilters.has-active-filters {
  border-color: #9bb6e8;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .4rem;
  font-size: 11px;
  line-height: 1.2;
  background: #eaf1fb;
  color: #27406a;
  border-radius: 4px;
  text-decoration: none;
}
.filter-chip:hover { background: #dce7f8; text-decoration: none; }
.filter-chip-x { font-size: 13px; font-weight: 700; opacity: .7; }

.products-filters-advanced {
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, margin .2s ease, padding .2s ease;
}
.products-filters-advanced.is-open {
  max-height: 4200px;
  opacity: 1;
}
.products-filters-advanced[hidden] {
  display: none !important;
}
.products-filter-groups {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.products-filter-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .85rem;
}
.products-filter-group h4 {
  margin: 0 0 .55rem;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.products-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .55rem .65rem;
}
.products-filter-group .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.products-filter-group .form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.products-filters.is-compact .products-filter-group input,
.products-filters.is-compact .products-filter-group select {
  height: 30px;
  padding: .25rem .4rem;
  font-size: 12px;
  border-radius: 5px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
}
.products-filters.is-compact .form-group { margin-bottom: 0; gap: .12rem; }
.products-filters.is-compact label { font-size: 11px; font-weight: 600; color: var(--muted); }
.products-filters.is-compact input,
.products-filters.is-compact select {
  height: 30px;
  padding: .25rem .4rem;
  font-size: 12px;
  border-radius: 5px;
}
.products-advanced-flags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  margin-top: .55rem;
}
.flag-check {
  font-size: 12px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.products-advanced-actions { margin-top: .55rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.products-filters,
.products-table-panel {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.products-table-panel {
  padding: 0;
  overflow: visible;
}
.products-table-panel.is-compact {
  overflow-x: hidden;
}
.products-table-panel .pagination { padding: .55rem .7rem; margin-top: 0; }
.products-table-wrap {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  direction: ltr;
}
table.data.products-table,
.products-table {
  width: max-content;
  max-width: none;
  table-layout: fixed;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  border-collapse: collapse;
  border-spacing: 0;
  direction: ltr;
}
.products-table th,
.products-table td {
  padding: 5px 6px;
  vertical-align: middle;
  border-bottom: 1px solid #e6edf5;
  line-height: 1.15;
}
.products-table td:not(.col-actions):not(.col-img) {
  overflow: hidden;
}
.products-table td.col-img {
  overflow: visible;
  position: relative;
  z-index: 1;
}
.products-table tbody tr:hover td.col-img {
  z-index: 15;
}
.products-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  background: #f4f7fb;
  font-size: 11px;
  font-weight: 700;
  color: #405066;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.15;
  hyphens: auto;
  box-shadow: 0 1px 0 var(--border);
  vertical-align: bottom;
}
.products-table tbody tr:hover { background: #f7faff; }
.products-table .col-check {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding-left: 8px;
  padding-right: 2px;
  vertical-align: middle;
}
.products-table thead th.col-check {
  position: sticky;
  top: 0;
  z-index: 9;
  background: #f4f7fb;
}
.products-table tbody td.col-check {
  background: #fff;
}
.products-table tbody tr:hover td.col-check { background: #f7faff; }
.products-table tbody tr.product-row-pending td.col-check { background: #f4f6f8; }
.products-table .col-check input[type="checkbox"] {
  margin: 0;
  width: 15px;
  height: 15px;
  vertical-align: middle;
  cursor: pointer;
}
.products-table .col-img {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.products-thumb-wrap {
  position: relative;
  display: inline-block;
  width: var(--thumb-size, 32px);
  height: var(--thumb-size, 32px);
}
.products-thumb-wrap .products-thumb,
.products-thumb-wrap .thumb-placeholder {
  width: var(--thumb-size, 32px);
  height: var(--thumb-size, 32px);
}
.products-thumb-wrap.has-hover:hover .products-thumb {
  position: relative;
  z-index: 12;
}
.product-thumb-preview {
  position: fixed;
  z-index: 80;
  width: var(--thumb-hover, 100px);
  height: var(--thumb-hover, 100px);
  background: #fff center / contain no-repeat;
  border: 1px solid #d9e2ef;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .22);
  pointer-events: none;
}
.product-thumb-preview.is-zoom {
  width: var(--thumb-zoom, 160px);
  height: var(--thumb-zoom, 160px);
}
.products-table .col-product {
  text-align: left;
  overflow: hidden;
}
.products-table col[data-col="product"] {
  width: var(--w-product);
  min-width: var(--w-product-min, 260px);
}
.products-table th[data-col="product"],
.products-table td[data-col="product"] {
  min-width: var(--w-product-min, 260px);
}
.products-table .col-stock { text-align: right; white-space: nowrap; overflow: hidden; }
.products-table .col-price { text-align: right; white-space: nowrap; overflow: hidden; }
.products-table .col-margin { text-align: right; white-space: nowrap; overflow: hidden; }
.products-table .col-profit { text-align: right; white-space: nowrap; overflow: hidden; }
.products-table .col-meta { text-align: left; overflow: hidden; text-overflow: ellipsis; }
.products-table col[data-col="select"],
.products-table [data-col="select"] {
  width: var(--w-select, 36px);
  min-width: var(--w-select, 36px);
  max-width: var(--w-select, 36px);
}
.products-table col[data-col="actions"],
.products-table [data-col="actions"] {
  width: var(--w-actions, 56px);
  min-width: var(--w-actions, 56px);
  max-width: var(--w-actions, 56px);
}
.products-table col[data-col="image"],
.products-table [data-col="image"] { width: var(--w-image); min-width: var(--w-image); max-width: var(--w-image); }
.products-table col[data-col="sku"],
.products-table [data-col="sku"] { width: var(--w-sku); min-width: var(--w-sku); max-width: var(--w-sku); }
.products-table col[data-col="ean"],
.products-table [data-col="ean"] { width: var(--w-ean); min-width: var(--w-ean); max-width: var(--w-ean); }
.products-table col[data-col="manufacturer"],
.products-table [data-col="manufacturer"] { width: var(--w-manufacturer); min-width: var(--w-manufacturer); max-width: var(--w-manufacturer); }
.products-table col[data-col="category"],
.products-table [data-col="category"] { width: var(--w-category); min-width: var(--w-category); max-width: var(--w-category); }
.products-table col[data-col="multiple_qty"],
.products-table [data-col="multiple_qty"] { width: var(--w-multiple_qty); min-width: var(--w-multiple_qty); max-width: var(--w-multiple_qty); }
.products-table col[data-col="stock_supplier"],
.products-table [data-col="stock_supplier"] { width: var(--w-stock_supplier); min-width: var(--w-stock_supplier); max-width: var(--w-stock_supplier); }
.products-table col[data-col="stock_base"],
.products-table [data-col="stock_base"] { width: var(--w-stock_base); min-width: var(--w-stock_base); max-width: var(--w-stock_base); }
.products-table col[data-col="default_price"],
.products-table [data-col="default_price"] { width: var(--w-default_price); min-width: var(--w-default_price); max-width: var(--w-default_price); }
.products-table col[data-col="wholesale"],
.products-table [data-col="wholesale"] { width: var(--w-wholesale); min-width: var(--w-wholesale); max-width: var(--w-wholesale); }
.products-table col[data-col="retail"],
.products-table [data-col="retail"] { width: var(--w-retail); min-width: var(--w-retail); max-width: var(--w-retail); }
.products-table col[data-col="promotion"],
.products-table [data-col="promotion"] { width: var(--w-promotion); min-width: var(--w-promotion); max-width: var(--w-promotion); }
.products-table col[data-col="margin"],
.products-table [data-col="margin"] { width: var(--w-margin); min-width: var(--w-margin); max-width: var(--w-margin); }
.products-table col[data-col="profit"],
.products-table [data-col="profit"] { width: var(--w-profit); min-width: var(--w-profit); max-width: var(--w-profit); }
.products-table col[data-col="base_id"],
.products-table [data-col="base_id"] { width: var(--w-base_id); min-width: var(--w-base_id); max-width: var(--w-base_id); }
.products-table col[data-col="product_kind"],
.products-table [data-col="product_kind"] { width: var(--w-product_kind); min-width: var(--w-product_kind); max-width: var(--w-product_kind); }
.products-table col[data-col="base_status"],
.products-table [data-col="base_status"] { width: var(--w-base_status); min-width: var(--w-base_status); max-width: var(--w-base_status); }
.products-table-wrap.has-custom-widths {
  overflow-x: hidden;
  max-width: 100%;
}
.products-table th.is-resizable,
.products-table th.has-col-resize {
  position: relative;
  overflow: visible;
}
.products-table th .col-resize {
  position: absolute;
  left: -4px;
  right: auto;
  top: 0;
  width: 8px;
  height: 100%;
  z-index: 6;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  background: transparent;
}
.products-table th .col-resize::after { display: none; content: none; }
body.is-col-resizing { cursor: col-resize; user-select: none; }
.column-prefs-grid,
.column-prefs-list {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  margin-bottom: .75rem;
  max-width: 520px;
}
.column-pref-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 12px;
  padding: .2rem .35rem;
  border: 1px solid #e6edf5;
  border-radius: 6px;
  background: #fff;
  cursor: grab;
}
.column-pref-row.is-dragging { opacity: .55; }
.column-pref-handle { color: #94a3b8; letter-spacing: -2px; cursor: grab; }
.column-pref-check { display: flex; align-items: center; gap: .35rem; flex: 1; min-width: 0; cursor: pointer; }
.column-pref-label { flex: 1; min-width: 0; }
.column-pref-width {
  width: 4.6rem;
  padding: .15rem .3rem;
}
.column-prefs-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.products-table .col-actions {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
}
.products-table td.col-actions { overflow: visible; }
.products-table thead th.col-actions {
  position: sticky;
  top: 0;
  z-index: 9;
  background: #f4f7fb;
}
.products-table tbody td.col-actions { background: #fff; }
.products-table tbody tr:hover td.col-actions { background: #f7faff; }
.products-table tbody tr.product-row-pending td.col-actions { background: #f4f6f8; }
.products-thumb,
.products-table .thumb,
.products-table .thumb-placeholder {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: #f3f6fa;
  border-radius: 3px;
  display: inline-block;
}
.product-name-link {
  color: var(--text);
  font-weight: 650;
  font-size: 12.5px;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}
.product-name-link:hover { color: var(--primary); text-decoration: underline; }
.product-meta {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-until { font-size: 10px; color: #1d6fd8; white-space: nowrap; }
.stock-diff { color: var(--warning); }
.stock-error { color: var(--danger); }
.val-warn { color: var(--warning); }
.val-neg { color: var(--danger); font-weight: 650; }
.price-editable { cursor: default; }
.row-actions { display: inline-flex; align-items: center; justify-content: center; gap: .1rem; }
.inline-action { display: inline; margin: 0; }
.icon-btn {
  border: 0;
  background: transparent;
  color: #44546a;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.icon-btn:hover { background: #e8eef8; color: var(--primary); text-decoration: none; }
.more-menu { position: relative; display: inline-flex; }
.more-dropdown {
  position: fixed;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 16px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
  padding: .25rem;
  text-align: left;
}
.more-dropdown[hidden] { display: none !important; }
.more-dropdown button,
.more-dropdown a {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: .45rem .55rem;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
}
.more-dropdown button:hover,
.more-dropdown a:hover { background: #f3f7fd; }

@media (max-width: 1500px) {
  .products-advanced-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .products-search-bar { flex-wrap: wrap; }
  .products-search-actions { width: 100%; }
  .products-advanced-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .products-table-wrap,
  .products-table-wrap.has-custom-widths,
  .products-table-panel.is-compact {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .products-table thead th { top: 0; }
}
@media (max-width: 900px) {
  .products-advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products-table thead th { top: 0; }
}
@media (max-width: 640px) {
  .products-advanced-grid { grid-template-columns: 1fr 1fr; }
}

.pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination a, .pagination span {
  padding: .4rem .7rem; border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-actions { white-space: nowrap; }

.sync-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #eaf2ff; color: #1e4b99; padding: .35rem .7rem; border-radius: 999px; font-size: .85rem;
}
.menu-toggle { display: none; background: var(--sidebar); color: #fff; border: 0; padding: .55rem .8rem; border-radius: 8px; }

.guest-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(circle at top right, #d7e6ff, transparent 40%), linear-gradient(160deg, #0f1c2e, #1b3358 55%, #2f6fed);
}
.guest-card {
  width: min(420px, calc(100% - 2rem));
  background: #fff; border-radius: 16px; padding: 2rem; box-shadow: var(--shadow);
}
.install-wrap { max-width: 960px; margin: 2rem auto; padding: 0 1rem; }
.check-ok { color: var(--success); font-weight: 700; }
.check-warn { color: var(--warning); font-weight: 700; }
.check-error { color: var(--danger); font-weight: 700; }
.tile { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.tile.disabled { opacity: .65; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; margin-bottom: 1rem; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,28,46,.45); display: none; place-items: center; z-index: 50;
  padding: 1rem;
}
.modal-backdrop.open,
.modal-backdrop:not([hidden]) { display: grid; }
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(480px, calc(100% - 2rem)); background: #fff; border-radius: 12px; padding: 1.25rem; box-shadow: var(--shadow);
  max-height: calc(100vh - 2rem); overflow-y: auto;
}
/* Modal katalogu (Ustawienia produktów → Katalogi) — szerszy, tabela ról mieści się w oknie */
.inventory-modal { width: min(680px, calc(100% - 2rem)); }
.inventory-modal .inv-role-select { width: 100%; min-width: 0; }

/* —— Modal historii produktu (styl Base) —— */
.history-modal-backdrop { z-index: 80; align-items: start; padding-top: 4vh; }
.history-modal {
  width: min(920px, calc(100vw - 2rem));
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.history-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.history-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.history-modal-close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #667788;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.history-modal-close:hover { background: #eef2f7; color: var(--text); }

/* —— Modal edycji produktu (otwierany z listy Produkty/Zestawy) —— */
.product-edit-modal-backdrop { padding-top: 2vh; }
.product-edit-modal {
  width: min(1400px, calc(100vw - 2rem));
  max-height: min(94vh, 1200px);
}
.product-edit-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.1rem;
}
.product-edit-modal-body .product-card { margin: 0; }
@media (max-width: 640px) {
  .product-edit-modal-backdrop { padding: 0; }
  .product-edit-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}
.history-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
}
.history-tab {
  border: 0;
  background: transparent;
  padding: .75rem .85rem;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.history-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 650;
}
.history-modal-info {
  margin: .75rem 1rem 0;
  padding: .65rem .8rem;
  border: 1px solid #b7d4f5;
  background: #eef6ff;
  color: #1e4b80;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.4;
}
.history-modal-toolbar { padding: .75rem 1rem 0; }
.history-search-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .55rem .7rem;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  user-select: none;
}
.history-search-toggle:hover { background: #f7faff; }
.history-search-icon { color: var(--muted); }
.history-search-chevron { margin-left: auto; color: var(--muted); }
.history-search-panel {
  margin-top: .55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .65rem;
  background: #fafbfd;
}
.history-search-panel[hidden] { display: none !important; }
.history-search-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: .55rem;
}
.history-search-grid .form-group { margin: 0; }
.history-search-grid span { font-size: 11px; color: var(--muted); font-weight: 600; }
.history-search-grid input,
.history-search-grid select {
  height: 32px;
  padding: .3rem .45rem;
  font-size: 12.5px;
}
.history-logs {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: .75rem 1rem 0;
}
.history-logs-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: .45rem;
}
.history-table-wrap {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 46vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.history-table th {
  position: sticky;
  top: 0;
  background: #f4f7fb;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #516074;
  padding: .5rem .65rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.history-table td {
  padding: .55rem .65rem;
  border-bottom: 1px solid #e8eef5;
  vertical-align: top;
}
.history-table .col-event { width: 32%; }
.history-table .col-info { width: 34%; }
.history-table .col-profile { width: 14%; }
.history-table .col-time { width: 20%; white-space: nowrap; }
.history-row { cursor: pointer; }
.history-row:hover { background: #f7faff; }
.history-row.is-open { background: #f3f7fd; }
.history-event-main {
  display: inline-flex;
  align-items: flex-start;
  gap: .4rem;
  font-weight: 650;
}
.history-chevron {
  display: inline-block;
  width: 1em;
  color: var(--muted);
  transition: transform .15s ease;
}
.history-row.is-open .history-chevron { transform: rotate(90deg); color: var(--primary); }
.history-details {
  margin-top: .35rem;
  padding-left: 1.25rem;
  display: none;
}
.history-row.is-open .history-details { display: block; }
.history-detail-line {
  font-size: 12px;
  color: #334155;
  padding: .15rem 0;
  font-variant-numeric: tabular-nums;
}
.history-detail-line .arrow { color: var(--muted); margin: 0 .25rem; }
.history-detail-line .after { color: #0f6b3c; font-weight: 600; }
.history-detail-line .before { color: #6b7280; }
.history-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .4rem;
  padding: .55rem 0 .2rem;
  font-size: 12px;
  color: var(--muted);
}
.history-pagination button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  min-width: 30px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
}
.history-pagination button.is-current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.history-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .85rem 1.1rem;
  border-top: 1px solid var(--border);
  margin-top: .55rem;
}
.more-dropdown .js-product-history {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: .45rem .55rem;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
}
.more-dropdown .js-product-history:hover { background: #f3f7fd; }

/* —— Karta produktu (kompaktowa) —— */
.product-card { max-width: 100%; }
.product-card-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .65rem;
}
.product-card-title-wrap { display: flex; gap: .65rem; align-items: flex-start; min-width: 0; }
.product-card-thumb {
  width: 48px; height: 48px; object-fit: contain;
  background: #f3f6fa; border-radius: 6px; flex: 0 0 auto;
}
.product-card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}
.product-card-submeta {
  display: flex; flex-wrap: wrap; gap: .35rem .85rem;
  margin-top: .2rem; font-size: 11px; color: var(--muted);
}
.product-card-head-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.product-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: .65rem;
}
.product-card-panel {
  padding: .7rem .8rem;
  margin-bottom: .65rem;
}
.product-card-panel h2 {
  margin: 0 0 .45rem;
  font-size: 13.5px;
  font-weight: 700;
}
.product-card-panel h3 {
  margin: .55rem 0 .35rem;
  font-size: 12px;
  font-weight: 700;
  color: #405066;
}
.pc-section-head {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  margin-bottom: .35rem;
}
.pc-section-head h2 { margin: 0; }
.pc-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .75rem;
  font-size: 12.5px;
}
.pc-kv-grid .pc-full { grid-column: 1 / -1; }
.pc-label {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: .05rem;
}
.pc-value { color: var(--text); line-height: 1.25; }
.pc-auto-block {
  margin-top: .65rem;
  padding-top: .55rem;
  border-top: 1px solid var(--border);
}
.pc-switch {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 12.5px;
  margin: .25rem 0;
  cursor: pointer;
}
.pc-save-hint {
  font-size: 11px;
  color: var(--success);
  font-weight: 650;
}
.pc-lock-line { margin-top: .35rem; }
.product-card-table { font-size: 12px; }
.product-card-table th,
.product-card-table td {
  padding: .3rem .4rem;
  font-size: 12px;
}
.pc-price-display {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  padding: .1rem .15rem;
  border-radius: 3px;
  display: inline-block;
}
.pc-price-display:hover {
  border-bottom-color: var(--primary);
  background: #f3f7ff;
}
.js-expected-gross-cell {
  position: relative;
  white-space: nowrap;
}
.pc-inline-price-edit {
  display: none;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  align-items: center;
  gap: .35rem;
  padding: .45rem .5rem;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(20, 40, 80, .14);
}
.pc-inline-price-edit.is-open,
.pc-inline-price-edit:not([hidden]) {
  display: inline-flex;
}
.pc-inline-price-edit[hidden] {
  display: none !important;
}
.pc-inline-price-field {
  position: relative;
  display: block;
  margin: 0;
}
.pc-inline-price-label {
  position: absolute;
  left: .55rem;
  top: -.55rem;
  padding: 0 .25rem;
  background: #fff;
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
  pointer-events: none;
}
.pc-inline-price-input {
  width: 6.2rem;
  height: 34px;
  padding: .25rem .55rem;
  font-size: 13px;
  border: 1px solid #5b8def;
  border-radius: 4px;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(91, 141, 239, .15);
}
.pc-inline-price-ok,
.pc-inline-price-cancel {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #cfd6e2;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  color: #222;
}
.pc-inline-price-ok:hover,
.pc-inline-price-cancel:hover {
  background: #f4f7fb;
}
.pc-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.pc-rule-form {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .85rem 1rem 1rem;
  background: #fafbfd;
}
.pc-rule-form h3 {
  margin: 0 0 .65rem;
  font-size: 13px;
}
.products-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .65rem;
  padding: .55rem .75rem;
}
.products-bulk-left {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
}
.products-ops-dropdown {
  min-width: 180px;
}
.products-ops-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: .45rem .65rem;
  cursor: pointer;
  font-size: 12.5px;
}
.products-ops-dropdown button:hover {
  background: #f0f4fa;
}
.col-check {
  width: 28px;
  text-align: center;
}
@media (max-width: 900px) {
  .pc-rules-grid { grid-template-columns: 1fr; }
}
.pc-history-tabs {
  display: flex;
  gap: .15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .55rem;
}
.pc-history-tab {
  border: 0;
  background: transparent;
  padding: .4rem .65rem;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.pc-history-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 650;
}
.pc-history-content { min-height: 80px; }
.history-panel-pagination {
  display: flex; gap: .3rem; align-items: center; flex-wrap: wrap;
  margin-top: .45rem;
}
.history-page-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 5px;
  min-width: 28px;
  height: 26px;
  font-size: 11px;
  cursor: pointer;
}
.history-page-btn.is-current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pc-edit-modal { width: min(420px, calc(100vw - 2rem)); padding: 0; }
.pc-edit-form { padding: .85rem 1rem 1rem; }
.pc-edit-form .form-group { margin-bottom: .65rem; }
.pc-edit-form input,
.pc-edit-form select {
  height: 32px;
  padding: .3rem .45rem;
  font-size: 12.5px;
}
.pc-edit-actions {
  display: flex; justify-content: flex-end; gap: .4rem; margin-top: .75rem;
}
.search-select { position: relative; }
.search-select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.search-select-toggle {
  width: 100%;
  height: 32px;
  padding: .3rem 1.7rem .3rem .5rem;
  font-size: 12.5px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right .55rem center;
  cursor: pointer;
  color: inherit;
}
.search-select-toggle.is-empty { color: #64748b; }
.search-select.is-open .search-select-toggle { border-color: var(--primary, #2f6fed); }
.search-select-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 28, 46, .12);
  overflow: hidden;
}
.search-select-q {
  width: 100% !important;
  height: 32px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: .35rem .6rem !important;
  font-size: 12.5px !important;
}
.search-select-list {
  list-style: none;
  margin: 0;
  padding: .2rem 0;
  max-height: 220px;
  overflow-y: auto;
}
.search-select-option {
  padding: .4rem .65rem;
  font-size: 12.5px;
  cursor: pointer;
}
.search-select-option:hover,
.search-select-option.is-selected { background: #eef4ff; }
.search-select-empty {
  padding: .5rem .65rem;
  font-size: 12px;
  color: #64748b;
}
@media (max-width: 900px) {
  .product-card-grid { grid-template-columns: 1fr; }
  .pc-kv-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: -280px;
    transition: left .2s ease;
    z-index: 40;
    flex: none;
  }
  .sidebar.open { left: 0; }
  .main { flex: 1 1 100%; width: 100%; max-width: 100%; }
  .menu-toggle { display: inline-flex; }
  .grid-3, .grid-2, .form-grid, .filters { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

.alert-pending-indexes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.alert-pending-indexes-text {
  color: inherit;
  text-decoration: none;
  flex: 1 1 16rem;
}
.alert-pending-indexes-text:hover {
  text-decoration: underline;
}
.products-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1rem;
}
.products-status-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: .4rem .75rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  text-decoration: none;
  font-weight: 700;
  font-size: .85rem;
  border: 1px solid transparent;
}
.status-pill:hover { border-color: #94a3b8; }
.status-pill.is-current { border-color: var(--primary); background: #e8f0ff; }
.status-pill.is-up { background: #fde8e8; color: #9f2424; }
.status-pill.is-down { background: #e5f7ee; color: #176b45; }
.status-pill.is-pending-price { background: #fff7ed; color: #c2410c; }
.status-pill.is-stock { background: #fff2e4; color: #9a5b12; }
.status-pill.is-sets { background: #ede9fe; color: #5b21b6; }
.products-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  align-items: end;
  margin: .65rem 0;
}
.products-quick-filter {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 600;
}
.products-quick-filter select {
  min-width: 11rem;
  font-weight: 600;
}
.product-row-pending {
  background: #f4f6f8;
  color: #64748b;
}
.product-row-pending .product-name-link { color: #64748b; font-weight: 600; }
.product-row-inactive { opacity: .88; }
.product-badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.badge-price-up { background: #fde8e8; color: #9f2424; }
.badge-price-down { background: #e5f7ee; color: #176b45; }
.badge-price-pending { background: #fff7ed; color: #c2410c; }
.badge-set { background: #ede9fe; color: #5b21b6; }
.badge-set-base { background: #e0e7ff; color: #3730a3; }
.product-price-delta { white-space: nowrap; }

.tools-sync-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  padding: .9rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.tools-sync-banner.is-active { background: #ecfdf3; border-color: #86efac; }
.tools-sync-banner.is-paused { background: #fff7ed; border-color: #fdba74; }
.tools-sync-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tools-order { margin: .4rem 0 0 1.1rem; line-height: 1.8; }
.tools-steps { display: flex; flex-direction: column; gap: .35rem; }
.tools-step { position: relative; }
.tools-step-num {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: .35rem;
}
.tools-arrow { text-align: center; color: var(--muted); font-size: 1.25rem; line-height: 1; }
.tools-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .65rem 1rem;
  margin: .75rem 0;
}
.pc-wholesale-chart-slot {
  min-height: 0;
  margin-bottom: .65rem;
}
.pc-history-chart {
  margin: 0 0 1rem;
  padding: .75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pc-history-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .65rem;
}
.pc-history-chart-toolbar .js-history-range.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pc-history-canvas {
  width: 100%;
  max-width: 100%;
  display: block;
  background: #fff;
  border-radius: 6px;
}
.pc-history-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .35rem .75rem;
  margin-bottom: .65rem;
  font-size: .85rem;
}
.badge-promo {
  background: #fef3c7;
  color: #92400e;
}
.pc-wholesale-summary {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: .7rem;
  padding: .55rem .7rem;
  background: #f8fafc;
  border-radius: 6px;
}
.pc-wholesale-summary-main strong { display: block; margin-top: .15rem; }

.schedule-toggles-panel { margin-bottom: 1rem; }
.schedule-toggles-title { margin-top: 0; }
.schedule-toggles-grid { display: flex; flex-direction: column; gap: .65rem; }
.schedule-toggle-row {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin: 0;
  padding: .85rem 1rem 1rem;
  border: 1px solid var(--border, #d9e2ef);
  border-radius: 10px;
  background: #fff;
}
.schedule-toggle-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 21.5rem;
  gap: .75rem 1rem;
  align-items: center;
}
.schedule-toggle-controls {
  display: grid;
  grid-template-columns: 5.75rem 14.5rem;
  gap: .65rem;
  align-items: center;
  justify-self: end;
  width: 21.5rem;
}
.sched-fold {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.sched-fold-icon,
.sched-fold-icon::before {
  display: block;
}
.sched-fold-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #334155;
  transform: translate(-50%, -40%);
}
.schedule-toggle-row.is-open .sched-fold-icon::before {
  transform: translate(-50%, -60%) rotate(180deg);
}
.sched-fold-title {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.sched-fold-title:hover strong { text-decoration: underline; }
.sched-cal-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-left: 132px;
}
.sched-save-msg {
  font-size: 12px;
  font-weight: 600;
  color: #166534;
}
.schedule-state-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: .28rem .55rem;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-state-btn:disabled,
.schedule-state-btn.is-static {
  cursor: default;
  opacity: .9;
}
.schedule-state-btn:not(:disabled):not(.is-static):hover {
  border-color: #0f766e;
  color: #0f766e;
}
.sync-health-minis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .65rem;
  margin: 0 0 1rem;
}
.sync-health-card {
  text-align: left;
  border: 1px solid var(--border, #d9e2ef);
  border-radius: 10px;
  background: #fff;
  padding: .7rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  cursor: pointer;
}
.sync-health-card strong { font-size: 13px; }
.sync-manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.sync-job-modal {
  max-width: 520px;
  width: calc(100% - 2rem);
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1.25rem;
}
.sync-job-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem .85rem;
  margin: 0;
}
.sync-job-dl div { margin: 0; }
.sync-job-dl dt { font-size: 11px; color: #64748b; }
.sync-job-dl dd { margin: .1rem 0 0; font-weight: 600; }
.schedule-toggle-row.is-on { border-color: #86efac; background: #f0fdf4; }
.schedule-toggle-copy { display: flex; flex-direction: column; gap: .15rem; }
.sched-switch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  user-select: none;
  width: 5.75rem;
  min-width: 5.75rem;
}
.sched-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sched-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #94a3b8;
  flex-shrink: 0;
  transition: background .15s;
}
.sched-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: transform .15s;
}
.sched-switch input:checked + .sched-track { background: #16a34a; }
.sched-switch input:checked + .sched-track::after { transform: translateX(24px); }
.sched-state { font-weight: 800; font-size: 13px; min-width: 2.2rem; }
.schedule-toggle-row.is-off .sched-state { color: #64748b; }
.schedule-toggle-row.is-on .sched-state { color: #166534; }
.schedule-hours {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: 12px;
  color: #475569;
}
.schedule-hours input {
  width: 72px;
  padding: .35rem .4rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
.sched-cal {
  border-top: 1px solid #e2e8f0;
  padding-top: .9rem;
  display: none;
  flex-direction: column;
  gap: 1.1rem;
}
.schedule-toggle-row.is-open .sched-cal { display: flex; }
.schedule-toggle-row.is-off .sched-cal { opacity: .72; }
.sched-cal-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: .85rem 1.1rem;
  align-items: start;
}
.sched-cal-label {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  color: #334155;
  padding-top: .2rem;
}
.sched-all {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 .5rem;
}
.sched-days,
.sched-clock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem .85rem;
}
.sched-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 13px;
  color: #0f172a;
  min-height: 1.5rem;
}
.sched-check input,
.sched-all input {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
}
.sched-cal-help {
  margin: .5rem 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
@media (max-width: 800px) {
  .schedule-toggle-head {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .schedule-toggle-controls {
    grid-column: 2;
    justify-self: start;
  }
  .schedule-hours { grid-column: 1 / -1; }
  .sched-cal-row { grid-template-columns: 1fr; }
  .sched-cal-label { text-align: left; }
  .sched-cal-actions { padding-left: 0; }
  .sched-days,
  .sched-clock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sync-job-dl { grid-template-columns: 1fr; }
}

.int-list { background: var(--card, #fff); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); overflow: hidden; margin-top: 1rem; }
.int-list-head { display: flex; justify-content: space-between; align-items: center; background: #0077d9; color: #fff; padding: .9rem 1rem; font-size: 1.05rem; }
.int-table { width: 100%; border-collapse: collapse; }
.int-table th { text-align: left; font-size: .72rem; text-transform: uppercase; color: #555; padding: 1rem .75rem .6rem; font-weight: 500; }
.int-table td { padding: .6rem .75rem; border-top: 1px solid #e5e7eb; vertical-align: middle; }
.int-logo { display: inline-block; padding: .2rem .55rem; border-radius: 4px; color: #fff; font-size: .8rem; font-weight: 600; background: #2c5aa0; }
.int-logo.is-ftp { background: #6a9a3a; }
.int-block { display: inline-block; padding: .15rem .5rem; margin: .12rem .2rem .12rem 0; border-radius: 3px; color: #fff; font-size: .8rem; }
.int-block.on { background: #16704a; }
.int-block.off { background: #a5adb5; }
.int-actions { text-align: right; white-space: nowrap; }

.int-modal-backdrop { padding: .5rem; }
.int-modal { width: calc(100vw - 1rem); height: calc(100vh - 1rem); background: #fff; border-radius: 8px; padding: 1rem 1.5rem 1.5rem; overflow-y: auto; box-shadow: var(--shadow); }
.int-modal-head { display: flex; justify-content: space-between; align-items: center; }
.int-modal-head h2 { margin: 0; font-size: 1.1rem; }
.int-close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #444; }
.int-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 1rem 0; flex-wrap: wrap; }
.int-tabs button { background: none; border: 1px solid transparent; border-bottom: 0; padding: .8rem 1.4rem; cursor: pointer; font-size: .95rem; color: #444; position: relative; }
.int-tabs button.active { border-color: var(--border); background: #fff; color: #111; margin-bottom: -1px; }
.int-tabs button.active::after { content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 0; height: 2px; background: #0077d9; }
.int-pane { display: none; max-width: 1100px; }
.int-pane.active { display: block; }
.int-pane h3 { margin: 1.5rem 0 .5rem; }
.int-lead { color: #555; font-size: .9rem; margin: 0 0 1rem; }
.int-cols { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.6fr); gap: 2rem; align-items: start; }
.int-box { background: #f6f7f8; border: 1px solid var(--border); border-radius: 6px; padding: 1rem; }
.int-row { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; margin-bottom: .8rem; }
.int-row > label { text-align: right; font-size: .82rem; color: #444; padding-top: .55rem; }
.int-row input:not([type=checkbox]):not([type=radio]), .int-row select { width: 100%; }
.int-hint { font-size: .8rem; color: #666; margin-top: .25rem; }
.int-check { display: inline-flex; gap: .4rem; align-items: center; padding-top: .45rem; font-size: .9rem; }
.int-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.int-result { font-size: .8rem; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.int-result:empty { display: none; }
.int-savebar { display: flex; justify-content: center; gap: .5rem; margin-top: 1.5rem; }
.int-savebar .btn-primary { border-radius: 999px; background: #0077d9; color: #fff; border: 0; padding: .7rem 2rem; cursor: pointer; }
@media (max-width: 800px) { .int-cols { grid-template-columns: 1fr; } .int-row { grid-template-columns: 1fr; } .int-row > label { text-align: left; padding-top: 0; } }
.int-pane { max-width: none; }
.int-pane.active { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; align-content: start; }
.int-pane > *:not(.int-row) { grid-column: 1 / -1; }
.int-cols { grid-template-columns: 1fr 1fr; }
.int-status { margin-top: 1rem; padding: .8rem 1rem; border-radius: 6px; }
.int-status[hidden] { display: none; }
.int-status.is-ok { background: #16a34a; color: #fff; }
.int-status.is-err { background: #dc2626; color: #fff; }
.int-status strong { font-size: 1rem; }
.int-status dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: .6rem 0 0; font-size: .85rem; }
.int-status dt { opacity: .85; }
.int-status dd { margin: 0; }
.int-status-msg { margin-top: .3rem; font-size: .85rem; opacity: .95; }
@media (max-width: 900px) { .int-pane.active, .int-cols { grid-template-columns: 1fr; } }

.int-files { margin-top: .5rem; }
.int-files ul { columns: 2; margin: .3rem 0 0; padding-left: 1.2rem; }
.int-files-title { font-size: .85rem; color: #555; }
.int-preview-backdrop { z-index: 90; }
.int-preview { width: min(1100px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); overflow: auto; background: #fff; border-radius: 8px; padding: 1rem 1.5rem 1.5rem; box-shadow: var(--shadow); }
.int-scroll { overflow-x: auto; }
.int-used { margin: 0 0 .5rem; padding-left: 1.2rem; }
.int-colname { font-weight: 400; color: #666; text-transform: none; }
.int-role { display: inline-block; margin-top: .2rem; background: #16704a; color: #fff; padding: 0 .4rem; border-radius: 3px; font-size: .7rem; text-transform: none; }
.int-table th.is-used, .int-table td.is-used { background: #eaf6ee; }

.int-search { max-width: 900px; margin: 1rem auto 1.5rem; }
.int-search input { width: 100%; padding: .9rem 1rem; border: 1px solid #0077d9; border-radius: 4px; }
.int-cat { max-width: 1100px; margin: 1.5rem auto; }
.int-cat h3 { margin: 0 0 .8rem; font-size: 1.1rem; }
.int-tiles { display: flex; flex-wrap: wrap; gap: 1rem; }
.int-tile { width: 140px; height: 140px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; position: relative; display: grid; place-items: center; padding: .5rem; }
.int-tile:hover { border-color: #0077d9; box-shadow: 0 0 0 1px #0077d9; }
.int-tile[hidden] { display: none; }
.int-tile-logo { font-weight: 800; font-size: 1.1rem; letter-spacing: .02em; text-align: center; color: #c8102e; font-style: italic; }
.int-tile-logo.is-base { color: #0077d9; font-style: normal; }
.int-tile-badge { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: .7rem; color: #16704a; }
/* APP-035: kafelek nieaktywny (np. Allegro dev już skonfigurowane / Allegro przed Allegro dev) */
.int-tile.is-disabled { cursor: not-allowed; opacity: .55; background: #f8fafc; }
.int-tile.is-disabled:hover { border-color: var(--border); box-shadow: none; }
.int-tile-badge.is-off { color: #64748b; padding: 0 .3rem; line-height: 1.2; }
.int-logo.is-base { background: #0077d9; }
.int-hint { overflow-wrap: anywhere; }

.btn-danger-outline { color: #b91c1c; border-color: #fca5a5; margin-left: .4rem; }
.btn-danger-outline:hover { background: #fef2f2; }

.int-nowrap { white-space: nowrap; }
.int-tabs button:disabled { opacity: .45; cursor: not-allowed; }

.imp-tabs { display: flex; gap: 2rem; background: #fff; padding: .9rem 1.5rem 0; margin: -1rem -1rem 1.2rem; border-bottom: 1px solid var(--border); }
.imp-tabs span { padding-bottom: .8rem; font-size: 1rem; }
.imp-tabs span.active { border-bottom: 2px solid #0077d9; }
.imp-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); overflow: hidden; }
.imp-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; background: #fafafa; border-bottom: 1px solid var(--border); }
.imp-head h2 { margin: 0; font-size: 1.25rem; }
.imp-src { margin-left: .5rem; }
.imp-status { display: inline-block; padding: .15rem .6rem; border-radius: 4px; color: #fff; font-size: .8rem; font-weight: 600; background: #a5adb5; }
.imp-status.is-ok { background: #16704a; }
.imp-status.is-run { background: #0077d9; }
.imp-status.is-warn { background: #d97706; }
.imp-status.is-err { background: #dc2626; }
.imp-modal { width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; background: #fff; border-radius: 8px; padding: 1rem 1.5rem 1.5rem; box-shadow: var(--shadow); }
.imp-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: .6rem .8rem; border-radius: 6px; font-size: .85rem; margin-top: .5rem; }
.imp-menu-wrap { position: relative; }
.imp-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; background: #fff; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.22); padding: .4rem 0; z-index: 40; }
.imp-menu[hidden] { display: none; }
.imp-menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .7rem 1.2rem; font-size: 1rem; cursor: pointer; color: #222; }
.imp-menu-item:hover:not(:disabled) { background: #f0f6ff; }
.imp-menu-item:disabled { color: #aaa; cursor: not-allowed; }
.imp-card { overflow: visible; }
.imp-head { border-radius: 8px 8px 0 0; }

.imp-modal { width: 50vw; min-width: 640px; max-width: 960px; }
.imp-modal.imp-modal-small { width: min(760px, calc(100vw - 2rem)); min-width: 0; }
.imp-form { margin-top: 1rem; }
.imp-form textarea, .int-row textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; resize: vertical; }
.imp-details { border: 1px solid var(--border); border-radius: 8px; margin: .8rem 0; background: #fafafa; }
.imp-details > summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; }
.imp-details-body { padding: .2rem 1rem 1rem; display: grid; gap: .1rem; }
.imp-details-body .int-check { padding-top: .3rem; }
.imp-details-body .imp-all { border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: .3rem; font-weight: 600; }
.imp-select-block { margin-top: .8rem; display: grid; gap: .3rem; }
.imp-select-block label { font-size: .85rem; color: #444; }
.imp-footer { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.imp-footer .btn-primary { border-radius: 999px; background: #0077d9; color: #fff; border: 0; padding: .7rem 1.8rem; cursor: pointer; }
.imp-footer .btn-primary:disabled { background: #9cc7ee; cursor: not-allowed; }
.imp-warn { line-height: 1.45; }
@media (max-width: 1024px) {
  .imp-modal { width: calc(100vw - 1rem); min-width: 0; max-width: none; }
  .int-modal-backdrop .imp-modal { max-height: calc(100vh - 1rem); }
}
.imp-back { padding-bottom: .8rem; color: #0077d9; text-decoration: none; }
.imp-detail-body { padding: 1rem 1.2rem; }
.imp-dl { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: .55rem 1.5rem; margin: 0; }
.imp-dl dt { color: #555; font-size: .9rem; }
.imp-dl dd { margin: 0; overflow-wrap: anywhere; }
.imp-ids { width: 100%; margin-top: .3rem; padding: .5rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #f7f7f7; }
.imp-list { margin: 0; padding-left: 1.1rem; }
@media (max-width: 700px) { .imp-dl { grid-template-columns: 1fr; gap: .1rem; } .imp-dl dd { margin-bottom: .6rem; } }

/* APP-032: kartoteka — nazwa i opisy per język katalogu */
.pt-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.pt-head h2 { margin: 0; }
.pt-langs { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.pt-lang-btn { border: 0; border-right: 1px solid var(--border); background: transparent; color: var(--text); padding: .3rem .7rem; font: inherit; font-weight: 600; cursor: pointer; min-width: 2.6rem; }
.pt-lang-btn:last-child { border-right: 0; }
.pt-lang-btn:hover { background: rgba(0, 0, 0, .04); }
.pt-lang-btn.is-active { background: var(--primary); color: #fff; }
.pt-form { margin-top: .75rem; }
.pt-form input[type="text"], .pt-form textarea { width: 100%; box-sizing: border-box; font: inherit; }
.pt-form textarea { resize: vertical; }
.pt-form label .badge { margin-left: .35rem; font-weight: 400; }
.pt-extras { margin: .25rem 0 .75rem; }
.pt-extras summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }
.pt-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pt-push { margin-top: .6rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 6px; }
.pt-panel [data-pt-error] { color: var(--danger); margin: .25rem 0 .5rem; }
.pt-panel.is-loading .pt-form { opacity: .55; pointer-events: none; }
/* Moduł ChatGPT: „Tłumacz” / „Generuj” przy polach nazwy i opisu */
.pt-field-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .35rem; }
.pt-field-head label { margin: 0; }
.pt-ai-tools { display: inline-flex; gap: .35rem; }
.pt-ai-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--primary); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s; }
.pt-ai-btn:hover:not(:disabled) { background: rgba(37, 99, 235, .08); border-color: var(--primary); }
.pt-ai-btn-gen { color: #7c3aed; }
.pt-ai-btn-gen:hover:not(:disabled) { background: rgba(124, 58, 237, .08); border-color: #7c3aed; }
.pt-ai-btn:disabled { opacity: .5; cursor: default; }
.pt-ai-btn.is-busy { opacity: 1; }
.pt-ai-btn.is-busy svg { animation: pt-ai-spin 1s linear infinite; }
@keyframes pt-ai-spin { to { transform: rotate(360deg); } }
/* Moduł ChatGPT: sekcja „Zdjęcia” — „Utwórz przez AI” */
.gi-thumb { position: relative; display: inline-block; line-height: 0; }
.gi-thumb-badge { position: absolute; top: 4px; left: 4px; padding: 1px 5px; border-radius: 4px; background: #7c3aed; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 1.4; }
.gi-thumb-new img { box-shadow: 0 0 0 3px rgba(124, 58, 237, .35); }
.gi-push { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.gi-push[hidden] { display: none; }
.gi-box { margin-top: .75rem; padding: .75rem; border: 1px dashed #c4b5fd; border-radius: 8px; background: rgba(124, 58, 237, .03); }
.gi-box textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; margin-top: .2rem; }
.gi-row { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
.gi-row label { display: flex; flex-direction: column; gap: .15rem; }
.gi-result { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }
.gi-result[hidden] { display: none; }
.gi-result img { width: 180px; height: 180px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.gi-result-actions { display: flex; flex-direction: column; gap: .4rem; }
.pt-form .pt-ai-filled { box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); transition: box-shadow .3s; }
