/* veroframework PanelUi: słownik atrybutów PIM (pim-dictionary.js). Klasy fw-dict-*; kolory w zmiennych, tryb ciemny z systemu. */
.fw-dict, .fw-dict-drawer, .fw-dict-picker {
  --d-bg: #fff; --d-soft: #f6f8fc; --d-line: #e1e5ef; --d-line2: #eef1f6; --d-text: #1b2440; --d-muted: #5a647e; --d-accent: var(--fw-accent, #2563eb);
  --d-accent-soft: color-mix(in srgb, var(--d-accent) 10%, transparent); --d-bad: #b42318; --d-ok: #196746;
  font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--d-text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fw-dict, :root:not([data-theme="light"]) .fw-dict-drawer, :root:not([data-theme="light"]) .fw-dict-picker {
    --d-bg: #161b26; --d-soft: #1d2433; --d-line: #2c3547; --d-line2: #252d3d; --d-text: #e6eaf2; --d-muted: #9aa5bd; --d-bad: #f97066; --d-ok: #4ade80;
  }
}
:root[data-theme="dark"] .fw-dict, :root[data-theme="dark"] .fw-dict-drawer, :root[data-theme="dark"] .fw-dict-picker {
  --d-bg: #161b26; --d-soft: #1d2433; --d-line: #2c3547; --d-line2: #252d3d; --d-text: #e6eaf2; --d-muted: #9aa5bd; --d-bad: #f97066; --d-ok: #4ade80;
}
.fw-dict *, .fw-dict-drawer *, .fw-dict-picker * { box-sizing: border-box; }
/* Odporność na globalne style paneli produktów (np. table{min-width}, input{width:100%;margin-top}, label{display:block}). */
.fw-dict { container-type: inline-size; }
.fw-dict table, .fw-dict-drawer table { min-width: 0; }
.fw-dict input, .fw-dict select, .fw-dict textarea, .fw-dict-drawer input, .fw-dict-drawer select, .fw-dict-drawer textarea, .fw-dict-picker input { margin: 0; width: auto; }
.fw-dict input[type=checkbox], .fw-dict-drawer input[type=checkbox] { width: auto; }
.fw-dict label, .fw-dict-drawer label { margin: 0; color: inherit; }
.fw-dict th, .fw-dict-drawer th { text-transform: none; letter-spacing: 0; background: none; border-top: 0; }
.fw-dict td, .fw-dict-drawer td { font-size: 14px; }
.fw-dict textarea, .fw-dict-drawer textarea { font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; }
.fw-dict-head h2 { margin: 0 0 4px; font-size: 20px; }
.fw-dict-head p { margin: 0 0 10px; color: var(--d-muted); max-width: 72ch; }
.fw-dict-note { padding: 6px 10px; border-radius: 6px; background: var(--d-soft); display: inline-block; }
.fw-dict-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--d-line); margin: 0 0 12px; overflow-x: auto; }
.fw-dict-tabs button { appearance: none; border: 0; background: none; font: 600 14px/1.3 inherit; color: var(--d-muted); padding: 10px 14px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.fw-dict-tabs button.on { color: var(--d-accent); border-bottom-color: var(--d-accent); }
.fw-dict-tabs.small button { padding: 8px 10px; font-size: 13px; }
.fw-dict-status { min-height: 20px; margin: 0 0 8px; color: var(--d-ok); }
.fw-dict-status.bad { color: var(--d-bad); }
.fw-dict-layout { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 16px; align-items: start; }
.fw-dict-side { border: 1px solid var(--d-line); border-radius: 12px; padding: 12px; background: var(--d-bg); position: sticky; top: 8px; }
.fw-dict-side h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--d-muted); }
.fw-dict-groups { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fw-dict-groups.fixed { padding-bottom: 6px; border-bottom: 1px solid var(--d-line2); }
.fw-dict-group { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.fw-dict-group.on { background: var(--d-accent-soft); }
.fw-dict-group.dragging, .fw-dict-row.dragging, .fw-dict-value.dragging { opacity: .45; }
.fw-dict-group-pick { flex: 1; display: flex; justify-content: space-between; gap: 8px; appearance: none; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 7px 8px; border-radius: 8px; cursor: pointer; min-width: 0; }
.fw-dict-group-pick span { overflow-wrap: anywhere; }
.fw-dict-group-pick small { color: var(--d-muted); }
.fw-dict-group.on .fw-dict-group-pick { color: var(--d-accent); font-weight: 600; }
.fw-dict-group-add, .fw-dict-group-tools, .fw-dict-unit, .fw-dict-unit-new, .fw-dict-value-add { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fw-dict-group-add input, .fw-dict-group-tools input { flex: 1 1 120px; min-width: 0; }
.fw-dict-handle { appearance: none; border: 0; background: none; color: var(--d-muted); cursor: grab; font: 700 13px/1 inherit; letter-spacing: -2px; padding: 6px 4px; border-radius: 4px; }
.fw-dict-handle:focus-visible { outline: 2px solid var(--d-accent); }
.fw-dict input:not([type=checkbox]), .fw-dict select, .fw-dict textarea, .fw-dict-drawer input:not([type=checkbox]), .fw-dict-drawer select, .fw-dict-drawer textarea, .fw-dict-picker input {
  font: 14px/1.4 inherit; color: var(--d-text); background: var(--d-bg); border: 1px solid #bfc9dd; border-radius: 8px; padding: 8px 10px; max-width: 100%;
}
.fw-dict input:focus, .fw-dict select:focus, .fw-dict-drawer input:focus, .fw-dict-drawer select:focus, .fw-dict-drawer textarea:focus, .fw-dict-picker input:focus { outline: none; border-color: var(--d-accent); box-shadow: 0 0 0 3px var(--d-accent-soft); }
.fw-dict-btn { appearance: none; font: 600 13px/1.3 inherit; border: 1px solid #cbd3e4; border-radius: 8px; background: var(--d-bg); color: var(--d-text); cursor: pointer; padding: 8px 12px; white-space: nowrap; }
.fw-dict-btn:hover { border-color: var(--d-accent); }
.fw-dict-btn.primary { background: var(--d-accent); border-color: var(--d-accent); color: #fff; }
.fw-dict-btn.ghost { border-color: transparent; background: none; }
.fw-dict-btn.danger { color: var(--d-bad); }
.fw-dict-btn:disabled { opacity: .55; cursor: default; }
.fw-dict-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.fw-dict-bar input[type=search] { flex: 1 1 220px; }
.fw-dict-bar .primary { margin-left: auto; }
.fw-dict-main { min-width: 0; }
.fw-dict-scroll { overflow-x: auto; border: 1px solid var(--d-line); border-radius: 12px; background: var(--d-bg); }
.fw-dict-table { width: 100%; border-collapse: collapse; }
.fw-dict-table th { text-align: left; font-size: 12px; color: var(--d-muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--d-line); white-space: nowrap; }
.fw-dict-table td { padding: 9px 10px; border-bottom: 1px solid var(--d-line2); vertical-align: middle; }
.fw-dict-table tr:last-child td { border-bottom: 0; }
.fw-dict-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fw-dict-grip { width: 28px; padding-right: 0 !important; }
.fw-dict-row { cursor: pointer; }
.fw-dict-row:hover, .fw-dict-row:focus-visible { background: var(--d-soft); outline: none; }
.fw-dict-name strong, .fw-dict-table td strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.fw-dict-name small, .fw-dict-table td small { display: block; color: var(--d-muted); font-size: 12px; overflow-wrap: anywhere; }
.fw-dict-compact { display: none !important; }
.fw-dict-table tr.inherited td { color: var(--d-muted); }
.fw-dict-table tr.off strong { text-decoration: line-through; color: var(--d-muted); }
.fw-dict-table td.fw-dict-actions { text-align: right; width: 1%; white-space: nowrap; }
.fw-dict-empty { color: var(--d-muted); padding: 16px; text-align: center; }
.fw-dict-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; color: var(--d-muted); font-size: 13px; }
.fw-dict-hint { color: var(--d-muted); font-size: 13px; margin: 6px 0; }
.fw-dict-crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 0 12px; font-weight: 600; }
.fw-dict-crumbs .link { appearance: none; border: 0; background: none; color: var(--d-accent); font: inherit; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.fw-dict-shade { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 1000; }
.fw-dict-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--d-bg); z-index: 1001; display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(15, 23, 42, .18); }
.fw-dict-drawer > header, .fw-dict-drawer > footer { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.fw-dict-drawer > header { justify-content: space-between; border-bottom: 1px solid var(--d-line); }
.fw-dict-drawer > header h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.fw-dict-drawer > .fw-dict-tabs { padding: 0 12px; margin: 0; }
.fw-dict-drawer > footer { border-top: 1px solid var(--d-line); }
.fw-dict-drawer > footer .push { margin-left: auto; }
.fw-dict-drawer-body { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.fw-dict-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.fw-dict-field small { font-weight: 400; color: var(--d-muted); }
.fw-dict-field > input, .fw-dict-field > select, .fw-dict-field > textarea { width: 100%; font-weight: 400; }
.fw-dict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fw-dict-unit select { flex: 1 1 140px; }
.fw-dict-unit-new input { flex: 1 1 90px; min-width: 0; }
.fw-dict-check { display: flex; gap: 8px; align-items: center; }
.fw-dict-meta { color: var(--d-muted); font-size: 12px; margin: 0; }
.fw-dict-values > input[type=search] { width: 100%; margin: 6px 0; }
.fw-dict-value-add input, .fw-dict-value-add select { flex: 1 1 160px; }
.fw-dict-value-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--d-line); border-radius: 10px; }
.fw-dict-value { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--d-line2); }
.fw-dict-value:last-child { border-bottom: 0; }
.fw-dict-value-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr); gap: 6px; align-items: center; }
.fw-dict-value-main code { font-size: 12px; color: var(--d-muted); overflow-wrap: anywhere; }
.fw-dict-value-main input { width: 100%; padding: 6px 8px !important; }
.fw-dict-value-tr { grid-column: 2; display: flex; gap: 6px; }
.fw-dict-value-tr input { flex: 1; min-width: 0; font-size: 13px !important; }
.fw-dict-value small { color: var(--d-muted); white-space: nowrap; font-size: 12px; }
.fw-dict-sources h4 { margin: 8px 0 6px; font-size: 14px; }
.fw-dict-sources ul { margin: 0; padding-left: 18px; }
.fw-dict-sources li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 2px 0; }
.fw-dict-picker { width: min(560px, calc(100vw - 32px)); max-height: 80vh; border: 1px solid var(--d-line); border-radius: 12px; padding: 14px; background: var(--d-bg); }
.fw-dict-picker::backdrop { background: rgba(15, 23, 42, .35); }
.fw-dict-picker header { display: flex; justify-content: space-between; align-items: center; }
.fw-dict-picker header h3 { margin: 0; font-size: 16px; }
.fw-dict-picker > input { width: 100%; margin: 10px 0; }
.fw-dict-picker ul { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow: auto; }
.fw-dict-picker li button { width: 100%; text-align: left; appearance: none; border: 0; border-bottom: 1px solid var(--d-line2); background: none; color: inherit; font: inherit; padding: 8px 6px; cursor: pointer; }
.fw-dict-picker li button:hover, .fw-dict-picker li button:focus-visible { background: var(--d-soft); outline: none; }
.fw-dict-picker li small { display: block; color: var(--d-muted); font-size: 12px; }
@media (max-width: 760px) {
  .fw-dict-layout { grid-template-columns: minmax(0, 1fr); }
  .fw-dict-side { position: static; }
  .fw-dict-table .c-wide { display: none; }
  .fw-dict-compact { display: block !important; margin-top: 2px; }
  .fw-dict-bar .primary { margin-left: 0; }
  .fw-dict-bar select { flex: 1 1 140px; }
  .fw-dict-drawer > footer { flex-wrap: wrap; }
  .fw-dict-value-main { grid-template-columns: minmax(0, 1fr); }
  .fw-dict-value-tr { grid-column: 1; }
}

@container (max-width: 760px) {
  .fw-dict-layout { grid-template-columns: minmax(0, 1fr); }
  .fw-dict-side { position: static; }
  .fw-dict-table .c-wide { display: none; }
  .fw-dict-compact { display: block !important; margin-top: 2px; }
  .fw-dict-bar .primary { margin-left: 0; }
  .fw-dict-bar select { flex: 1 1 140px; }
}
