/* Прайс-лист: «гроссбух». Цены — просто цифры в строке; поле появляется под курсором и в фокусе,
   изменённая ячейка помечается шафрановым уголком, как в бухгалтерской таблице. Вкладки вместо пилюль,
   тёмная лента правок над таблицей, пересчёт цен — одной фразой в боковой панели. */
.pl-tools { display: grid; gap: 14px; padding: 16px 18px 0; }
.pl-search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pl-search-row .input { flex: 1 1 260px; min-width: 0; }
.pl-search-row .select { flex: 0 0 200px; }

/* вкладки-фильтры: подчёркивание, число — рядом с названием */
.pl-tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; border-bottom: 1px solid var(--border); }
.pl-tab { position: relative; padding: 8px 0 11px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.pl-tab .n { margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-tab:hover { color: var(--text); }
.pl-tab.on { color: var(--text); }
.pl-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--c-action); }
.pl-tab.bad .n { color: var(--bad); }
.pl-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ленты над таблицей */
.pl-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: 10px; border-left: 4px solid var(--c-action); background: var(--surface-2); color: var(--text); }
.pl-banner .grow { flex: 1 1 260px; font-weight: 600; }
.pl-banner .ico { color: var(--c-action); }
.pl-banner.warn { border-left-color: var(--warn); }

.pl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 14px 18px 0; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--c-hero); color: var(--c-on-hero); }
.pl-bar[hidden] { display: none; }
.pl-bar .stat { flex: 1 1 260px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pl-bar .stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pl-bar .stat .bad { color: #ff9b9b; font-weight: 650; }
.pl-bar .stat .soft { opacity: 0.7; font-size: 13px; }
.pl-bar .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-bar .btn { background: transparent; border-color: color-mix(in srgb, var(--c-on-hero) 28%, transparent); color: var(--c-on-hero); box-shadow: none; }
.pl-bar .btn:hover { background: color-mix(in srgb, var(--c-on-hero) 12%, transparent); }
.pl-bar .btn-primary { background: var(--c-action); border-color: transparent; color: var(--c-on-action); }
.pl-bar .btn[disabled] { opacity: 0.45; }

/* таблица */
.pl-wrap { overflow: auto; max-height: calc(100vh - 360px); min-height: 220px; margin-top: 6px; }
.pl-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.pl-table th { position: sticky; top: 0; z-index: 2; padding: 10px 10px 8px; background: var(--surface); border-bottom: 2px solid var(--text); font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: right; white-space: nowrap; }
.pl-table th small { display: block; font-weight: 500; opacity: 0.85; }
.pl-table th.l { text-align: left; }
.pl-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: right; }
.pl-table td.l { text-align: left; }
.pl-table tbody tr:hover td { background: color-mix(in srgb, var(--c-action) 4%, var(--surface)); }
.pl-table tr.sel td { background: color-mix(in srgb, var(--c-action) 9%, var(--surface)); }
.pl-table tr.dirty td:first-child { box-shadow: inset 3px 0 0 var(--c-action); }
.pl-pick { width: 40px; text-align: center !important; }
.pl-name { min-width: 220px; max-width: 420px; padding-left: 8px; }
.pl-name b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.pl-name small { color: var(--muted); }
.pl-cell { display: grid; gap: 0; min-width: 100px; }
.pl-cell.narrow { min-width: 76px; }
.pl-in { width: 100%; min-height: 34px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; cursor: text; transition: background 0.12s; }
.pl-in::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); font-weight: 400; }
.pl-in:hover { background: var(--surface-2); }
.pl-in:focus { outline: 0; background: var(--surface); box-shadow: inset 0 -2px 0 var(--c-action), 0 0 0 1px var(--border-strong); }
.pl-in.changed { background: linear-gradient(225deg, var(--c-action) 0 8px, transparent 8px), color-mix(in srgb, var(--c-action) 9%, var(--surface)); }
.pl-in.err { background: linear-gradient(225deg, var(--bad) 0 8px, transparent 8px), var(--bad-weak); color: var(--bad); }
.pl-hint { padding: 0 8px 3px; font-size: 11.5px; color: var(--muted); line-height: 1.25; text-align: right; font-variant-numeric: tabular-nums; }
.pl-hint:empty { display: none; }
.pl-hint.up { color: var(--good); }
.pl-hint.down { color: var(--bad); }
.pl-hint.err { color: var(--bad); font-weight: 600; }
.pl-hint.warn { color: var(--warn); font-weight: 600; }
.pl-gh { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.pl-gh::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--gc, var(--c-action)); }
.pl-more { display: flex; justify-content: center; padding: 12px; }

