:root {
  --navy: #1F2241;
  --navy-2: #2A2D52;
  --orange: #FFB142;
  --orange-2: #FFC23A;
  --bg: #F4F4F8;
  --card: #ffffff;
  --line: #ECEAF2;
  --muted: #767696;
  --text: #1F2241;
  --soft: #F3F1F8;
  --green: #4FB37A;
  --green-bg: #E8F4ED;
  --red: #C0392B;
  --red-bg: #FBEDED;
  --blue: #295CE1;
  --blue-bg: #EAF1FA;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

/* TOPBAR */
.topbar {
  position: sticky; top: 0;
  background: var(--navy); color: #fff;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 220px 360px 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: 0 4px 14px rgba(20,20,40,.10);
  z-index: 50;
}
.brand { font-weight: 800; letter-spacing: .12em; font-size: 14px; }
.brand b { color: var(--orange); }
.brand .muted { font-weight: 500; opacity: .6; letter-spacing: .08em; margin-left: 8px; }

.fridge-picker {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 6px 14px;
  transition: background .15s, border-color .15s;
}
.fridge-picker:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
}
.fridge-picker label { font-size: 11px; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .12em; }
.fridge-picker select {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>")
    no-repeat right 2px center / 12px 8px;
  color: #fff; border: 0; font-size: 14px; font-weight: 700;
  padding: 4px 20px 4px 0; outline: none; width: 100%; appearance: none; cursor: pointer;
}
.fridge-picker select option { color: var(--text); }

