/* Price Editor — scoped styles */
.pe-body { margin: 0; background: #0f172a; color: #e2e8f0; font: 14px/1.4 system-ui, sans-serif; }
.pe-header { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #1e293b; border-bottom: 1px solid #334155; }
.pe-header h1 { font-size: 1rem; margin: 0; flex: 1; }
.pe-back { color: #60a5fa; text-decoration: none; font-size: .85rem; }
.pe-user { font-size: .8rem; color: #94a3b8; }
.pe-role { margin-left: 6px; padding: 2px 8px; background: #334155; border-radius: 4px; text-transform: uppercase; font-size: .7rem; }

.pe-main { max-width: 1400px; margin: 0 auto; padding: 20px; }
.pe-panel { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.pe-panel h2 { margin: 0 0 12px; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.pe-badge { font-size: .65rem; padding: 2px 6px; background: #7c3aed; border-radius: 4px; text-transform: uppercase; }

.pe-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pe-row label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: #94a3b8; }
.pe-row input, .pe-row select { background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 4px; padding: 6px 10px; font-size: .85rem; }
.pe-hint { color: #64748b; font-size: .78rem; }

.pe-assign-grid, .pe-editor-grid { display: grid; gap: 16px; }
.pe-assign-grid { grid-template-columns: 1fr 1fr; }
.pe-editor-grid { grid-template-columns: 320px 1fr; }
.pe-col h3 { font-size: .85rem; margin: 0 0 8px; color: #cbd5e1; }
.pe-col input[type=text] { width: 100%; background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 4px; padding: 6px 10px; margin-bottom: 6px; }

.pe-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; background: #0f172a; border: 1px solid #334155; border-radius: 4px; }
.pe-list li { padding: 6px 10px; border-bottom: 1px solid #1e293b; font-size: .82rem; }
.pe-list li:last-child { border-bottom: none; }
.pe-list-selectable li { cursor: pointer; }
.pe-list-selectable li:hover { background: #1e293b; }
.pe-list-selectable li.active { background: #2563eb; color: #fff; }
.pe-list li.dim { opacity: .45; }
.pe-list li.assigned { cursor: pointer; color: #22d3ee; }
.pe-list li.assigned:hover { background: #334155; }
.pe-empty { color: #64748b; font-style: italic; padding: 10px; }

.pe-product-detail { background: #0f172a; border: 1px solid #334155; border-radius: 4px; padding: 16px; min-height: 300px; }
.pe-empty-pane { color: #64748b; text-align: center; padding: 40px 20px; font-style: italic; }
.pe-detail-head h3 { margin: 0 0 4px; }
.pe-meta { color: #64748b; font-size: .75rem; margin-bottom: 14px; }
.pe-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #334155; }
.pe-form label { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; color: #94a3b8; }
.pe-form input, .pe-form select { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 4px; padding: 6px 10px; font-size: .85rem; }

.pe-history { width: 100%; border-collapse: collapse; font-size: .8rem; }
.pe-history th, .pe-history td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #334155; }
.pe-history th { color: #94a3b8; font-weight: 500; }

.btn { padding: 6px 14px; border-radius: 4px; border: none; cursor: pointer; font-size: .85rem; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #334155; cursor: not-allowed; }

.pe-toast { position: fixed; bottom: 20px; right: 20px; padding: 10px 16px; border-radius: 4px; background: #334155; color: #fff; opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none; }
.pe-toast-show { opacity: 1; transform: none; }
.pe-toast-ok { background: #16a34a; }
.pe-toast-err { background: #dc2626; }
.pe-toast-warn { background: #d97706; }

/* Grid view (2026-04-19) */
.pe-grid-wrap { overflow: auto; max-height: 65vh; border: 1px solid #334155; border-radius: 6px; scrollbar-gutter: stable; }
.pe-grid { width: 100%; min-width: max-content; border-collapse: collapse; font-size: .85rem; }
.pe-grid thead th { position: sticky; top: 0; background: #0f172a; color: #cbd5e1; padding: 8px 10px; text-align: left; border-bottom: 1px solid #334155; font-weight: 600; }
.pe-grid tbody td { padding: 4px 8px; border-bottom: 1px solid #1e293b; }
.pe-grid tbody tr:hover td { background: #1e293b; }
.pe-cell { width: 100px; background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 3px; padding: 4px 6px; font-size: .85rem; text-align: right; }
.pe-cell:disabled { opacity: .4; cursor: not-allowed; }
.pe-cell.pe-saving { border-color: #f59e0b; }
.pe-cell.pe-saved { border-color: #22c55e; }
.pe-cell.pe-error { border-color: #ef4444; }
.pe-slots-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pe-slots-row label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: #94a3b8; }
.pe-slots-row input { width: 80px; text-transform: uppercase; }
.pe-assign-slot { font-size: .75rem; background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 3px; padding: 2px 4px; }

/* Stats panel */
.pe-stats { margin-top: 20px; padding: 16px; background: #0f172a; border: 1px solid #334155; border-radius: 6px; }
.pe-stats h4 { margin: 0 0 12px; font-size: .95rem; color: #e2e8f0; }
.pe-stats h5 { margin: 16px 0 8px; font-size: .8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }
.pe-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pe-stat-card { background: #1e293b; border: 1px solid #334155; border-radius: 4px; padding: 10px 14px; }
.pe-stat-label { color: #94a3b8; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.pe-stat-val { font-size: 1rem; color: #e2e8f0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pe-stat-hero { font-size: 1.4rem; color: #60a5fa; }
.pe-stat-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.pe-stat-table td { padding: 4px 10px; border-bottom: 1px solid #1e293b; font-variant-numeric: tabular-nums; }
.pe-stat-table td:first-child { color: #94a3b8; }
.pe-stat-table td:last-child { text-align: right; color: #e2e8f0; font-weight: 500; }
.pe-stat-note { margin: 12px 0 0; padding: 10px 12px; background: #1e293b; border-left: 3px solid #f59e0b; border-radius: 2px; color: #cbd5e1; font-size: .8rem; }

/* Grid code/name column sizing */
.pe-grid td.pe-code { white-space: nowrap; color: #94a3b8; font-family: ui-monospace, monospace; font-size: .8rem; }
.pe-grid td.pe-name { min-width: 280px; width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e2e8f0; }
.pe-grid th:nth-child(2) { min-width: 280px; }

/* Log panel */
.pe-log-panel { margin-top: 16px; background: #0f172a; border: 1px solid #334155; border-radius: 6px; padding: 12px 16px; }
.pe-log-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pe-log-head h4 { margin: 0; flex: 1; font-size: .95rem; color: #e2e8f0; }
.pe-log-body { max-height: 320px; overflow-y: auto; font-size: .82rem; }
.pe-log-entry { padding: 8px 10px; border-left: 3px solid #334155; margin-bottom: 6px; background: #1e293b; border-radius: 2px; }
.pe-log-entry.pe-log-err  { border-left-color: #ef4444; }
.pe-log-entry.pe-log-warn { border-left-color: #f59e0b; }
.pe-log-entry.pe-log-ok   { border-left-color: #22c55e; }
.pe-log-ts { color: #64748b; font-size: .72rem; font-variant-numeric: tabular-nums; }
.pe-log-title { color: #e2e8f0; font-weight: 500; margin: 2px 0 4px; }
.pe-log-detail { margin: 4px 0 0; padding: 8px; background: #0f172a; border-radius: 3px; color: #cbd5e1; font-family: ui-monospace, monospace; font-size: .78rem; white-space: pre-wrap; user-select: text; }

/* 1С-ссылка */
.pe-ref1c { display: inline-block; padding: 2px 8px; background: #1e293b; border: 1px solid #334155; border-radius: 3px; color: #60a5fa; font-family: ui-monospace, monospace; font-size: .75rem; cursor: pointer; user-select: all; }
.pe-ref1c:hover { background: #334155; border-color: #60a5fa; }
.pe-ref1c-copied { background: #16a34a !important; color: #fff !important; border-color: #22c55e !important; }
.pe-log-empty { padding: 20px; text-align: center; color: #64748b; font-style: italic; font-size: .85rem; }