/* пересчёт цен: одна фраза */
.pl-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; font-size: 16px; margin-bottom: 8px; }
.pl-sentence .w { color: var(--muted); }
.pl-sentence select, .pl-sentence .pl-num { min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; }
.pl-sentence select { padding-right: 28px; cursor: pointer; }
.pl-sentence select:focus-visible, .pl-sentence .pl-num:focus-within { outline: 2px solid var(--c-action); outline-offset: 1px; }
.pl-sentence .pl-num { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; }
.pl-sentence .pl-num input { width: 84px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 20px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.pl-sentence .pl-num input:focus { outline: none; }
.pl-sentence .pl-num select { border: 0; min-height: 32px; background: var(--surface-2); }
.pl-steps2 { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 18px; }
.pl-steps2 button { padding: 0; border: 0; background: none; color: var(--brand-text); font: inherit; font-size: 13px; font-weight: 700; text-decoration: underline dotted; cursor: pointer; }
.pl-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.pl-line > .w { color: var(--muted); font-size: 14px; min-width: 130px; }
.pl-line select { min-height: 38px; padding: 0 28px 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 650; }
.pl-radio { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.pl-radio button { min-height: 38px; padding: 0 14px; border: 0; background: var(--surface); color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.pl-radio button + button { border-left: 1px solid var(--border-strong); }
.pl-radio button.on { background: var(--c-hero); color: var(--c-on-hero); }
.pl-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.pl-rate[hidden] { display: none; }
.pl-rate .note { flex: 1 1 100%; font-size: 13px; color: var(--muted); }
.pl-rate .input { width: 110px; }
.pl-preview { margin-top: 6px; border-top: 2px solid var(--text); }
.pl-preview h4 { margin: 10px 0 4px; font-size: 15px; }
.pl-prow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pl-prow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-prow .was { color: var(--muted); text-decoration: line-through; text-align: right; }
.pl-prow .arrow { color: var(--muted); }
.pl-prow .now { font-weight: 800; text-align: right; }
.pl-d { font-size: 12px; font-weight: 700; text-align: right; min-width: 70px; }
.pl-d.up { color: var(--good); }
.pl-d.down { color: var(--bad); }
.pl-warn { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 13px; color: var(--warn); }
.pl-warn.bad { color: var(--bad); }
.pl-sched { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.pl-sched .full { grid-column: 1 / -1; }
.pl-note { font-size: 13px; }

/* группы покупателей */
.pl-glead { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.pl-glist { margin-bottom: 14px; }
.pl-grow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pl-gdot { flex: none; width: 14px; height: 36px; border-radius: 4px; background: var(--gc, var(--c-action)); }
.pl-grow .info { flex: 1; min-width: 0; }
.pl-grow .info b { display: block; font-size: 15px; }
.pl-grow .info small { color: var(--muted); }
.pl-grow .acts { display: flex; gap: 2px; }
.pl-new { display: grid; gap: 10px; padding-top: 4px; }
.pl-new .row, .pl-editrow { display: flex; gap: 8px; align-items: center; }
.pl-new .row .input { flex: 1; min-width: 0; }
.pl-swatches { display: flex; align-items: center; gap: 8px; }
.pl-sw { width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; background: var(--c); cursor: pointer; display: grid; place-items: center; color: #fff; padding: 0; }
.pl-sw .ico { width: 13px; height: 13px; }
.pl-sw.on { border-color: var(--text); }
.pl-sw:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pl-mt { margin-top: 8px; }
.pl-text { width: 100%; font-family: inherit; }

.ico.flip { transform: scaleY(-1); }
@media (max-width: 760px) {
  .pl-sched { grid-template-columns: 1fr; }
  .pl-search-row .select { flex: 1 1 100%; }
  .pl-prow { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pl-prow .was, .pl-prow .arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pl-in { transition: none; } }