.top-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 4px 4px 4px 12px;
}
.user-chip .user-name { color: #fff; font-weight: 700; font-size: 13px; }
.user-chip .user-role {
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.user-chip .user-role.role-admin    { background: var(--orange); color: #fff; }
.user-chip .user-role.role-dostawca { background: #295CE1; color: #fff; }
.user-chip .btn.ghost { padding: 4px 12px; font-size: 11px; }

/* Permission table */
.perms-grid { background: #fff; border-radius: 12px; }
.perms-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* User role badge (w tabeli users) */
.user-role.role-admin    { display: inline-block; background: var(--orange); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 999px; text-transform: uppercase; }
.user-role.role-dostawca { display: inline-block; background: #295CE1; color: #fff; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 999px; text-transform: uppercase; }
.btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 9px 16px; border-radius: 999px;
  font-weight: 700; font-size: 13px; font-family: inherit;
}
.btn { white-space: nowrap; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); }
.btn.ghost:hover { background: rgba(255,255,255,.14); }
.tab-actions .btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.tab-actions .btn.ghost:hover { background: var(--soft); }

/* LAYOUT */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  appearance: none; border: 0; background: transparent;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  color: var(--text);
  cursor: pointer; font-family: inherit;
}
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: var(--navy); color: #fff; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 0; }
.nav-foot { font-size: 11px; color: var(--muted); padding: 6px 14px; display: flex; flex-direction: column; gap: 6px; }
.version-pill {
  display: inline-block; align-self: flex-start;
  background: var(--soft); color: var(--text);
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800;
  font-family: ui-monospace, Menlo, monospace;
  cursor: help;
}

/* CONTENT */
.content { padding: 24px 32px 80px; max-width: 1100px; }
/* Planogram używa pełnej szerokości ekranu (kalendarz po prawej + edytor po lewej) */
.content.content-wide { max-width: none; }
.tab { display: block; }
.tab[hidden] { display: none !important; }
.tab-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px; gap: 18px; flex-wrap: wrap;
}
.tab-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.tab-head .sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.tab-head code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.tab-actions { display: flex; align-items: center; gap: 10px; }
.tab-actions .meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.tab-actions input[type="date"] { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-family: inherit; font-size: 13px; }
.meta-pill { display: inline-block; background: #fff; border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.section-h { margin: 28px 0 10px; font-size: 16px; font-weight: 800; }

/* notices */
.notice { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); }
.notice.err { background: var(--red-bg); color: var(--red); border-color: #f7c8c8; }
.notice.ok { background: var(--green-bg); color: var(--green); border-color: #c3e3cd; }

/* PLANOGRAM */
.planogram { display: flex; flex-direction: column; gap: 18px; }
.shelf {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  /* overflow visible żeby tooltip zamienników nie był ucinany.
     Header i shelf-slots mają własny background z border-radius — wizualnie OK. */
  overflow: visible;
}
.shelf-head { border-radius: 15px 15px 0 0; }
.shelf-slots:last-child { border-radius: 0 0 15px 15px; }
.shelf-head {
  background: var(--navy); color: #fff;
  padding: 10px 20px;
  font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.shelf-head .shelf-meta { font-weight: 600; font-size: 11px; letter-spacing: .08em; opacity: .7; text-transform: none; }
.shelf-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  padding: 14px;
}
.slot.slot-add {
  background: transparent;
  border: 2px dashed #c8c4d6;
  color: var(--muted);
  font-family: inherit;
  font-size: inherit;
}
.slot.slot-add:hover { border-color: var(--orange); background: #fff8e6; color: var(--orange); }
.slot.slot-add .plus { background: #fff; color: var(--orange); border: 2px solid var(--orange); }
.slot {
  position: relative;
  background: var(--bg);
  border: 2px dashed #d6d3e0;
  border-radius: 12px;
  min-height: 170px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: border-color .15s, transform .08s, background .15s;
}
.slot:hover { border-color: var(--orange); background: #fff; color: var(--text); }
.slot:active { transform: scale(.98); }
.slot.filled {
  background: #fff;
  border: 1px solid var(--line);
  border-style: solid;
  color: var(--text);
}
.slot .plus {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--soft); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; margin-bottom: 6px;
}
.slot .empty-label { font-size: 11px; letter-spacing: .04em; }
.slot .thumb {
  width: 64px; height: 64px;
  background: var(--soft) center/contain no-repeat;
  border-radius: 10px; margin-bottom: 6px;
}
.slot .pname {
  font-size: 12px; font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  word-break: break-word;
}
.slot .qty-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff;
  font-weight: 800; font-size: 12px;
  padding: 2px 10px; border-radius: 999px;
  margin-top: 8px;
}
.slot .qty-badge::after { content: " szt."; opacity: .8; margin-left: 2px; }
.slot .remove {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.slot .remove:hover { color: #b91c1c; border-color: #b91c1c; }

/* DATA tables */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 0 rgba(20,20,40,.03); }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.data-table th { background: var(--soft); color: var(--text); font-weight: 800; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.data-table td.r, .data-table th.r { text-align: right; white-space: nowrap; }
.data-table th.nowrap, .data-table td.nowrap { white-space: nowrap; }
/* Nagłówki nigdy nie powinny się łamać — zawijanie ucinałoby labelki kolumn */
.data-table thead th { white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.data-table .diff-pos { color: var(--red); }
.data-table .diff-neg { color: var(--green); }
/* Ikony ↑/↓ — nie polegamy wyłącznie na kolorze (a11y) */
.diff-pos::before { content: "↑ "; }
.diff-neg::before { content: "↓ "; }

/* Catalog */
.catalog-table .cat-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.25; }
.catalog-table .cat-code { font-size: 11px; color: var(--muted); font-weight: 400; }
.catalog-table .cat-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.catalog-table input.cat-input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-family: inherit; outline: none; }
.catalog-table input.cat-input.r { text-align: right; min-width: 78px; max-width: 110px; }
.pp-input-wrap {
  display: inline-flex; align-items: center; gap: 4px;
  width: 100%; justify-content: flex-end;
}
.pp-input-wrap .pp-input { flex: 1 1 auto; }
.pp-history-btn {
  appearance: none; border: 1px solid var(--line); background: #fff;
  width: 26px; height: 26px; border-radius: 6px; flex: 0 0 auto;
  cursor: pointer; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.pp-history-btn:hover { background: var(--soft); border-color: var(--orange); }

/* Ikona kosza w wierszu katalogu — admin only delete (lokalnie + Husky IF) */
.cat-del-btn {
  appearance: none; border: 1px solid var(--line); background: #fff;
  width: 28px; height: 28px; border-radius: 6px;
  cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin-left: 4px;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.cat-del-btn:hover { background: #ffeaea; border-color: #d32f2f; }
.cat-del-btn:active { transform: scale(0.93); }
.cat-del-btn:disabled { cursor: wait; }
.catalog-table input.cat-input:focus { border-color: var(--orange); }
.catalog-table input.cat-input.err { border-color: var(--red); background: var(--red-bg); }
.catalog-table .btn.ghost { background: var(--soft); color: var(--text); border: 0; padding: 6px 12px; }
.catalog-table tr.saved-flash { background: var(--green-bg); transition: background .6s; }
.catalog-table th, .catalog-table td { vertical-align: middle; }
.catalog-table th.r, .catalog-table td.r { white-space: nowrap; }
/* min width dla kolumn z cenami żeby się nie skompresowały */
.catalog-table th:nth-child(5), .catalog-table td:nth-child(5) { min-width: 100px; } /* Cena sprzedaży */
.catalog-table th:nth-child(6), .catalog-table td:nth-child(6) { min-width: 130px; } /* Cena zakupu + 📜 */
.catalog-table th:nth-child(7), .catalog-table td:nth-child(7) { min-width: 100px; } /* Marża */
.catalog-table .num.muted { color: var(--muted); }
.tab-actions input[type="search"], .tab-actions select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-family: inherit; font-size: 13px; background: #fff; }

/* Expandable sales rows */
.sales-table .sales-row.expandable { cursor: pointer; }
.sales-table .sales-row.expandable:hover { background: var(--soft); }
.sales-table .sales-row.open { background: var(--soft); }
.sales-table .sales-toggle { width: 32px; padding-left: 12px; padding-right: 0; }
.sales-table .sales-chev {
  appearance: none; background: transparent; border: 0;
  font-size: 12px; color: var(--muted); cursor: pointer;
  width: 22px; height: 22px; border-radius: 6px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.sales-table .sales-chev:hover { background: #e7e5ee; color: var(--text); }
.sales-table tr.sales-detail > td { background: #fbfaff; padding: 0 0 0 32px; border-bottom: 1px solid var(--line); }
.sales-table .sales-subtable {
  width: 100%; border-collapse: collapse;
  background: transparent;
  margin: 8px 14px 12px 0;
}
.sales-table .sales-subtable th, .sales-table .sales-subtable td {
  padding: 7px 10px; font-size: 12px; border-bottom: 1px dashed var(--line); text-align: left;
}
.sales-table .sales-subtable tr:last-child td { border-bottom: 0; }
.sales-table .sales-subtable th {
  background: transparent; color: var(--muted); font-weight: 700;
  text-transform: uppercase; font-size: 10px; letter-spacing: .06em;
}
.sales-table .sales-subtable td.r, .sales-table .sales-subtable th.r { text-align: right; }
.sales-table .sales-subtable .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.sales-table .sales-subtable .diff-pos { color: var(--red); }
.sales-table .sales-subtable .diff-neg { color: var(--green); }

/* Zero-stock row (in Expiring) */
.data-table tr.row-zero td { opacity: .55; }
.data-table tr.row-zero .num { color: var(--muted); }

/* Sales monthly blocks */
.month-block { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.month-block .month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.month-block .month-head .muted { color: var(--muted); }
.month-block table { margin-top: 6px; }

/* Expiry badges */
.exp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.exp-badge.exp-bad  { background: var(--red-bg);   color: var(--red); }
.exp-badge.exp-warn { background: #FFE9CC;          color: #B25C00; }
.exp-badge.exp-soon { background: #FFF4D6;          color: #8A5B00; }
.exp-badge.exp-ok   { background: var(--green-bg); color: var(--green); }

/* Cards grid (restock needs/surplus) */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.r-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px;
  display: flex; gap: 12px; align-items: center;
}
.r-card .thumb {
  width: 56px; height: 56px;
  background: var(--soft) center/contain no-repeat;
  border-radius: 10px; flex: none;
}
.r-card .info { flex: 1; min-width: 0; }
.r-card .name { font-weight: 700; font-size: 13px; line-height: 1.25; max-height: 2.5em; overflow: hidden; }
.r-card .code { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.r-card .stats { display: flex; gap: 10px; margin-top: 6px; align-items: baseline; }
.r-card .diff-pos { color: var(--red); font-weight: 800; }
.r-card .diff-neg { color: var(--green); font-weight: 800; }

/* Collapsible "W normie" — zbalansowane półki domyślnie zwinięte */
.r-shelf-collapsed { background: transparent; border: 1px solid var(--line); border-radius: 12px; }
.r-shelf-collapsed summary {
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}
.r-shelf-collapsed summary::-webkit-details-marker { display: none; }
.r-shelf-collapsed summary::before {
  content: "▸";
  margin-right: 6px;
  display: inline-block;
  transition: transform 0.2s;
}
.r-shelf-collapsed[open] summary::before { transform: rotate(90deg); }
.r-shelf-collapsed > .r-card { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin: 0; }

/* Cena w sekcji "Do wymiany" — kluczowa info, nie muted (kontrast) */
.r-price-sub { color: var(--text); font-weight: 600; }

/* Delivery table — hover state dla wierszy (czytelność tabeli) */
.delivery-table tbody tr:hover { background: var(--soft); }

/* Version banner (planogram) */
.version-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-radius: 12px; margin: 0 0 14px;
  font-size: 13px;
}
.version-banner.live { background: var(--green-bg); color: var(--green); border: 1px solid #c3e3cd; }
.version-banner.future { background: #FFF4D6; color: #8A5B00; border: 1px solid #f1d98a; }
.version-banner.past { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.version-banner b { color: inherit; }
.version-banner .pill-mini { background: rgba(255,255,255,.6); padding: 2px 8px; border-radius: 999px; font-weight: 700; }

.tab-actions select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-family: inherit; font-size: 13px; background: #fff; }

/* Tabs mini (inside modals) */
.tabs-mini { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; }
.tab-mini {
  appearance: none; border: 0; background: transparent;
  padding: 8px 14px; font-weight: 700; color: var(--muted);
  cursor: pointer; font-family: inherit; font-size: 13px;
  border-bottom: 2px solid transparent;
}
.tab-mini.active { color: var(--text); border-bottom-color: var(--orange); }
.tab-mini:hover { color: var(--text); }

/* Clone modal lists */
.clone-panel { padding: 4px 0; }
.clone-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; margin: 8px 0 14px; }
.clone-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.clone-row:hover { border-color: var(--orange); }
.clone-row.selected { border-color: var(--orange); background: #fff8e6; }
.clone-row .main { font-weight: 700; font-size: 13px; }
.clone-row .meta { font-size: 11px; color: var(--muted); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.form-row .meta { display: flex; flex-direction: column; gap: 4px; align-items: stretch; color: var(--muted); font-size: 12px; }
.form-row .meta.full { grid-column: 1 / -1; }
.form-row input[type="text"], .form-row input[type="date"], .form-row textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font-family: inherit; font-size: 13px; color: var(--text); outline: none; background: #fff;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--orange); }

/* Versions list (in versions modal) */
#versionsList { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.version-row {
  display: block;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  margin-bottom: 10px;
}
.version-row-view { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.version-row.is-active { border-color: var(--green); background: var(--green-bg); }
.version-row.is-future { border-color: #f1d98a; background: #FFF4D6; }
.version-row.is-override {
  border-color: var(--orange);
  background: linear-gradient(135deg, #FFF6E5 0%, #FFEACC 100%);
  border-width: 2px;
}
.version-row.is-active.is-override { background: linear-gradient(135deg, var(--green-bg) 0%, #FFEACC 100%); }
.vrow-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.vrow-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.version-row .v-date { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--text); }
.version-row .v-label { color: var(--muted); font-size: 12.5px; }
.version-row .v-tag { padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; background: var(--soft); color: var(--text); text-transform: uppercase; letter-spacing: 0.4px; }
.version-row .v-tag.active { background: var(--green); color: #fff; }
.version-row .v-tag.future { background: #FFB142; color: #fff; }
.version-row .v-tag.override { background: var(--orange); color: var(--navy); border: 1px solid var(--navy); }

/* Akcje wiersza — czytelne kolorowe przyciski z border i ikoną */
.vrow-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-icon-edit, .btn-icon-clone, .btn-icon-archive, .btn-icon-restore, .btn-icon-delete {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 12.5px;
  cursor: pointer; border: 2px solid; transition: all 0.12s; line-height: 1;
  background: #fff;
}
.btn-icon-edit { color: var(--navy); border-color: var(--navy); }
.btn-icon-edit:hover { background: var(--navy); color: #fff; transform: translateY(-1px); }
.btn-icon-clone { color: var(--green); border-color: var(--green); }
.btn-icon-clone:hover { background: var(--green); color: #fff; transform: translateY(-1px); }
.btn-icon-archive { color: #B07A1F; border-color: #FFB142; }  /* żółto-pomarańczowy = soft archive */
.btn-icon-archive:hover { background: #FFB142; color: var(--navy); transform: translateY(-1px); }
.btn-icon-restore { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.btn-icon-restore:hover { background: var(--green); color: #fff; transform: translateY(-1px); }
.btn-icon-delete { color: var(--red); border-color: var(--red); }
.btn-icon-delete:hover { background: var(--red); color: #fff; transform: translateY(-1px); }
.btn-icon-edit .ico, .btn-icon-clone .ico, .btn-icon-archive .ico,
.btn-icon-restore .ico, .btn-icon-delete .ico { font-size: 13px; }

/* Nagłówki sekcji w modal Wersje */
.vsection-head {
  font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 0 6px; margin-top: 4px;
}
.vsection-head.muted { color: var(--muted); text-transform: none; font-weight: 600; font-size: 13px; padding: 12px 0; }

/* Sekcja historyczne — collapsed default */
.versions-past-section {
  margin-top: 14px; padding: 10px 14px; background: var(--soft);
  border: 1px solid var(--line); border-radius: 10px;
}
.versions-past-section > summary {
  cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--muted);
  padding: 4px 0; user-select: none;
}
.versions-past-section > summary:hover { color: var(--text); }
.versions-past-section .version-row {
  background: rgba(255, 255, 255, 0.7); margin-top: 8px; margin-bottom: 0;
  opacity: 0.85;
}

/* Sekcja archived na dole modal Wersje */
.versions-archived-section {
  margin-top: 18px; padding: 12px 14px; background: var(--soft);
  border: 1px solid var(--line); border-radius: 10px;
}
.versions-archived-section > summary {
  cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted);
  padding: 4px 0; user-select: none;
}
.versions-archived-section > summary:hover { color: var(--text); }
.versions-archived-section .version-row {
  background: rgba(255, 255, 255, 0.6); margin-top: 8px; margin-bottom: 0;
  opacity: 0.85;
}
.version-row.is-archived { border-style: dashed; }

/* Day-action: "Nowy planogram" — default styling (spójność z resztą) */

/* Inline editor pod wierszem */
.version-row-edit, .version-row-clone {
  margin-top: 14px; padding: 16px; background: #fff; border-radius: 10px;
  border: 2px dashed var(--orange);
}
.version-row-clone { border-color: var(--green); }
.version-row.is-override .version-row-edit { background: #FFFBF3; }
.vrow-edit-head { font-weight: 800; font-size: 13px; color: var(--text); margin-bottom: 10px; }
.version-row-edit[hidden], .version-row-clone[hidden] { display: none; }
.version-row-edit .form-row, .version-row-clone .form-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; }
.version-row-edit .form-row .meta, .version-row-clone .form-row .meta { font-size: 12px; font-weight: 700; color: var(--text); }
.version-row-edit .form-row .meta input[type="date"],
.version-row-edit .form-row .meta input[type="text"],
.version-row-clone .form-row .meta input[type="date"],
.version-row-clone .form-row .meta input[type="text"] {
  display: block; margin-top: 4px; padding: 7px 10px;
  border: 1.5px solid var(--line); border-radius: 8px; font-size: 13px;
  background: #fff;
}
.version-row-edit .form-row .meta input:focus,
.version-row-clone .form-row .meta input:focus { outline: none; border-color: var(--orange); }
.version-row-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.version-row-edit-actions .btn { padding: 8px 16px; font-size: 13px; font-weight: 700; }
.version-row-edit-status { margin-top: 10px; }
.version-row-edit-status .notice { margin: 0; padding: 8px 12px; font-size: 12.5px; }

/* Override tag na sticky barze */
.psb-override-tag {
  display: inline-block; margin-left: 8px;
  padding: 3px 8px; border-radius: 6px;
  background: var(--orange); color: var(--navy);
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.4px;
  border: 1px solid var(--navy);
  vertical-align: middle;
}

/* Override event w kalendarzu — wyraźna ramka żeby wyróżnić warstwę */
.fc-event.planogram-event.is-override {
  border: 2px solid var(--navy) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(31, 34, 65, 0.25);
  font-style: italic;
}

/* Day-action: wszystkie opcje używają default styling (.day-action-btn) — spójność.
   Override i Nowy pusty zachowują tylko ikonkę jako akcent. */

/* Quick range buttons */
.quick-ranges { display: inline-flex; gap: 4px; }
.quick-ranges .btn.ghost { padding: 6px 12px; font-size: 12px; }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px;
}
.kpi-card .kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.kpi-card .kpi-value { font-size: 22px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-card .kpi-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi-card.accent { background: linear-gradient(135deg, #fff8e6, #fff); border-color: #ffd996; }
.kpi-card.accent .kpi-value { color: var(--orange); }

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.chart-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px;
}
.chart-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.chart-card.chart-span2 { grid-column: span 2; }
.chart-wrap { position: relative; height: 240px; }
.chart-wrap.chart-tall { height: 360px; }
@media (max-width: 1100px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card.chart-span2 { grid-column: span 1; }
}

/* SL EAN highlighting in catalog */
.catalog-table code.sl-ean {
  color: var(--orange);
  font-weight: 800;
  background: rgba(255, 177, 66, 0.12);
}
.catalog-table tr.row-local-only {
  background: rgba(255, 248, 230, 0.5);
}
.catalog-table tr.row-local-only td:first-child::before {
  content: "● ";
  color: var(--orange);
  margin-right: 4px;
}

/* Attribute pills (in catalog 'Atrybuty SL' column) */
.attr-pills {
  display: flex; flex-wrap: wrap; gap: 3px;
  max-width: 240px;
}
.attr-pill {
  display: inline-block;
  background: var(--soft); color: var(--text);
  padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  white-space: nowrap;
  cursor: help;
}
.attr-empty {
  font-size: 11px; color: var(--muted); font-style: italic;
}

.sync-cell {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}

.sync-icon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  cursor: help;
}
.sync-icon::before {
  content: ""; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
}
.sync-icon.synced       { background: var(--green-bg); color: var(--green); }
.sync-icon.synced::before { background: var(--green); }
.sync-icon.local_only   { background: var(--soft); color: var(--muted); }
.sync-icon.local_only::before { background: var(--muted); }
.sync-icon.error        { background: var(--red-bg); color: var(--red); }
.sync-icon.error::before { background: var(--red); }
.sync-icon.exists_in_if { background: #EAF1FA; color: var(--blue); }
.sync-icon.exists_in_if::before { background: var(--blue); }
.sync-icon.in_if_external { background: var(--soft); color: var(--text); opacity: .8; }
.sync-icon.in_if_external::before { background: var(--muted); }
.sync-icon.deleted_in_if { background: var(--red-bg); color: var(--red); text-decoration: line-through; }
.sync-icon.deleted_in_if::before { background: var(--red); }

.sync-retry-btn {
  appearance: none; border: 0; background: var(--soft); color: var(--text);
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; cursor: pointer; margin-left: 4px;
}
.sync-retry-btn:hover { background: #e7e5ee; }
.sync-retry-btn.danger { background: var(--red-bg); color: var(--red); }
.sync-retry-btn.danger:hover { background: #f7d6d6; }

/* SL form */
.sl-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-bottom: 14px;
}
.sl-form-grid .meta { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.sl-form-grid .meta.full { grid-column: 1 / -1; }
.sl-form-grid input, .sl-form-grid select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font-family: inherit; font-size: 13px; color: var(--text); outline: none; background: #fff;
}
.sl-form-grid input:focus, .sl-form-grid select:focus { border-color: var(--orange); }
#slAttrFields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
#slAttrFields .meta { display: flex; flex-direction: column; gap: 4px; }

.ean-preview {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff8e6 0%, #fff 100%);
  border: 1px solid #ffd996;
  border-radius: 12px;
}
.ean-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ean-preview-value {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 22px; font-weight: 800; color: var(--navy);
  letter-spacing: .04em;
}
.ean-breakdown {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px;
}
.ean-chip {
  display: inline-flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 8px; min-width: 38px;
}
.ean-chip .d { font-family: ui-monospace, Menlo, monospace; font-weight: 800; font-size: 14px; color: var(--navy); }
.ean-chip .l { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.ean-chip.counter { background: rgba(255, 177, 66, .15); border-color: #ffd996; }
.ean-chip.counter .d { color: var(--orange); }
.ean-chip.checksum { background: rgba(31, 34, 65, .08); }

.sync-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}
.sync-banner.ok    { background: var(--green-bg); color: var(--green); border: 1px solid #c3e3cd; }
.sync-banner.err   { background: var(--red-bg); color: var(--red); border: 1px solid #f7c8c8; }
.sync-banner.warn  { background: #FFF4D6; color: #8A5B00; border: 1px solid #f1d98a; }
.sync-banner.info  { background: var(--soft); color: var(--text); border: 1px solid var(--line); }

/* Toast stack */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column-reverse; gap: 8px;
  z-index: 200; pointer-events: none;
}
.toast {
  background: var(--navy); color: #fff;
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(20,20,40,.25);
  max-width: 360px; min-width: 240px;
  pointer-events: auto;
  animation: toast-in .25s ease-out;
}
.toast.ok    { background: var(--green); }
.toast.err   { background: var(--red); }
.toast.warn  { background: #B25C00; }
.toast .toast-sub { font-weight: 500; font-size: 12px; opacity: .85; margin-top: 4px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Shelves layout (zakładka „Półki") */
.shelves-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  min-height: 500px;
}
.shelves-sidebar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  height: fit-content;
  position: sticky;
  top: 80px;
}
.shelf-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background .12s;
}
.shelf-item:hover { background: var(--soft); }
.shelf-item.active { background: var(--navy); color: #fff; }
.shelf-item .shelf-name { font-weight: 700; }
.shelf-item .shelf-count {
  font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,.06); color: inherit;
  padding: 2px 8px; border-radius: 999px;
}
.shelf-item.active .shelf-count { background: rgba(255,255,255,.18); }

.shelves-main { min-width: 0; }
.shelves-bulkbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 12px;
  background: #fff8e6; border: 1px solid #ffd996;
  border-radius: 10px;
  flex-wrap: wrap;
}
.shelves-bulkbar select {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font-family: inherit; font-size: 13px;
}
.shelves-bulkbar .btn { padding: 6px 14px; font-size: 13px; }
.shelves-bulkbar #bulkSelectedCount { color: var(--orange); }

#shelvesTable tbody tr.selected { background: #fff8e6; }
#shelvesTable input[type="checkbox"] { cursor: pointer; width: 16px; height: 16px; }

/* MODAL */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(15,20,40,.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 32px;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 720px; max-width: 100%;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 64px);
  box-shadow: 0 30px 80px rgba(20,20,40,.45);
}
.modal.large { width: 960px; }
.modal-head { padding: 20px 24px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-x {
  appearance: none; border: 0; background: var(--soft); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1;
}
.modal-x:hover { background: #e7e5ee; }
.modal-filters { padding: 12px 24px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.modal-filters input, .modal-filters select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: inherit;
  outline: none;
}
.modal-filters input:focus, .modal-filters select:focus { border-color: var(--orange); }
.modal-body { flex: 1; overflow-y: auto; padding: 14px 24px; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.modal-foot .btn.ghost { background: var(--soft); color: var(--text); border: 0; }
.modal-foot .btn.ghost:hover { background: #e7e5ee; }
.qty-input { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-right: auto; }
.qty-input input { width: 64px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-family: inherit; font-size: 14px; text-align: center; }

/* Category picker grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cat-item {
  background: #fff; border: 2px solid var(--line); border-radius: 12px;
  padding: 14px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-height: 140px;
  transition: border-color .12s, transform .08s, background .12s;
}
.cat-item:hover { border-color: var(--orange); background: #fffbf2; }
.cat-item.selected { border-color: var(--orange); background: #fff8e6; }
.cat-item:active { transform: scale(.98); }
.cat-item .cat-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.cat-item .cat-name { font-size: 14px; font-weight: 800; color: var(--text); }
.cat-item .cat-meta { font-size: 10px; color: var(--muted); margin-top: 6px; line-height: 1.4; }

/* Emoji kategorii w tabelach (z marginesem żeby nie kleiło się do tekstu) */
.cat-emoji { display: inline-block; margin-right: 6px; font-size: 18px; vertical-align: -2px; }

/* Slot z kategorią */
.slot { overflow: hidden; }
.slot .cat-icon { font-size: 32px; line-height: 1; margin-bottom: 4px; flex: none; }
.slot.has-product { border-color: var(--orange); background: linear-gradient(180deg, #fff8e6 0%, #fff 60%); border-style: solid; }
.slot.has-product .pname {
  font-size: 12px; font-weight: 800; color: var(--text);
  -webkit-line-clamp: 2;
}
.slot .cat-sub { font-size: 10px; color: var(--muted); margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; flex: none; }
.slot.any-product { border-style: dashed; }
.slot.any-product .pname { font-size: 13px; font-weight: 800; }

/* Compact badge zamienników w slocie + tooltip popup z pełną listą */
.slot .slot-subs-badge {
  position: relative;
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(255, 177, 66, 0.15);
  color: #8a5a00;
  border: 1px dashed rgba(255, 177, 66, 0.5);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  /* overflow MUSI być visible — tooltip wystaje poza bounds badge.
     Tekst "🔄 N zamienników" i tak jest krótki, ellipsis niepotrzebny. */
  overflow: visible;
  max-width: 100%;
}
.slot .slot-subs-badge > * {
  pointer-events: none; /* tooltip wewnątrz — klik przechodzi do badge */
}
.slot .slot-subs-badge:hover {
  background: rgba(255, 177, 66, 0.3);
  border-color: var(--orange);
  border-style: solid;
}
.slot .slot-subs-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  max-width: 440px;
  background: #1f2241;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 100;
  white-space: normal;
}
.slot .slot-subs-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2241;
}
.slot .slot-subs-badge:hover .slot-subs-tooltip,
.slot .slot-subs-badge:focus-visible .slot-subs-tooltip { opacity: 1; }
.slot-subs-tt-h { font-size: 11px; margin-bottom: 6px; color: #c8cee5; }
.slot-subs-tt-h b { color: #ffd089; }
.slot-subs-tt-list { margin: 0; padding-left: 18px; }
.slot-subs-tt-list li { margin: 2px 0; }
.slot-subs-tt-foot { font-size: 10px; margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.1); color: #8b91ab; }
/* Slot z zamiennikami może urosnąć — zezwól na auto-wysokość */
.slot.has-product { min-height: 0; height: auto; overflow: visible; }

/* Przycisk zarządzania zamiennikami — w slocie z productCode */
.slot .subs-btn {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 177, 66, 0.15);
  color: #8a5a00;
  border: 1px dashed rgba(255, 177, 66, 0.5);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.slot .subs-btn:hover {
  background: rgba(255, 177, 66, 0.3);
  border-color: var(--orange);
  border-style: solid;
}
.slot .subs-btn:active { transform: scale(0.96); }

/* Modal zamienników */
.subs-target-cat { font-size: 11px; margin-top: 2px; font-weight: 600; }
.subs-section { margin-bottom: 18px; }
.subs-section:last-child { margin-bottom: 0; }
.subs-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 8px;
}
.subs-section p.small { font-size: 11px; margin: -4px 0 8px; }

.subs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  padding: 8px;
  background: var(--soft, #f7f7f9);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.subs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px 6px 10px;
  background: #fff;
  border: 1px solid var(--orange);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.subs-chip-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subs-chip-x {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.subs-chip-x:hover { background: #d32f2f; color: #fff; }

/* Filtry w modalu zamienników: dropdown kategorii + search obok siebie */
.subs-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 700px) {
  .subs-filters { grid-template-columns: 1fr; }
}
.subs-cat-label {
  display: flex; flex-direction: column; gap: 4px;
}
.subs-cat-sel {
  padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit;
  background: #fff;
  cursor: pointer;
}
.subs-cat-sel:focus {
  border-color: var(--orange); outline: none;
  box-shadow: 0 0 0 3px rgba(255,171,0,0.13);
}
.subs-search-input { margin: 0; align-self: end; }

/* Restock — inline zamienniki pod preferred product */
.pref-block { display: block; margin-bottom: 4px; }
.pref-block:last-child { margin-bottom: 0; }
.pref-subs {
  margin-left: 28px;
  margin-top: 2px;
  padding: 4px 0 6px 8px;
  border-left: 2px solid rgba(255, 177, 66, 0.4);
}
.pref-subs-h {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
  padding-left: 4px;
}
.pref-subs .cat-prod-row {
  padding-top: 4px;
  padding-bottom: 4px;
  opacity: 0.95;
}
.pref-subs .cat-prod-row .name { font-size: 12px; font-weight: 600; }
.pref-subs .cat-prod-row .thumb-sm { width: 28px; height: 28px; }
.cat-prod-row.substitute-of { background: rgba(255, 177, 66, 0.04); border-radius: 6px; }

/* Restock card */
.cat-card { padding: 0; display: block; }
.cat-card-head {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.cat-card .cat-icon-lg { font-size: 32px; line-height: 1; flex: none; }
.cat-card .cat-card-head .info { flex: 1; min-width: 0; }
.cat-card .cat-card-head .name { font-weight: 800; font-size: 14px; }
.cat-card .cat-card-head .stats { display: flex; gap: 8px; align-items: baseline; margin-top: 4px; font-size: 12px; }
.cat-section { padding: 8px 14px; border-bottom: 1px dashed var(--line); border-left: 3px solid transparent; }
.cat-section:last-child { border-bottom: 0; }
.cat-section-h { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.cat-section-h.muted { color: var(--muted); font-weight: 700; }
.cat-section-h .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cat-section-h .dot-red { background: var(--red); }
.cat-section-h .dot-green { background: var(--green); }
.cat-section-h .dot-orange { background: var(--orange); }
.cat-section-h .dot-blue { background: var(--blue); }

.cat-section.sec-missing { border-left-color: var(--red); background: rgba(192, 57, 43, .03); }
.cat-section.sec-proposed { border-left-color: var(--blue); background: rgba(41, 92, 225, .03); }
.cat-section.sec-proposed > summary { cursor: pointer; padding: 6px 0; user-select: none; list-style: none; }
.cat-section.sec-proposed > summary::-webkit-details-marker { display: none; }
.cat-section.sec-proposed > summary::before { content: "▸"; color: var(--muted); margin-right: 6px; transition: transform .12s; display: inline-block; }
.cat-section.sec-proposed[open] > summary::before { transform: rotate(90deg); }
.sec-proposed-body { padding-top: 4px; }
.cat-section.sec-ok { background: transparent; }
.cat-section.sec-subs { border-left-color: var(--orange); background: rgba(255, 177, 66, .04); }

/* Mini-stat w nagłówku karty — wyjaśnia paradoks diff vs braki */
.cat-breakdown { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; }
.cat-breakdown .bd-miss { color: var(--red); }
.cat-breakdown .bd-subs { color: var(--orange); }
.cat-breakdown b { font-weight: 800; }

.cat-prod-row .ok-check { color: var(--green); }
.cat-prod-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px; align-items: center;
  padding: 4px 0;
}
.cat-prod-row .thumb-sm {
  width: 32px; height: 32px;
  background: var(--soft) center/contain no-repeat;
  border-radius: 6px;
}
.cat-prod-row .info { min-width: 0; }
.cat-prod-row .name { font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-prod-row .muted { font-size: 10px; }
.cat-prod-row .counts { display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; font-weight: 700; gap: 1px; }
.cat-prod-row.preferred.ok { opacity: .8; }
.cat-prod-row.substitute { opacity: .9; }
.cat-prod-row.has-tooltip { position: relative; cursor: help; }
.cat-prod-row.has-tooltip:hover,
.cat-prod-row.has-tooltip:focus-within,
.cat-prod-row.has-tooltip:focus-visible {
  background: rgba(0, 0, 0, .035);
  /* Hover-owany wiersz wchodzi nad sąsiadów — inaczej kolejne wiersze
     (też position:relative) paintują się nad naszym tooltipem. */
  z-index: 60;
}
.cat-prod-row.has-tooltip:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; border-radius: 4px; }

/* Globalny focus-visible outline — 3px dla lepszej widoczności keyboard nav (a11y).
   Specyficzne reguły niżej w pliku (np. .cat-prod-row, .hc-param) nadpisują własne 2px. */
*:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* Tooltip — pokazywany na hover (i focus dla klawiatury / dotyku) */
.prod-tooltip {
  position: absolute;
  z-index: 50;
  top: 100%; left: 0;
  margin-top: 4px;
  min-width: 240px; max-width: 320px;
  background: #1c1f24;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .12s, transform .12s;
}
.cat-prod-row.has-tooltip:hover .prod-tooltip,
.cat-prod-row.has-tooltip:focus-within .prod-tooltip,
.cat-prod-row.has-tooltip:focus-visible .prod-tooltip {
  opacity: 1;
  transform: translateY(0);
}
.prod-tooltip .tt-name { font-weight: 700; font-size: 13px; white-space: normal; word-break: break-word; }
.prod-tooltip .tt-ean { margin-top: 2px; color: rgba(255,255,255,.6); }
.prod-tooltip .tt-ean code { font-family: ui-monospace, monospace; font-size: 11px; }
.prod-tooltip .tt-kv { margin-top: 8px; display: grid; gap: 3px; }
.prod-tooltip .tt-kv .muted { color: rgba(255,255,255,.55); min-width: 78px; display: inline-block; }
.prod-tooltip .tt-pos { color: #57d27e; }
.prod-tooltip .tt-neg { color: #ff7676; }

/* 2-step picker */
.picker-breadcrumb {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}
.picker-back {
  appearance: none; border: 0; background: var(--soft); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-weight: 700; cursor: pointer;
  font-family: inherit; font-size: 12px;
}
.picker-back:hover { background: #e7e5ee; }
.picker-cat-tag {
  background: var(--orange); color: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-weight: 800; font-size: 13px;
}
.picker-any-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  width: 100%;
  appearance: none; font-family: inherit; text-align: left;
  /* Drugorzędne wizualnie — szare tło bez gradientu, dyskretne; główna uwaga
     to lista produktów i banner "Aktualnie w slocie". */
  background: var(--soft);
  border: 1.5px dashed var(--line); border-radius: 8px;
  cursor: pointer; margin-bottom: 10px;
}
.picker-any-row:hover { background: #ECEBF4; border-color: var(--muted); }
.picker-any-icon { font-size: 20px; line-height: 1; text-align: center; opacity: 0.7; }
.picker-any-row .info .name { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.picker-any-row .info .muted { font-size: 10.5px; margin-top: 1px; }
.picker-any-row .pick-action { font-size: 11px; font-weight: 700; color: var(--muted); }
.picker-search {
  width: 100%;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font-family: inherit; font-size: 13px;
  margin-bottom: 12px;
}
.picker-search:focus { border-color: var(--orange); outline: none; }
.picker-products { max-height: calc(70vh - 80px); overflow-y: auto; }
.picker-product-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px; align-items: center;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.picker-product-row:hover { background: var(--soft); border-color: var(--line); }
.picker-product-row.selected { background: #fff8e6; border-color: var(--orange); }
.picker-product-row .thumb {
  width: 48px; height: 48px;
  background: var(--soft) center/contain no-repeat;
  border-radius: 8px;
}
.picker-product-row .thumb.empty {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--muted); opacity: .5;
}
.picker-product-row .info { min-width: 0; }
.picker-product-row .name { font-size: 13px; font-weight: 700; line-height: 1.25; }
.picker-product-row .code { font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
.picker-product-row .pick-action { font-size: 11px; font-weight: 800; color: var(--orange); white-space: nowrap; }

/* ---------- Toggle widoków (np. Sprzedaż: Per produkt / Lista transakcji) ---------- */
.view-toggle {
  display: inline-flex;
  background: var(--soft);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.view-toggle .vt-btn {
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.view-toggle .vt-btn:hover { color: var(--text); }
.view-toggle .vt-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 20, 40, .12);
}

/* ---------- Lista transakcji: grupowanie po kliencie ---------- */
.data-table tr.ph-client-head td {
  background: var(--soft);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.data-table tr.ph-client-head code {
  font-family: ui-monospace, Menlo, monospace;
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ---------- Health monitoring ---------- */
.health-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.health-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 14px; flex-wrap: wrap;
}
.health-title { font-size: 15px; font-weight: 700; }
.health-title code { background: var(--soft); padding: 2px 8px; border-radius: 6px; font-family: ui-monospace, monospace; }
.health-stats { font-size: 12px; }
.health-check-table { font-size: 13px; }
.health-check-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.health-check-table tr:last-child td { border-bottom: 0; }
.health-check-table td.health-value { text-align: right; font-weight: 600; white-space: nowrap; }

/* Sekcja w Settings — health checks */
#healthChecksTable td.hc-params-cell { white-space: nowrap; }
#healthChecksTable select { padding: 4px 8px; font-size: 12px; }
.hc-param-label {
  display: inline-flex; align-items: center; gap: 4px;
  margin-right: 14px;
  font-size: 12px;
}
.hc-param {
  width: 60px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  text-align: right;
}
.hc-param:focus { outline: 2px solid var(--orange); outline-offset: -1px; }
.hc-param-suffix { font-size: 11px; }

/* Health card — lodówka testowa (alerty pomijane) — wyciszone */
.health-card.is-test {
  opacity: 0.7;
  background: var(--soft);
}
.health-card.is-test .health-title code {
  background: #fff;
}

/* Fridge flags table */
#fridgeFlagsTable input[type="text"] {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

/* ===== Zakładka Etykiety — krokowy layout ===== */
.lbl-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
}
.lbl-step-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.lbl-step-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.lbl-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--navy); color: #fff;
  border-radius: 50%;
  font-weight: 800; font-size: 13px;
}
.lbl-step-num-ready { background: var(--green); }
.lbl-step-body { padding: 18px; }
.lbl-step-body[hidden] { display: none; }

/* Step 1 — produkt */
#lblProductSearch {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 10px;
  font-family: inherit;
}
#lblProductSearch:focus { outline: 2px solid var(--orange); outline-offset: -1px; }
#lblProductList {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.lbl-product-item {
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%;
  padding: 8px 12px;
  border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  gap: 2px;
  transition: background .08s;
}
.lbl-product-item:last-child { border-bottom: 0; }
.lbl-product-item:hover { background: var(--soft); }
.lbl-product-item:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.lbl-product-item .lbl-product-name { font-weight: 700; line-height: 1.25; }
.lbl-product-item .lbl-product-meta { font-size: 11px; }
.lbl-product-empty, .lbl-product-overflow {
  padding: 10px 12px;
  font-size: 12px;
  text-align: center;
}
.lbl-product-overflow { border-top: 1px dashed var(--line); }

/* Step 1 — chosen product card */
.lbl-chosen-card {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(0deg, #fff8e6 0%, #fff 100%);
  border: 2px solid var(--orange);
  padding: 14px 18px;
  border-radius: 12px;
  gap: 14px;
}
.lbl-chosen-info { min-width: 0; flex: 1; }
.lbl-chosen-name { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.lbl-chosen-meta { color: var(--muted); font-size: 12px; }
.lbl-chosen-meta code { background: var(--soft); padding: 1px 6px; border-radius: 4px; font-size: 11px; }

/* Change product button — wyraźny na pomarańczowej karcie */
.lbl-change-btn {
  display: inline-flex; align-items: center; gap: 8px;
  appearance: none;
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--orange);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .12s;
}
.lbl-change-btn:hover {
  background: var(--orange);
  color: #fff;
}
.lbl-change-btn svg { flex-shrink: 0; }
.lbl-change-btn:hover svg { transform: rotate(30deg); transition: transform .15s; }

/* Step 2 — data ważności */
.lbl-expiry-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.lbl-expiry-row input[type="date"] {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  min-width: 170px;
}
.lbl-expiry-row input[type="date"]:focus { outline: 2px solid var(--orange); outline-offset: -1px; }
.lbl-day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lbl-chip {
  appearance: none;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700; font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.lbl-chip:hover {
  border-color: var(--orange);
  background: #fff8e6;
  color: var(--orange);
}
.lbl-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
  padding: 8px 12px;
  background: var(--soft);
  border-radius: 8px;
  border-left: 3px solid var(--orange);
}

/* Symulator wydruku */
.lbl-preview-wrap {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.lbl-preview-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
.lbl-preview {
  display: flex; flex-direction: column; gap: 8px;
}
.lbl-prev-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(20, 20, 40, .08);
}
.lbl-prev-bg { fill: #fff; }
.lbl-prev-carrier { fill: #f0eef5; }
.lbl-prev-shapelabel {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.1px;
  fill: rgba(0,0,0,.25);
  font-weight: 600;
}
.lbl-prev-text {
  /* Roboto Condensed = najbliższy free webfont do CG Triumvirate Bold Condensed (font drukarki ^A0) */
  font-family: "Roboto Condensed", "Arial Narrow", "Liberation Sans Narrow", sans-serif;
  font-weight: 700;
  font-stretch: condensed;
  fill: #1a1a1a;
}
.lbl-prev-outline {
  fill: none;
  stroke: rgba(255, 177, 66, .35);
  stroke-width: 0.15;
  stroke-dasharray: 0.5 0.4;
}
/* Pionowa kreska pokazująca granicę faktycznej print area (`previewClipWidthMm`) */
.lbl-prev-clipline {
  stroke: rgba(200, 0, 0, .8);
  stroke-width: 0.2;
  stroke-dasharray: 0.8 0.4;
}

/* WYSIWYG drag boxes nakładane na pola etykiety */
.lbl-drag-box {
  fill: transparent;
  stroke: rgba(255, 177, 66, .55);
  stroke-width: 0.25;
  cursor: move;
}
.lbl-drag-group:hover .lbl-drag-box {
  fill: rgba(255, 177, 66, .12);
  stroke: rgba(255, 145, 0, .9);
}
.lbl-drag-label {
  font-size: 1.2px;
  fill: rgba(255, 145, 0, .85);
  font-weight: 700;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.03px;
}
.lbl-drag-handle {
  fill: rgba(255, 145, 0, .95);
  stroke: #fff;
  stroke-width: 0.1;
  cursor: se-resize;
}
.lbl-preview.lbl-dragging { user-select: none; }
.lbl-preview.lbl-dragging * { cursor: grabbing !important; }

/* Layout editor (collapse w zakładce Etykiety) */
.lbl-layout-editor {
  background: #FFFBF0;
  border: 1px solid #F0DCA0;
  border-radius: 12px;
  margin: 12px 0 22px;
  overflow: hidden;
}
.lbl-layout-editor > summary {
  cursor: pointer;
  padding: 14px 18px;
  background: #FFF3CD;
  font-size: 14px;
  user-select: none;
  list-style: none;
}
.lbl-layout-editor > summary::-webkit-details-marker { display: none; }
.lbl-layout-editor > summary::after {
  content: "▾"; float: right; opacity: .5;
}
.lbl-layout-editor[open] > summary::after { content: "▴"; }
.lbl-layout-editor[open] > summary { border-bottom: 1px solid #F0DCA0; }
.lbl-layout-body { padding: 18px; overflow-x: auto; }

/* Tabela layoutu — wymuszone wąskie kolumny żeby mieściła się w containerze */
#lblLayoutTable { table-layout: fixed; width: 100%; min-width: 720px; }
#lblLayoutTable thead th { padding: 6px 4px; font-size: 11px; }
#lblLayoutTable tbody td { padding: 6px 4px; vertical-align: middle; }
#lblLayoutTable tbody td:first-child { padding-left: 10px; }
#lblLayoutTable input[type="number"] { width: 56px; padding: 4px 6px; text-align: right; font-size: 12px; }
#lblLayoutTable input[type="checkbox"] { transform: scale(1.1); }
#lblLayoutTable select { width: 60px; padding: 4px 4px; font-size: 12px; }
/* Kolumny — proporcje */
#lblLayoutTable colgroup, /* fallback */
#lblLayoutTable th:nth-child(1) { width: 160px; }       /* Pole */
#lblLayoutTable th:nth-child(2) { width: 60px; }        /* Aktywne */
#lblLayoutTable th:nth-child(3),
#lblLayoutTable th:nth-child(4),
#lblLayoutTable th:nth-child(5),
#lblLayoutTable th:nth-child(6) { width: 72px; }        /* X/Y/W/H */
#lblLayoutTable th:nth-child(7) { width: 80px; }        /* Font mm */
#lblLayoutTable th:nth-child(8) { width: 70px; }        /* Align */
.lbl-prev-ruler line {
  stroke: rgba(0, 0, 0, .25);
  stroke-width: 0.1;
}
.lbl-prev-info {
  font-size: 12px;
  color: var(--text);
  padding: 8px 12px;
  background: var(--soft);
  border-radius: 8px;
  border-left: 3px solid var(--orange);
}

/* Step 3 — qty + akcja */
.lbl-qty-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.lbl-qty-control {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.lbl-qty-btn {
  appearance: none; border: 0;
  background: var(--soft);
  width: 38px; height: 38px;
  font-size: 18px; font-weight: 800;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.lbl-qty-btn:hover { background: var(--orange); color: #fff; }
#lblQty {
  width: 70px;
  text-align: center;
  border: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  height: 38px;
  -moz-appearance: textfield;
}
#lblQty::-webkit-outer-spin-button,
#lblQty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lbl-generate-btn {
  font-size: 14px;
  padding: 10px 20px;
}

/* Step 4 — wygenerowane tagi + drukowanie */
.lbl-print-bar {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--soft);
  border-radius: 10px;
}
.lbl-print-info { flex: 1; font-size: 14px; }
.lbl-print-big {
  font-size: 14px;
  padding: 12px 24px;
}

/* EPC w tabeli wygenerowanych */
.lbl-epc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .02em;
}

/* Secondary button — widoczny ghost z border (nie znika na białym tle) */
.btn.lbl-secondary-btn {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--line);
}
.btn.lbl-secondary-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* Historia — collapse */
.lbl-history-details {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.lbl-history-details summary {
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}
.lbl-history-details[open] summary { margin-bottom: 10px; }

/* ---------- Printer config row (Settings) ---------- */
.printer-cfg-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.printer-cfg-row input[type="text"],
.printer-cfg-row input[type="number"] {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

/* ---------- Dish staging (Katalog) ---------- */
.stg-box {
  background: #FFFAEC;
  border: 1px solid #E8C97A;
  border-radius: 12px;
  margin-bottom: 22px;
  /* Pozwól boxowi rosnąć do natural width tabeli, ale NIE szerszemu niż
     viewport minus sidebar (~250px) + margines. Jeśli treść większa —
     scroll horyzontalny w .stg-body. */
  width: max-content;
  max-width: calc(100vw - 280px);
  min-width: 100%;
}
.stg-box.collapsed .stg-body { display: none; }
.stg-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 18px; background: #FFEFC2;
  border-bottom: 1px solid #E8C97A;
}
.stg-head > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stg-pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid #E8C97A;
  font-size: 13px; font-weight: 600; color: #5C4612;
}
.stg-pill.warn { background: #FFE9B0; border-color: #E8C97A; }
.stg-pill.err  { background: #FBEDED; border-color: #E5A8A8; color: var(--red); }
.stg-bulk { display: flex; gap: 8px; align-items: center; }
/* W całym stg-box (pasek + tabela) .btn.ghost ma transparent bg + jasny color,
   przez co na białym/żółtym tle jest niewidoczny. Wymuszamy kontrast. */
.stg-box .btn { background: #fff !important; color: #4A3909 !important; border: 1px solid #B8923B !important; }
.stg-box .btn:hover { background: #FFE9B0 !important; }
.stg-box .btn.primary { background: var(--orange) !important; color: #fff !important; border-color: transparent !important; }
.stg-box .btn.primary:hover { filter: brightness(.95) !important; background: var(--orange) !important; }
.stg-box .btn.ghost { background: #fff !important; opacity: 1 !important; }
#stgToggleCollapse {
  font-size: 16px !important; padding: 4px 14px !important;
  line-height: 1; min-width: 36px;
}

/* Tabela — pozwalamy wystawać poza .content, ale w przypadku gdy
   stg-box jest cappowany max-width-em → wewnątrz scroll horyzontalny. */
.stg-body { padding: 14px 18px 18px; overflow-x: auto; }
.stg-table {
  width: auto; font-size: 13.5px; border-collapse: separate; border-spacing: 0;
  /* width: auto + min-widths kolumn → tabela rośnie do natural rozmiaru,
     stg-box ją okala bo ma width: max-content. */
}
.stg-table thead th {
  background: transparent; padding: 8px 10px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; border-bottom: 1px solid #E8C97A;
}
.stg-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #F0E2BB;
  vertical-align: top;
}
.stg-table tbody tr:last-child td { border-bottom: 0; }
.stg-table .stg-row.duplicate { opacity: .82; background: #FBEDED30; }
.stg-table .stg-row:hover { background: #FFF0BD80; }

/* Kolumny — zwężone żeby tabela mieściła się bez horyzontalnego scrolla
   w typowym oknie (~1000-1100px szerokości). */
.stg-c-check   { width: 28px; }
.stg-c-name    { min-width: 160px; max-width: 220px; }
.stg-c-prop    { min-width: 320px; }
.stg-c-ean     { width: 135px; }
.stg-c-price   { width: 80px; white-space: nowrap; }
.stg-c-status  { width: 95px; }
.stg-c-actions {
  width: 100px; text-align: right;
  white-space: normal;
}
.stg-c-actions .btn.small { display: block; width: 100%; margin: 0 0 6px; }
.stg-c-actions .btn.small:last-child { margin-bottom: 0; }

.stg-name { font-weight: 700; color: var(--text); line-height: 1.25; }
.stg-dishtype-inline {
  display: inline-block; margin-top: 4px;
  padding: 2px 8px; border-radius: 999px; background: var(--soft);
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.stg-prop { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; width: 100%; }
.stg-prop-grid {
  display: grid;
  /* 4 kolumny: [klucz1 | wartość1 | klucz2 | wartość2] — 4 wiersze zamiast 8 */
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 3px;
  font-size: 12px;
  line-height: 1.35;
  width: 100%;
}
.stg-prop-grid .stg-prop-k {
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  white-space: nowrap;
}
.stg-prop-grid b {
  color: var(--text); font-weight: 600;
  overflow-wrap: anywhere;
}
/* Dodatkowa separacja między dwiema grupami atrybutów (3. kolumna = key2) */
.stg-prop-grid > :nth-child(4n+3) { padding-left: 14px; border-left: 1px dashed #E0CFA8; }
/* Przycisk "Zmień" — wysoki kontrast, nadpisuje .btn.ghost */
.stg-change-btn.stg-change-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1.5px solid #B8923B !important;
  background: #FFFFFF !important;
  color: #4A3909 !important;
  padding: 4px 14px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  cursor: pointer;
}
.stg-change-btn.stg-change-btn:hover {
  background: #FFE9B0 !important;
  border-color: #8B6E1F !important;
}
.stg-change-btn::before { content: "✏️"; font-size: 10px; }
.stg-dup {
  display: inline-block; padding: 4px 10px;
  background: var(--red-bg); color: var(--red); border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.stg-status-pending {
  display: inline-block; padding: 4px 10px;
  background: #E0F4E1; color: #2A6F3A; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.stg-ean-inp {
  width: 100%; max-width: 160px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: ui-monospace, monospace; font-size: 12px;
}
.stg-ean-inp:focus { border-color: var(--orange); outline: none; }
.btn.small { padding: 6px 12px; font-size: 11.5px; font-weight: 700; }

/* ---------- Promo generator (zakładka Reklamy) ---------- */
.promo-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .promo-grid { grid-template-columns: 1fr; } }
.promo-form, .promo-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
}
.promo-form h3, .promo-preview h3 { margin: 0 0 14px; font-size: 16px; }
.promo-form .meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.promo-form .meta > span {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700;
}
.promo-form input[type="text"],
.promo-form select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit;
}
.promo-form input[type="text"]:focus,
.promo-form select:focus { border-color: var(--orange); outline: none; }
.promo-file input[type="file"] { padding: 8px 0; font-size: 13px; }
.promo-product-preview {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 12px; padding: 8px 10px;
  background: #f4f4f8; border-radius: 8px; font-size: 12px;
}
.promo-product-preview img {
  width: 56px; height: 56px; object-fit: contain;
  border-radius: 6px; background: #fff; padding: 4px;
}

/* ── CTA picker ───────────────────────────────────────────────────────── */
.cta-input-row {
  display: flex; gap: 6px; align-items: stretch;
}
.cta-input-row input[type="text"] { flex: 1; min-width: 0; }
.cta-random-btn, .cta-toggle-btn {
  border: 1px solid var(--line);
  background: #fff; border-radius: 8px;
  padding: 0 10px; cursor: pointer;
  font-size: 13px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; height: 38px; min-width: 38px;
}
.cta-random-btn { font-size: 16px; }
.cta-random-btn:hover, .cta-toggle-btn:hover {
  background: #fafafa; border-color: var(--orange);
}
.cta-toggle-arrow { transition: transform 0.2s; font-size: 12px; opacity: 0.6; }
.cta-toggle-btn[aria-expanded="true"] .cta-toggle-arrow { transform: rotate(180deg); }

/* ── CTA popover (kompaktowy dropdown z search) ─────────────────────── */
/* Anchor TYLKO na CTA label — nie globalnie .meta (psułoby inne dropdowny) */
.promo-form .meta:has(#promoCta) { position: relative; }
.cta-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  max-height: 380px;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: cta-popover-in 0.12s ease-out;
}
/* WAŻNE: `display: flex` powyżej nadpisuje native `[hidden] { display: none }`.
   Explicitne override żeby `box.hidden = true` w JS faktycznie ukrywał popover. */
.cta-popover[hidden] { display: none; }
@keyframes cta-popover-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.cta-popover-search {
  padding: 10px 12px;
  border: none; border-bottom: 1px solid var(--line);
  font-size: 13px; outline: none;
  background: #fafbfd; flex-shrink: 0;
}
.cta-popover-search:focus { background: #fff; }
.cta-popover-list {
  flex: 1; overflow-y: auto;
  padding: 10px 12px;
  display: grid; gap: 12px;
}
.cta-popover-list .cta-cat-empty {
  text-align: center; color: #9aa0ad;
  font-size: 12px; font-style: italic;
  padding: 16px 8px;
}
.cta-cat {
  display: flex; flex-direction: column; gap: 6px;
}
.cta-cat-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  color: #6b7180; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cta-cat-emoji { font-size: 14px; }
.cta-cat-count {
  margin-left: auto;
  font-size: 10px; font-weight: 500;
  color: #9aa0ad; letter-spacing: 0;
  text-transform: none;
}
.cta-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.cta-chip {
  border: 1px solid var(--line);
  background: #fff; border-radius: 999px;
  padding: 4px 11px; cursor: pointer;
  font-size: 11.5px; color: var(--ink);
  font-weight: 500; letter-spacing: 0.01em;
  transition: all 0.12s;
}
.cta-chip:hover {
  background: var(--orange); border-color: var(--orange);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(255, 171, 0, 0.25);
}
.cta-chip:active { transform: translateY(0); }

/* ── Promo sub-tabs (Automatyzacje / Generator) ───────────────────────── */
.promo-subtabs {
  display: inline-flex; gap: 4px;
  background: #f1f2f7; border-radius: 10px; padding: 4px;
  margin-right: 12px;
}
.promo-subtab {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: #6b7180;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.promo-subtab:hover { color: var(--ink); }
.promo-subtab.active {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}
.promo-subtab-icon { font-size: 14px; }

/* ── Automatyzacje: grid + form ──────────────────────────────────────── */
.promo-aut-grid {
  display: grid; grid-template-columns: minmax(420px, 1fr) 1.2fr; gap: 22px;
  align-items: start;
}
@media (max-width: 1100px) { .promo-aut-grid { grid-template-columns: 1fr; } }

.promo-aut-form, .promo-aut-list-box {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.promo-aut-form h3, .promo-aut-list-box h3 {
  margin: 0 0 18px; font-size: 16px;
  display: inline-flex; align-items: center; gap: 8px;
}
.form-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: linear-gradient(180deg, #fff5e0 0%, #ffe2b0 100%);
  border-radius: 7px; font-size: 14px;
}

.promo-aut-form .meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.promo-aut-form .meta > span {
  font-size: 12px; font-weight: 600;
  color: #4a4f5a; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 6px;
}
.promo-aut-form input[type="text"],
.promo-aut-form input[type="datetime-local"],
.promo-aut-form select {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%; min-width: 0; box-sizing: border-box;
  font-family: inherit;
}
.promo-aut-form input:focus,
.promo-aut-form select:focus {
  border-color: var(--orange); outline: none;
  box-shadow: 0 0 0 3px rgba(255,171,0,0.15);
}

.promo-aut-img-preview {
  display: flex; align-items: center; gap: 12px;
  margin: -10px 0 14px; padding: 10px;
  background: linear-gradient(180deg, #fafbfd 0%, #f1f3f8 100%);
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 12px;
}
.promo-aut-img-preview img {
  width: 60px; height: 107px; object-fit: cover;
  border-radius: 7px; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.promo-aut-window {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.promo-aut-window .meta { min-width: 0; }  /* pozwala input <= grid cell */

.promo-aut-window-helper {
  font-size: 12px; color: #4a4f5a;
  margin: -10px 0 14px; padding: 8px 12px;
  background: #f1f3f8; border-radius: 7px;
  min-height: 16px;
}
.promo-aut-window-helper.err { background: #fdf0f0; color: #c4302b; }
.promo-aut-window-helper:empty { padding: 0; min-height: 0; background: transparent; margin: 0 0 14px; }

.promo-aut-window-quick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 16px; font-size: 12px;
}
.promo-aut-window-quick .muted { margin-right: 4px; }
.quick-window {
  border: 1px solid var(--line); background: #fff;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 500; color: #4a4f5a;
  transition: all 0.12s;
}
.quick-window:hover {
  background: var(--orange); border-color: var(--orange);
  color: #fff; transform: translateY(-1px);
}

.aut-fridges-selected-badge {
  background: #e8eaf5; color: #4d56a8;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  letter-spacing: 0;
}
.aut-fridges-selected-badge.has-some { background: #ffe9b5; color: #6b4500; }
.fridge-picker-toolbar .spacer { flex: 1; }

/* ── Fridge picker (multi-checkbox) ──────────────────────────────────── */
.fridge-picker-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 6px; font-size: 12px;
}
.fridge-picker-mode {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 400; color: #4a4f5a;
  text-transform: none; letter-spacing: 0;
  margin-right: 6px;
}
.fridge-picker-list {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; background: #fafbfd;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
}
.fridge-picker-list.disabled {
  opacity: 0.4; pointer-events: none;
}
.fridge-picker-row {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 2px 4px; border-radius: 4px;
  cursor: pointer; transition: background 0.1s;
}
.fridge-picker-row:hover { background: rgba(255,171,0,0.08); }
.fridge-picker-row input[type="checkbox"] { margin: 0; }

/* ── Lista automatyzacji ────────────────────────────────────────────── */
.promo-aut-list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.promo-aut-list-header h3 { margin: 0; }

.aut-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fafbfd 0%, #f5f6fa 100%);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.aut-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.aut-card.status-scheduled {
  background: linear-gradient(180deg, #f0f2fa 0%, #e6e9f5 100%);
  border-color: #c8cee5;
}
.aut-card.status-active {
  background: linear-gradient(180deg, #fff7d6 0%, #ffeeb0 100%);
  border-color: #ffce69;
  box-shadow: 0 0 0 3px rgba(255,171,0,0.1);
}
.aut-card.status-done {
  opacity: 0.7; background: #f8f9fb;
}
.aut-card.status-error {
  background: linear-gradient(180deg, #fdf0f0 0%, #f7dede 100%);
  border-color: #f5b7b7;
}
.aut-card.status-cancelled { opacity: 0.55; background: #f5f5f5; }

.aut-card-thumb {
  width: 64px; height: 114px; object-fit: cover;
  border-radius: 8px; flex-shrink: 0;
  background: #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.aut-card-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; opacity: 0.3;
}
.aut-card-body { flex: 1; min-width: 0; }
.aut-card-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.aut-card-name { font-weight: 600; font-size: 15px; color: var(--ink); }

.aut-status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.01em;
}
.aut-status-pill .aut-status-icon { font-size: 11px; }
.aut-status-pill.scheduled { background: #e0e5f7; color: #3d479f; }
.aut-status-pill.active {
  background: #fff; color: #b87100;
  box-shadow: 0 0 0 2px #ffce69;
  animation: aut-pulse 2s ease-in-out infinite;
}
.aut-status-pill.done { background: #d6dbe5; color: #4a4f5a; }
.aut-status-pill.error { background: #ffcfcf; color: #8a1f1f; }
.aut-status-pill.cancelled { background: #e0e0e0; color: #7a7a7a; }
@keyframes aut-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #ffce69; }
  50% { box-shadow: 0 0 0 2px rgba(255,171,0,0.4); }
}

.aut-time-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; margin-bottom: 3px;
}
.aut-time-label {
  width: 50px; flex-shrink: 0;
  font-size: 10px; font-weight: 600; color: #6b7180;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.aut-time-rel { font-weight: 600; color: var(--ink); }
.aut-time-rel.future { color: #3d479f; }
.aut-time-rel.highlight { color: #b87100; font-weight: 700; }
.aut-time-abs { font-size: 11px; color: #6b7180; }

.aut-progress {
  height: 5px; background: rgba(0,0,0,0.06); border-radius: 999px;
  overflow: hidden; margin-top: 6px;
}
.aut-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange) 0%, #ff7a00 100%);
  transition: width 0.5s ease;
}

.aut-card-fridges {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #4a4f5a;
  margin-top: 8px;
  background: rgba(255,255,255,0.6); padding: 4px 10px;
  border-radius: 999px; max-width: 100%; overflow: hidden;
}
.aut-fridges-icon { font-size: 13px; opacity: 0.7; }
.aut-fridges-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.aut-fridges-count {
  background: #d6dbe5; color: #4a4f5a;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  margin-left: auto; flex-shrink: 0;
}

.aut-error-line {
  color: #c4302b; font-size: 11px; margin-top: 6px;
  background: rgba(255,255,255,0.5); padding: 4px 8px; border-radius: 6px;
}

.aut-card-actions {
  display: flex; gap: 6px; align-items: flex-start; flex-shrink: 0;
}
.aut-card-btn-label { display: inline; }
@media (max-width: 1300px) {
  .aut-card-btn-label { display: none; }
  .aut-card-btn { padding: 7px 9px; }
}
.aut-card-btn {
  border: 1px solid var(--line); background: #fff;
  padding: 6px 12px; border-radius: 7px; cursor: pointer;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: all 0.12s;
}
.aut-card-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.aut-card-btn:active { transform: translateY(0); }
.aut-card-btn.aut-btn-cancel {
  color: #b87100; border-color: #ffd591;
  background: linear-gradient(180deg, #fff9eb 0%, #fff2d3 100%);
}
.aut-card-btn.aut-btn-cancel:hover {
  background: #ffe9b5; border-color: #ffab00;
}
.aut-card-btn.aut-btn-stop {
  color: #fff; border-color: #d76e00;
  background: linear-gradient(180deg, #ff9526 0%, #e07f0a 100%);
  font-weight: 600;
}
.aut-card-btn.aut-btn-stop:hover {
  background: linear-gradient(180deg, #ff8a14 0%, #c66f08 100%);
}
.aut-card-btn.aut-btn-delete {
  color: #6b7180; border-color: var(--line);
}
.aut-card-btn.aut-btn-delete:hover {
  color: #c4302b; border-color: #f5b7b7; background: #fdf0f0;
}
.aut-status-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; letter-spacing: 0.04em;
}
.aut-status-badge.scheduled { background: #e8eaf5; color: #4d56a8; }
.aut-status-badge.active { background: #ffce69; color: #6b4500; }
.aut-status-badge.done { background: #d6dbe5; color: #4a4f5a; }
.aut-status-badge.error { background: #ffcfcf; color: #8a1f1f; }
.aut-status-badge.cancelled { background: #e0e0e0; color: #7a7a7a; }
.aut-card-empty {
  text-align: center; padding: 40px 12px;
  color: #9aa0ad; font-size: 13px; font-style: italic;
}
.aut-empty {
  text-align: center; padding: 40px 16px;
  background: linear-gradient(180deg, #fafbfd 0%, #f5f6fa 100%);
  border: 1px dashed var(--line); border-radius: 12px;
}
.aut-empty-icon {
  font-size: 48px; margin-bottom: 12px;
  filter: grayscale(0.3); opacity: 0.6;
}
.aut-empty-title {
  font-size: 15px; font-weight: 600; color: #4a4f5a;
  margin-bottom: 6px;
}
.aut-empty-sub {
  font-size: 13px; color: #6b7180; max-width: 340px;
  margin: 0 auto; line-height: 1.5;
}
.aut-empty-sub b { color: var(--orange); }

/* ── Stan rzeczywisty na lodówkach ────────────────────────────────────── */
.promo-aut-state-box {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; margin-top: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.promo-aut-state-box h3 { margin: 0; font-size: 16px; }

.aut-state-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 16px;
}

.aut-fridge-card {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.aut-fridge-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.aut-fridge-card.has-images { border-color: #d4dcef; }
.aut-fridge-card.has-error {
  background: linear-gradient(180deg, #fdf0f0 0%, #f9e2e2 100%);
  border-color: #f5b7b7;
}
.aut-fridge-card.empty { opacity: 0.7; }

.aut-fridge-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.aut-fridge-card-icon {
  font-size: 20px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #e6ecfa 0%, #d4dcef 100%);
  border-radius: 9px;
}
.aut-fridge-card-titles { flex: 1; min-width: 0; }
.aut-fridge-card-code {
  font-weight: 700; font-size: 14px; color: var(--ink);
  font-family: ui-monospace, SF Mono, monospace;
}
.aut-fridge-card-name {
  font-size: 11px; color: #6b7180;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aut-fridge-card-count {
  background: #fff; color: #4d56a8;
  font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid #d4dcef;
  flex-shrink: 0; min-width: 28px; text-align: center;
}
.has-images .aut-fridge-card-count {
  background: linear-gradient(180deg, #ffce69 0%, #ffab00 100%);
  color: #6b4500; border-color: #ffab00;
}
.has-error .aut-fridge-card-count {
  background: #ffcfcf; color: #8a1f1f; border-color: #f5b7b7;
}

.aut-fridge-card-error {
  font-size: 11px; color: #c4302b;
  padding: 6px 8px; background: rgba(255,255,255,0.5); border-radius: 6px;
}
.aut-fridge-card-empty {
  font-size: 11px; color: #9aa0ad; font-style: italic;
  padding: 12px; text-align: center;
  background: rgba(0,0,0,0.02); border-radius: 8px;
}
.aut-fridge-card-images {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ── Auto-promo (3rd sub-tab w Reklamy) ─────────────────────────────── */
.auto-promo-toggle {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 16px; padding: 12px 14px;
  background: linear-gradient(180deg, #fafbfd 0%, #f1f3f8 100%);
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; user-select: none;
}
.auto-promo-toggle input[type="checkbox"] { display: none; }
.auto-promo-toggle-slider {
  width: 36px; height: 20px; border-radius: 999px;
  background: #d6dbe5; position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.auto-promo-toggle-slider::after {
  content: ""; position: absolute;
  top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.auto-promo-toggle input[type="checkbox"]:checked ~ .auto-promo-toggle-slider {
  background: linear-gradient(180deg, #ff9526 0%, #e07f0a 100%);
}
.auto-promo-toggle input[type="checkbox"]:checked ~ .auto-promo-toggle-slider::after {
  transform: translateX(16px);
}
.auto-promo-toggle-label {
  font-weight: 600; font-size: 14px; color: var(--ink);
  flex: 1;
}
.auto-promo-toggle.compact {
  margin-bottom: 12px; padding: 10px 12px;
  background: #fff;
}
.auto-promo-toggle.compact .auto-promo-toggle-label {
  font-size: 13px; font-weight: 500;
  display: flex; flex-direction: column; gap: 2px;
}
.auto-promo-toggle-hint {
  font-size: 11px; font-weight: 400; color: #6b7180;
}

.auto-promo-sliders .meta { margin-bottom: 12px; }
.auto-promo-sliders input[type="range"] { width: 100%; }

.auto-promo-advanced {
  margin: -4px 0 14px; padding: 12px 14px;
  background: #fafbfd; border: 1px solid var(--line); border-radius: 10px;
}
.auto-promo-advanced > summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: #6b7180;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.auto-promo-advanced .meta { margin-top: 12px; margin-bottom: 8px; }

.auto-promo-tick-info {
  padding: 10px 12px; margin-bottom: 12px;
  background: #f1f3f8; border-radius: 8px;
  font-size: 12px; color: #4a4f5a;
}
.auto-promo-tick-info b { color: var(--ink); }
.auto-promo-tick-info.disabled {
  background: #fdf0f0; color: #8a1f1f;
}

.auto-promo-state-filter { margin-bottom: 12px; }
.auto-promo-state-filter select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; background: #fff;
}

.ap-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; background: #fff;
  font-size: 12px;
}
.ap-card.status-generated { background: #f1faf4; border-color: #b6dec5; }
.ap-card.status-waiting_for_image { background: #fffaeb; border-color: #ffe1a0; }
.ap-card.status-error { background: #fdf0f0; border-color: #f5b7b7; }

.ap-card-thumb {
  width: 48px; height: 86px; flex-shrink: 0;
  border-radius: 6px; background: #eee; object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ap-card-thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; opacity: 0.4; background: #f4f4f8;
}
.ap-card-body { flex: 1; min-width: 0; }
.ap-card-name {
  font-weight: 600; font-size: 13px; color: var(--ink);
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-card-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 11px; color: #6b7180;
}
.ap-card-error {
  font-size: 11px; color: #c4302b; margin-top: 4px;
}
.ap-status-pill {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  letter-spacing: 0.04em;
}
.ap-status-pill.generated { background: #d6f5e1; color: #1f7a3d; }
.ap-status-pill.waiting_for_image { background: #ffe9b5; color: #6b4500; }
.ap-status-pill.error { background: #ffcfcf; color: #8a1f1f; }
.ap-status-pill.processing {
  background: linear-gradient(90deg, #e8eaf5 0%, #d4d9f0 50%, #e8eaf5 100%);
  background-size: 200% 100%; color: #3d479f;
  animation: ap-shimmer 1.6s linear infinite;
}
@keyframes ap-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.ap-card.status-processing {
  background: linear-gradient(180deg, #f0f3fb 0%, #e6ebf7 100%);
  border-color: #c8cee5;
}
.ap-progress-line {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; padding: 6px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 6px;
  font-size: 11px; color: #3d479f; font-weight: 500;
}
.ap-progress-spinner {
  width: 12px; height: 12px;
  border: 2px solid #c8cee5;
  border-top-color: #3d479f;
  border-radius: 50%;
  animation: ap-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes ap-spin {
  to { transform: rotate(360deg); }
}

/* ── Modal Nowy produkt SL — pełen redesign ─────────────────────────── */
.sl-modal {
  max-width: 1100px; width: 95vw;
  max-height: 92vh;
  padding: 0;
  display: flex; flex-direction: column;
  background: #fff;
}

.sl-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px;
  background: linear-gradient(180deg, #fff 0%, #fafbfd 100%);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sl-modal-title {
  display: flex; align-items: center; gap: 14px;
}
.sl-modal-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px;
  line-height: 1;
  background: linear-gradient(135deg, #ffd991 0%, #ff9526 100%);
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(255, 149, 38, 0.32);
  color: #fff;
}
.sl-modal-title h3 { margin: 0; font-size: 18px; font-weight: 700; }
.sl-modal-sub {
  font-size: 12px; color: #6b7180; margin-top: 2px;
}

.sl-modal-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  flex: 1; overflow: hidden;
  min-height: 0;
}
@media (max-width: 900px) {
  .sl-modal-body { grid-template-columns: 1fr; }
}

.sl-modal-form {
  padding: 22px 26px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.sl-modal-side {
  padding: 22px 22px 22px 0;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #fafbfd 0%, #f1f3f8 100%);
  overflow-y: auto;
}
@media (max-width: 900px) {
  .sl-modal-side { border-left: none; border-top: 1px solid var(--line); padding: 22px 26px; }
}

/* Sekcje formularza */
.sl-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  /* Parent .sl-modal-form to flex column z overflow:auto. Bez flex-shrink:0
     collapsed <details> sekcje są ściskane do ~2px (flexbox ucina nawet
     widoczność summary) — i header znika. Wymuszamy żeby summary + body
     zawsze zajmowały swój content-height; scroll obsługuje parent. */
  flex-shrink: 0;
}
/* Tylko zamknięte mogą crop'ować arrow (border-radius); otwarte muszą pokazać body bez wycinania. */
.sl-section-collapsible:not([open]) { overflow: hidden; }
.sl-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff 0%, #fafbfd 100%);
  border-bottom: 1px solid var(--line);
}
.sl-section-head h4 { margin: 0; font-size: 14px; font-weight: 600; }
.sl-section-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: #f1f3f8;
  border-radius: 8px;
}
.sl-section-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 600; color: #6b7180;
  background: #f1f3f8;
  padding: 3px 9px; border-radius: 999px;
}
.sl-section-badge.complete {
  background: #d6f5e1; color: #1f7a3d;
}
.sl-section-opt {
  margin-left: auto;
  font-size: 10px; color: #9aa0ad;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sl-section-arrow {
  font-size: 11px; opacity: 0.5;
  transition: transform 0.2s;
  margin-left: 6px;
}
.sl-section-collapsible[open] .sl-section-arrow { transform: rotate(180deg); }
.sl-section-collapsible > summary { list-style: none; cursor: pointer; user-select: none; }
.sl-section-collapsible > summary::-webkit-details-marker { display: none; }
.sl-section-collapsible > summary:hover { background: linear-gradient(180deg, #fafbfd 0%, #f1f3f8 100%); }

.sl-section-body {
  padding: 16px;
}

/* Pola */
.sl-modal-form .meta { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.sl-modal-form .meta > span {
  font-size: 11px; font-weight: 600; color: #4a4f5a;
  display: flex; align-items: center; gap: 5px;
}
.sl-modal-form input[type="text"],
.sl-modal-form input[type="number"],
.sl-modal-form select,
.sl-modal-form textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit;
  background: #fff;
  width: 100%; box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sl-modal-form input:focus, .sl-modal-form select:focus, .sl-modal-form textarea:focus {
  border-color: var(--orange); outline: none;
  box-shadow: 0 0 0 3px rgba(255,171,0,0.13);
}
.sl-row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px;
}
.sl-modal-form textarea { resize: vertical; min-height: 60px; }

/* Atrybuty EAN grid */
.sl-attr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 600px) { .sl-attr-grid { grid-template-columns: 1fr; } }
.sl-attr-grid .meta > span {
  text-transform: uppercase; letter-spacing: 0.03em;
}

/* Nutri */
.sl-nutri-mode {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.sl-radio { display: inline-flex; align-items: center; cursor: pointer; }
.sl-radio input { display: none; }
.sl-radio-pill {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 500; color: #4a4f5a;
  transition: all 0.12s;
}
.sl-radio:hover .sl-radio-pill { border-color: var(--orange); }
.sl-radio input:checked + .sl-radio-pill {
  background: linear-gradient(180deg, #ff9526 0%, #e07f0a 100%);
  color: #fff; border-color: #d76e00;
  font-weight: 600;
}
.sl-serving-input {
  flex-direction: row; align-items: center; gap: 8px;
  margin-left: auto !important;
}
.sl-serving-input > span { white-space: nowrap; }
.sl-serving-input input { width: 80px; padding: 6px 10px; }

.sl-nutri-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.sl-input-suffix {
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.sl-input-suffix:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,171,0,0.13);
}
.sl-input-suffix input {
  border: none !important; padding: 8px 11px !important;
  flex: 1; box-shadow: none !important;
}
.sl-input-suffix input:focus { box-shadow: none !important; }
.sl-input-suffix > span {
  padding: 0 10px; font-size: 11px; color: #6b7180;
  background: #f1f3f8; align-self: stretch;
  display: flex; align-items: center;
  border-left: 1px solid var(--line);
}

/* Chips alergenów / badges */
.sl-rich-label {
  font-size: 11px; font-weight: 600; color: #4a4f5a;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.sl-chip-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.sl-chip {
  cursor: pointer; user-select: none;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 12px; color: #4a4f5a;
  transition: all 0.12s;
}
.sl-chip:hover { border-color: var(--orange); color: var(--ink); }
.sl-chip input[type="checkbox"] { display: none; }
.sl-chip.checked {
  background: linear-gradient(180deg, #ff9526 0%, #e07f0a 100%);
  border-color: #d76e00;
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 6px rgba(224, 127, 10, 0.25);
}

/* ── Global full-screen loader ─────────────────────────────────────── */
.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20, 25, 56, 0.32);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  animation: pl-fade-in 0.15s ease-out;
}
.page-loader[hidden] { display: none !important; }
@keyframes pl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.page-loader-box {
  background: #fff;
  border-radius: 14px;
  padding: 22px 28px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
}
.page-loader-spinner {
  width: 28px; height: 28px;
  border: 3px solid #f1f3f8;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: pl-spin 0.8s linear infinite;
}
@keyframes pl-spin { to { transform: rotate(360deg); } }
.page-loader-label {
  font-size: 14px; font-weight: 500; color: var(--ink);
}

/* Uploader zdjęcia produktu (side panel, nad EAN preview) */
.sl-image-card {
  background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.sl-image-card .sl-ean-card-head { margin-bottom: 10px; }

.sl-image-drop {
  width: 100%; aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #fafbfd 0%, #f1f3f8 100%);
  border: 2px dashed #c8cee5; border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit; color: #6b7180;
}
.sl-image-drop:hover {
  background: linear-gradient(135deg, #fff5e0 0%, #ffe9b5 100%);
  border-color: var(--orange);
  color: #6b4500;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 171, 0, 0.18);
}
.sl-image-drop-plus {
  font-size: 48px; line-height: 1; font-weight: 300;
  color: #b0b6c4;
  transition: color 0.15s, transform 0.2s;
}
.sl-image-drop:hover .sl-image-drop-plus {
  color: var(--orange);
  transform: scale(1.1) rotate(90deg);
}
.sl-image-drop-text {
  font-size: 13px; font-weight: 500; text-align: center;
  line-height: 1.4;
}
.sl-image-drop-text .muted { font-size: 11px; opacity: 0.7; }

.sl-image-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfd;
  border: 1px solid var(--line);
}
.sl-image-preview img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  display: block;
  background: #fff;
}
.sl-image-actions {
  display: flex; gap: 6px;
  padding: 8px;
  background: #fafbfd;
  border-top: 1px solid var(--line);
}
.sl-image-actions .btn { flex: 1; font-size: 11px; padding: 5px 8px; }
.sl-image-actions .btn.danger:hover {
  background: #fdf0f0; color: #c4302b; border-color: #f5b7b7;
}
.sl-image-name {
  font-size: 11px; color: #6b7180;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  background: #fff;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Sticky EAN preview po prawej */
.sl-ean-card {
  background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 20px;
  position: sticky; top: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.sl-ean-card-head {
  font-size: 10px; font-weight: 700; color: #6b7180;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.sl-ean-value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 26px; font-weight: 700;
  letter-spacing: 0.05em;
  color: #c8cee5;
  margin-bottom: 14px;
  text-align: center;
  padding: 14px;
  background: #fafbfd;
  border-radius: 10px;
  border: 2px dashed var(--line);
  transition: all 0.2s;
}
.sl-ean-value.ready {
  color: #fff;
  background: linear-gradient(135deg, #ff9526 0%, #e07f0a 50%, #ff7a00 100%);
  border-style: solid; border-color: #d76e00;
  box-shadow: 0 4px 14px rgba(224, 127, 10, 0.3);
}

/* Karta EAN oryginalny — pod generated EAN, nie-sticky, takie same border/padding */
.sl-ean-orig-card {
  position: static;
  margin-top: 14px;
}
.sl-ean-card-opt {
  font-size: 9px; font-weight: 600; color: #9aa0ad;
  letter-spacing: 0.04em; margin-left: 6px;
  text-transform: lowercase;
}
.sl-ean-orig-input {
  width: 100%; box-sizing: border-box;
  padding: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  border: 2px dashed var(--line); border-radius: 10px;
  background: #fafbfd; color: #2a2d36;
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.sl-ean-orig-input::placeholder {
  color: #c8cee5; font-weight: 600;
}
.sl-ean-orig-input:focus {
  border-color: var(--orange); border-style: solid;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,171,0,0.13);
}
.sl-ean-orig-input.has-value {
  border-style: solid; border-color: #d76e00;
  color: #c95e00; background: #fff8eb;
}
.sl-ean-breakdown {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 12px;
  justify-content: center;
}
.sl-ean-breakdown:empty { display: none; }
.sl-ean-breakdown .ean-chip {
  min-width: 32px; padding: 3px 5px;
}
.sl-ean-breakdown .ean-chip .d { font-size: 13px; }
.sl-ean-breakdown .ean-chip .l { font-size: 8px; }
.sl-ean-status {
  font-size: 12px; color: #9aa0ad;
  padding: 8px 10px;
  background: #f1f3f8; border-radius: 7px;
  text-align: center;
}
.sl-ean-status.ready {
  background: #d6f5e1; color: #1f7a3d; font-weight: 600;
}

/* Footer */
.sl-modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: #fafbfd;
  flex-shrink: 0;
  gap: 16px;
}
.sl-foot-actions { display: flex; gap: 8px; }
.sl-foot-actions .btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: #4a4f5a;
}
.sl-foot-actions .btn.ghost:hover {
  background: #fafafa; border-color: #b3b8c5;
}
.sl-foot-actions .btn.primary {
  padding: 10px 18px;
  background: linear-gradient(180deg, #ff9526 0%, #e07f0a 100%);
  border: 1px solid #d76e00;
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(224, 127, 10, 0.22);
}
.sl-foot-actions .btn.primary:disabled {
  background: #e0e0e0;
  border-color: #ccc;
  color: #999;
  box-shadow: none;
  cursor: not-allowed;
}
.sl-foot-actions .btn.primary:not(:disabled):hover {
  background: linear-gradient(180deg, #ff8a14 0%, #c66f08 100%);
  transform: translateY(-1px);
}
.sl-push-toggle {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  font-size: 13px;
}
.sl-push-toggle input[type="checkbox"] { display: none; }
.sl-push-toggle-slider {
  width: 36px; height: 20px; border-radius: 999px;
  background: #d6dbe5; position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.sl-push-toggle-slider::after {
  content: ""; position: absolute;
  top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.sl-push-toggle input:checked ~ .sl-push-toggle-slider {
  background: linear-gradient(180deg, #ff9526 0%, #e07f0a 100%);
}
.sl-push-toggle input:checked ~ .sl-push-toggle-slider::after {
  transform: translateX(16px);
}

.sl-banner { margin: 0 26px; }

/* ── Kolumna "Obrazek" w tabeli Katalog (upload z dysku) ─────────────── */
.catalog-table th.cat-img-col,
.catalog-table td.cat-img-col {
  width: 56px; padding: 6px 8px; text-align: center;
}
.cat-img-wrap {
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; cursor: pointer;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, transform 0.1s;
}
.cat-img-wrap:hover { border-color: var(--orange); transform: scale(1.05); }
.cat-img-wrap img {
  width: 100%; height: 100%; object-fit: contain;
}
.cat-img-wrap.cat-img-broken {
  background: #fafbfd; color: #b00; font-size: 14px;
}
.cat-img-wrap.cat-img-broken::after {
  content: "⚠"; display: block;
}
.cat-img-add {
  width: 40px; height: 40px;
  border: 1px dashed var(--line); background: #fafbfd;
  border-radius: 6px; cursor: pointer;
  color: #9aa0ad; font-size: 20px; font-weight: 300;
  transition: all 0.15s;
}
.cat-img-add:hover {
  border-color: var(--orange); border-style: solid;
  color: var(--orange); background: #fff;
}

/* ── Sekcja "Obrazki produktów (Frisco)" w Katalogu ──────────────────── */
.prodimg-section {
  background: linear-gradient(180deg, #fafbfd 0%, #f5f6fa 100%);
  border: 1px solid var(--line); border-radius: 12px;
  margin: 14px 0;
  overflow: hidden;
}
.prodimg-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; cursor: pointer; user-select: none;
  list-style: none; outline: none;
}
.prodimg-summary::-webkit-details-marker { display: none; }
.prodimg-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fff5e0 0%, #ffe2b0 100%);
  border-radius: 8px; font-size: 16px;
}
.prodimg-title { font-weight: 600; font-size: 14px; }
.prodimg-counts {
  margin-left: auto;
  font-size: 12px; font-weight: 500; color: #6b7180;
  background: #fff; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line);
}
.prodimg-arrow { font-size: 10px; opacity: 0.5; transition: transform 0.2s; }
.prodimg-section[open] .prodimg-arrow { transform: rotate(180deg); }

.prodimg-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.prodimg-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid #eef0f3;
  margin-bottom: 14px;
}
.prodimg-toolbar .spacer { flex: 1; }
.prodimg-toolbar select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; background: #fff;
}

.prodimg-empty {
  text-align: center; padding: 30px 12px;
  color: #9aa0ad; font-size: 13px; font-style: italic;
}

.prodimg-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 12px;
  transition: box-shadow 0.15s;
}
.prodimg-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.prodimg-card.status-ok { background: linear-gradient(180deg, #f1faf4 0%, #e6f5ed 100%); border-color: #b6dec5; }
.prodimg-card.status-empty { opacity: 0.6; }

.prodimg-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px; gap: 12px;
}
.prodimg-card-code {
  font-family: ui-monospace, SF Mono, monospace;
  font-size: 11px; color: #6b7180; font-weight: 600;
  letter-spacing: 0.02em;
}
.prodimg-card-name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  margin-top: 2px;
}
.prodimg-card-actions {
  display: flex; gap: 6px; align-items: flex-start; flex-shrink: 0;
}
.prodimg-card-empty {
  font-size: 12px; color: #9aa0ad; font-style: italic;
  margin-top: 6px;
}
.prodimg-card-accepted-img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  margin-right: 14px; float: left;
}
.prodimg-card-source {
  font-size: 11px; color: #6b7180;
  word-break: break-all; margin-top: 4px;
}

.prodimg-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.prodimg-tile {
  background: #fafbfd; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
  transition: all 0.12s;
}
.prodimg-tile:hover { background: #fff; border-color: var(--orange); }
.prodimg-tile-thumb {
  width: 100%; aspect-ratio: 1;
  background: #fff; border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.prodimg-tile-thumb img {
  width: 100%; height: 100%; object-fit: contain;
}
.prodimg-tile-name {
  font-size: 12px; font-weight: 500; color: var(--ink);
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.prodimg-tile-meta {
  font-size: 10px; color: #6b7180;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.prodimg-tile .btn.small { padding: 5px 10px; font-size: 11px; }
.aut-state-img {
  position: relative;
  width: 88px; height: 156px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: #f4f4f8;
  display: flex; flex-direction: column;
}
.aut-state-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.aut-state-img-tag {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.04em;
}
.aut-state-img-tag.known { background: #2c7a3d; }
.aut-state-img-tag.foreign { background: #b87100; }
.aut-state-img-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.95); color: #c4302b;
  border: none; border-radius: 50%; cursor: pointer;
  font-size: 14px; line-height: 1; font-weight: 700;
  display: none;
  align-items: center; justify-content: center;
}
.aut-state-img:hover .aut-state-img-remove { display: flex; }
.aut-state-img-remove:hover { background: #c4302b; color: #fff; }
.promo-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.promo-preview-box {
  background: #f4f4f8; border-radius: 10px; min-height: 480px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.promo-preview-img { max-width: 100%; max-height: 70vh; display: block; border-radius: 4px; }
.promo-preview-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }
.promo-history { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; }
.promo-history > summary { cursor: pointer; padding: 6px 0; }

/* ============= Planogram — Sticky pasek (nazwa + daty + akcje) — PRZYKLEJONY DO GÓRY ============= */
.planogram-sticky-bar {
  position: sticky;
  top: 80px;  /* topbar 66px + 14px breathing room */
  z-index: 60;
  background: var(--card);
  border: 2px solid var(--orange);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  /* Pomarańczowa poświata + cień głębi = wyróżnia się od reszty */
  box-shadow: 0 4px 14px rgba(31, 34, 65, 0.10),
              0 0 0 1px rgba(255, 177, 66, 0.18),
              0 4px 18px rgba(255, 177, 66, 0.18);
}
.psb-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.psb-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.psb-fridge { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.psb-plan-name { font-size: 18px; font-weight: 800; color: var(--text); }
.psb-sep { color: var(--line); }
.psb-status-badge {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 3px 8px; border-radius: 6px;
}
.psb-status-badge.active { background: var(--green-bg); color: var(--green); }
.psb-status-badge.future { background: var(--blue-bg); color: var(--blue); }
.psb-status-badge.past { background: var(--soft); color: var(--muted); }
.psb-line2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.psb-dates { font-weight: 600; color: var(--text); }
.psb-meta { color: var(--muted); }
.psb-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

/* ============= Planogram + Kalendarz (FullCalendar 6) ============= */
.planogram-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 18px;
  margin-top: 14px;
  align-items: start;
}
.planogram-cal-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  position: sticky;
  top: 168px;  /* pod sticky topbar (80) + sticky planogram bar (~74px + 14px margin) */
  z-index: 50;
  box-shadow: 0 4px 14px rgba(31, 34, 65, 0.07);
}
.planogram-editor-pane { min-width: 0; order: 1; }
.planogram-cal-pane { order: 2; }
.planogram-cal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.planogram-cal-head .section-h { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
#planogramCalHint { font-size: 11px; color: var(--muted); }
.planogram-calendar { width: 100%; }
.planogram-selected-info {
  margin-top: 12px; padding: 10px 12px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px;
  font-size: 12.5px; color: var(--text);
  cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.08s;
  position: relative;
}
.planogram-selected-info:hover { background: #fff; border-color: var(--orange); }
.planogram-selected-info:active { transform: translateY(1px); }
.planogram-selected-info::after {
  content: "📋"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; opacity: 0.4; transition: opacity 0.15s;
}
.planogram-selected-info:hover::after { opacity: 1; }
.planogram-selected-info .psi-label { font-weight: 800; padding-right: 24px; display: block; }
.planogram-selected-info .psi-date { color: var(--muted); font-size: 12px; margin-top: 2px; padding-right: 24px; }
.planogram-selected-info.empty { color: var(--muted); }

/* FullCalendar override — pasuj do palety aplikacji */
.fc { font-family: inherit; font-size: 11px; }
.fc .fc-toolbar { gap: 4px; margin-bottom: 6px !important; flex-wrap: wrap; }
.fc .fc-toolbar-title { font-size: 13.5px !important; font-weight: 800; color: var(--text); }
.fc .fc-button {
  background: var(--soft) !important; border: 1px solid var(--line) !important;
  color: var(--text) !important; font-weight: 600 !important;
  padding: 3px 8px !important; border-radius: 7px !important; box-shadow: none !important;
  text-transform: none !important; font-size: 11px !important;
}
.fc .fc-button:hover { background: #ECEBF4 !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { background: var(--navy) !important; color: #fff !important; border-color: var(--navy) !important; }
.fc .fc-button-primary:disabled { opacity: 0.5; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--line); }
.fc-theme-standard .fc-scrollgrid { border-color: var(--line); border-radius: 10px; overflow: hidden; }
.fc .fc-col-header-cell { background: var(--soft); }
.fc .fc-col-header-cell-cushion { color: var(--muted); font-weight: 700; padding: 4px 2px; text-decoration: none; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.3px; }
.fc .fc-daygrid-day { background: #fff; cursor: pointer; transition: background 0.12s; }
.fc .fc-daygrid-day:hover { background: var(--soft); }
.fc .fc-daygrid-day.fc-day-today { background: #FFF6E5; }
.fc .fc-daygrid-day-number { color: var(--text); padding: 2px 4px; text-decoration: none; font-weight: 600; font-size: 11px; }
.fc .fc-daygrid-day.fc-day-other .fc-daygrid-day-number { color: #C9C8D6; }
.fc .fc-daygrid-day.fc-day-other { background: #FAFAFC; }
.fc-event { border: none !important; border-radius: 4px !important; padding: 1px 4px !important; font-weight: 700; cursor: pointer; box-shadow: 0 1px 3px rgba(31,34,65,0.12); font-size: 10px !important; }
.fc-event.planogram-event.active { background: var(--orange) !important; color: var(--navy) !important; border-color: var(--orange) !important; }
.fc-event-title { overflow: hidden; text-overflow: ellipsis; }

/* Tooltip nad eventem (custom — czysty CSS) */
.fc-event-tooltip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: var(--navy); color: #fff; padding: 8px 10px; border-radius: 8px;
  font-size: 12px; max-width: 240px; box-shadow: 0 8px 22px rgba(31,34,65,0.35);
  transform: translate(-50%, -100%); margin-top: -8px;
}
.fc-event-tooltip strong { display: block; font-size: 12.5px; margin-bottom: 2px; }
.fc-event-tooltip .ftt-dates { color: var(--orange-2); font-weight: 600; }

/* Notice — warn variant (brak planogramu) */
.notice.warn {
  background: #FFF4D9; border-color: #FFD37A; color: #7A5500;
}

/* Modal: niezapisane zmiany */
.dirty-modal-bg.open { display: flex; }
.dirty-modal {
  max-width: 480px;
  text-align: center;
  padding: 32px 32px 28px;
  border-top: 4px solid var(--orange);
}
.dirty-modal-icon { font-size: 48px; line-height: 1; margin-bottom: 6px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.dirty-modal-title { margin: 6px 0 10px; font-size: 20px; font-weight: 800; color: var(--text); }
.dirty-modal-msg { margin: 0 0 26px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.dirty-modal-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.dirty-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 18px; border-radius: 12px;
  border: 2px solid transparent; cursor: pointer; font-weight: 700;
  font-size: 14px; text-align: left;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.dirty-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31,34,65,0.10); }
.dirty-btn:active { transform: translateY(0); }
.dirty-btn-ico { font-size: 20px; flex-shrink: 0; }
.dirty-btn-label { flex: 1; }

.dirty-btn-save {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-2) 100%);
  color: var(--navy); border-color: var(--orange);
}
.dirty-btn-save:hover { background: linear-gradient(135deg, var(--orange-2) 0%, var(--orange) 100%); }

.dirty-btn-discard {
  background: #fff; color: var(--red); border-color: var(--red);
}
.dirty-btn-discard:hover { background: var(--red); color: #fff; }

.dirty-btn-stay {
  background: var(--soft); color: var(--text); border-color: var(--line);
}
.dirty-btn-stay:hover { background: #fff; border-color: var(--text); }

.btn.danger {
  background: var(--red); color: #fff; border: 1px solid var(--red);
}
.btn.danger:hover { background: #9F2E22; border-color: #9F2E22; }
/* Pulsacja ramki — przyciąga wzrok */
@keyframes dirty-pulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(31,34,65,0.20), 0 0 0 0 rgba(255,177,66,0.45); }
  50%      { box-shadow: 0 8px 28px rgba(31,34,65,0.20), 0 0 0 8px rgba(255,177,66,0); }
}
.dirty-modal-bg.open .dirty-modal { animation: dirty-pulse 1.4s ease-in-out infinite; }

/* Save button gdy są niezapisane zmiany — mocna pulsacja przyciągająca wzrok */
@keyframes save-dirty-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 177, 66, 0.6), 0 0 0 0 rgba(192, 57, 43, 0.0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(255, 177, 66, 0), 0 6px 22px rgba(255, 177, 66, 0.55);
    transform: scale(1.06);
  }
}
@keyframes save-dirty-bounce {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
#saveBtn.is-dirty {
  animation: save-dirty-pulse 1.4s ease-in-out infinite;
  background: linear-gradient(135deg, var(--orange) 0%, #FF9421 100%) !important;
  font-weight: 800 !important;
  border: 2px solid #FF8800 !important;
}

/* Picker — banner aktualnego stanu (gdy edytujemy istniejący slot) */
.picker-current-banner {
  background: linear-gradient(135deg, #FFF7EA 0%, #FFEBD0 100%);
  border: 2px solid var(--orange);
  border-radius: 12px; padding: 12px 16px;
  margin-bottom: 14px; display: flex; align-items: center; gap: 12px;
}
.picker-current-banner .pcb-ico { font-size: 28px; flex-shrink: 0; }
.picker-current-banner .pcb-text { flex: 1; min-width: 0; }
.picker-current-banner .pcb-label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.picker-current-banner .pcb-value { font-size: 14px; font-weight: 700; color: var(--navy); }
.picker-current-banner .pcb-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Picker — wiersz produktu ma 2 stany: default (Wstaw button) i expanded (qty + Potwierdź) */
.row-action-area {
  display: flex; align-items: center; flex-shrink: 0;
}
.row-insert-btn {
  background: var(--orange); color: var(--navy); border: 2px solid var(--orange);
  border-radius: 8px; padding: 8px 16px; cursor: pointer;
  font-weight: 800; font-size: 13px; line-height: 1;
  white-space: nowrap;
  transition: all 0.12s;
  min-width: 80px;
}
.row-insert-btn:hover { background: var(--orange-2); border-color: var(--orange-2); transform: translateY(-1px); }
.row-insert-btn:active { transform: translateY(0); }

.row-sub-toggle {
  background: #fff; color: var(--green); border: 2px solid var(--green);
  border-radius: 8px; padding: 7px 12px; cursor: pointer;
  font-weight: 700; font-size: 12px; line-height: 1; white-space: nowrap;
  margin-left: 6px; transition: all 0.12s;
}
.row-sub-toggle:hover { background: var(--green); color: #fff; }
.picker-product-row.is-substitute { background: #EAF7F0; box-shadow: inset 0 0 0 2px var(--green); border-radius: 8px; }
.picker-product-row.is-substitute .row-sub-toggle { background: var(--green); color: #fff; }

.row-qty-confirm {
  display: flex; align-items: center; gap: 6px;
}
.row-qty-confirm[hidden] { display: none; }
.row-qty-btn {
  width: 30px; height: 30px; border-radius: 7px;
  background: #fff; border: 2px solid var(--line); cursor: pointer;
  font-size: 16px; font-weight: 800; color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s; padding: 0; line-height: 1;
}
.row-qty-btn:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.row-qty-btn:active { transform: scale(0.92); }
.row-qty-input {
  width: 44px; height: 30px; border: 2px solid var(--line); border-radius: 7px;
  text-align: center; font-size: 14px; font-weight: 800; color: var(--navy); background: #fff;
  padding: 0;
}
.row-qty-input:focus { outline: none; border-color: var(--orange); }
.row-qty-input::-webkit-inner-spin-button,
.row-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.row-confirm-btn {
  background: var(--green); color: #fff; border: 2px solid var(--green);
  border-radius: 7px; padding: 6px 12px; cursor: pointer;
  font-weight: 800; font-size: 13px; line-height: 1; white-space: nowrap;
  transition: all 0.12s;
}
.row-confirm-btn:hover { background: #3DA868; border-color: #3DA868; transform: translateY(-1px); }
.picker-product-row.is-expanded,
.picker-any-row.is-expanded,
.picker-product-row.selected,
.picker-any-row.selected {
  background: #FFF6E5;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--orange);
}

/* Slot — wyraźne badge "Konkretny / Dowolny" w lewym górnym rogu.
   Tag ma swój pasek — slot dostaje padding-top żeby ikona kategorii pod
   spodem nie nachodziła na tag. */
.slot.filled { padding-top: 28px; }

/* Drag&drop — wizualne wskaźniki zamiany miejscami */
.slot[draggable="true"] { cursor: grab; }
.slot[draggable="true"]:active { cursor: grabbing; }
.slot.dragging { opacity: 0.35; transform: scale(0.96); }
.slot.drag-over {
  box-shadow: inset 0 0 0 3px var(--orange), 0 6px 18px rgba(255, 177, 66, 0.35);
  transform: scale(1.02);
  transition: transform 0.12s, box-shadow 0.12s;
}
.slot.filled .slot-type-tag {
  position: absolute; top: 6px; left: 6px;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 6px; border-radius: 4px;
}
.slot.filled.has-product .slot-type-tag {
  background: var(--green-bg); color: var(--green);
}
.slot.filled.any-product .slot-type-tag {
  background: var(--blue-bg); color: var(--blue);
}

/* Picker lodówki gdy są niezapisane zmiany — wyszarzony + kursor not-allowed */
#fridgeSelect:disabled {
  opacity: 0.55; cursor: not-allowed; background: var(--soft);
}
.fridge-picker[data-locked="true"] { cursor: not-allowed; }
.fridge-picker[data-locked="true"]::after {
  content: "🔒"; margin-left: 8px; font-size: 13px;
}
/* Nav items zablokowane gdy są niezapisane zmiany */
.nav-item.is-locked {
  opacity: 0.55; cursor: not-allowed;
  position: relative;
}
.nav-item.is-locked:hover::after {
  content: "Najpierw zapisz lub odrzuć zmiany w planogramie";
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--navy); color: #fff; padding: 6px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 500; white-space: nowrap; z-index: 1000;
  box-shadow: 0 6px 18px rgba(31,34,65,0.25);
}

/* Modal: day-action */
.day-action-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px; margin: 14px 0;
}
.day-action-btn {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; text-align: left; transition: all 0.15s;
}
.day-action-btn:hover { background: #fff; border-color: var(--orange); box-shadow: 0 2px 8px rgba(31,34,65,0.06); }
.day-action-btn.selected { background: #fff; border-color: var(--navy); box-shadow: 0 2px 10px rgba(31,34,65,0.12); }
.day-action-ico { font-size: 22px; line-height: 1; flex-shrink: 0; }
.day-action-text { flex: 1; min-width: 0; }
.day-action-title { font-weight: 800; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.day-action-sub { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.day-action-subpanel {
  margin-top: 14px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--soft);
}
.day-action-subpanel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.day-action-subpanel-head .btn { padding: 6px 12px; font-size: 12px; }
/* Wstecz button — widoczny kontur na białym tle subpanela */
.day-action-subpanel-head .btn.ghost {
  background: #fff; color: var(--navy); border: 1.5px solid var(--navy); font-weight: 700;
}
.day-action-subpanel-head .btn.ghost:hover { background: var(--navy); color: #fff; }
#dayActionStatus { margin-top: 10px; }
#dayActionStatus .notice { margin: 0; }

