* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --text: #1e293b;
  --muted: #64748b;
  --sidebar-w: 220px;
}
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* ── ЛОГИН ── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
}
.login-box {
  background: white; border-radius: 16px; padding: 40px;
  width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-box h1 { font-size: 22px; margin-bottom: 6px; }
.login-box p { color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.login-box label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; margin-top: 16px; }
.login-box input { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; transition: border-color .2s; }
.login-box input:focus { border-color: var(--primary); }
.btn-primary { background: var(--primary); color: white; border: none; border-radius: 8px; padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; margin-top: 20px; transition: background .2s; }
.btn-primary:hover { background: var(--primary-h); }
#login-error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 20px; }

/* ── LAYOUT ── */
#app { display: none; min-height: 100vh; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: #1e293b; color: white; display: flex; flex-direction: column;
  z-index: 100;
}
.sidebar-logo { padding: 20px 16px; font-size: 18px; font-weight: 700; border-bottom: 1px solid #334155; }
.sidebar-logo span { font-size: 11px; font-weight: 400; color: #94a3b8; display: block; margin-top: 2px; }
nav { flex: 1; padding: 6px 0; overflow-y: auto; }
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #64748b;
  padding: 8px 16px 3px; cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; transition: color .15s; }
.nav-section:hover { color: #94a3b8; }
.nav-section::after { content: "\25BE"; font-size: 9px; opacity: .55; transition: transform .15s; }
.nav-section.collapsed::after { transform: rotate(-90deg); }
.sidebar nav a.nav-hidden { display: none !important; }
.nav-toolbar { padding: 2px 12px 6px; }
.nav-toggle-all { width: 100%; background: transparent; border: 1px solid #334155; color: #94a3b8; border-radius: 6px; padding: 4px 8px; font-size: 11px; cursor: pointer; transition: all .15s; }
.nav-toggle-all:hover { background: #334155; color: #fff; }
nav a {
  display: flex; align-items: center; gap: 9px; padding: 6px 16px;
  color: #cbd5e1; text-decoration: none; border-radius: 0; transition: all .15s;
  font-size: 13px; cursor: pointer;
}
nav a:hover { background: #334155; color: white; }
nav a.active { background: var(--primary); color: white; }
nav a .icon { font-size: 15px; width: 20px; text-align: center; }
.sidebar-user { padding: 14px 16px; border-top: 1px solid #334155; font-size: 12px; color: #94a3b8; }
.sidebar-user strong { color: white; display: block; }
.btn-logout { margin-top: 6px; background: transparent; border: 1px solid #475569; color: #94a3b8; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.btn-logout:hover { background: #334155; }

/* ── MAIN ── */
.main { margin-left: var(--sidebar-w); padding: 24px; width: calc(100vw - var(--sidebar-w)); box-sizing: border-box; }
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── CARDS ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 10px; padding: 16px; border: 1px solid var(--border); }
.stat-card .label { font-size: 12px; color: var(--muted); }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-blue .value { color: var(--primary); }
.stat-green .value { color: var(--success); }
.stat-orange .value { color: var(--warning); }
.stat-red .value { color: var(--danger); }

/* ── TABLE ── */
.card { background: white; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; }
/* ── PAGER BAR ── */
.pager-bar { display:flex; align-items:center; justify-content:space-between; padding:7px 14px; background:#f8fafc; border-bottom:1px solid var(--border); gap:8px; flex-wrap:wrap; }
.pager-info { font-size:12px; color:var(--muted); white-space:nowrap; }
.pager-controls { display:flex; align-items:center; gap:3px; flex-wrap:wrap; }
.pg-btn { border:1px solid var(--border); background:white; border-radius:5px; min-width:28px; height:26px; padding:0 7px; font-size:12px; cursor:pointer; transition:all .15s; line-height:24px; }
.pg-btn:hover:not(:disabled):not(.pg-active) { border-color:var(--primary); color:var(--primary); }
.pg-active { background:var(--primary) !important; color:white !important; border-color:var(--primary) !important; }
.pg-btn:disabled { opacity:.4; cursor:not-allowed; }
.pg-sep { padding:0 3px; color:var(--muted); font-size:12px; line-height:26px; }
.pg-size { border:1px solid var(--border); border-radius:5px; padding:2px 5px; font-size:12px; outline:none; height:26px; background:white; margin-left:8px; }
.table-wrap { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 260px); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #f8fafc; padding: 4px 8px; text-align: left; font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: normal; color: var(--muted); border-bottom: 1px solid var(--border); white-space: normal; overflow-wrap: break-word; word-break: break-word; line-height: 1.2; position: sticky; top: 0; z-index: 2; vertical-align: bottom; overflow: hidden; }
table.tl-fixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }
/* Заголовки «Экземпляров»: переносить только по словам (не посимвольно) — иначе при авто-раскладке шапка уходит в вертикаль */
#pgtbl-items thead th { word-break: normal; overflow-wrap: normal; }
#page-orders thead th { word-break: normal; overflow-wrap: normal; }
#page-orders tbody td .btn-sm { padding: 2px 5px; font-size: 12px; }
tbody td { padding: 2px 8px; line-height: 1.25; border-bottom: 1px solid #f1f5f9; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,0,0,0.04); }
tbody tr.row-sold   td { background: #fff59d; }
tbody tr.row-sold:hover td { background: #fff176; }
tbody tr.row-transit td { background: #a5d6a7; }
tbody tr.row-transit:hover td { background: #81c784; }
tbody tr.row-written_off td { background: #ffcc80; }
tbody tr.row-written_off:hover td { background: #ffb74d; }
.no-data { text-align: center; color: var(--muted); padding: 40px; font-size: 13px; }

/* ── SORTABLE COLUMNS ── */
thead th.sortable { cursor: pointer; user-select: none; }
.col-resize-handle { position:absolute; right:0; top:0; bottom:0; width:10px; cursor:col-resize; z-index:6; }
.col-resize-handle:hover { background: var(--primary); opacity:.5; }
body.col-resizing { cursor:col-resize !important; user-select:none !important; }
body.col-resizing * { cursor:col-resize !important; }
thead th.sortable:hover { background: #edf2f7; color: var(--text); }
thead th.sort-asc::after  { content: ' ▲'; color: var(--primary); font-size: 9px; vertical-align: middle; }
thead th.sort-desc::after { content: ' ▼'; color: var(--primary); font-size: 9px; vertical-align: middle; }
.pg-settings-btn { margin-left: 4px; font-size: 14px; }

/* ── COLUMN SETTINGS MODAL ── */
.colset-list { display: flex; flex-direction: column; gap: 2px; max-height: min(500px, 60vh); overflow-y: auto; }
.colset-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; border: 1px solid transparent; transition: background .1s; }
.colset-item:hover { background: #f8fafc; }
.colset-item.drag-over { border-top: 2px solid var(--primary); }
.colset-item input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); flex-shrink:0; }
.colset-drag { cursor: grab; color: #aaa; font-size: 15px; user-select: none; flex-shrink:0; }
.colset-pin { cursor:pointer; font-size:13px; opacity:.35; flex-shrink:0; user-select:none; line-height:1; }
.colset-pin.pinned { opacity:1; }
.col-frozen-shadow { box-shadow: 3px 0 6px -2px rgba(0,0,0,.15); }
.colset-drag:active { cursor: grabbing; }
.colset-item.dragging { opacity: .4; }
.preset-section { margin-top:14px; padding-top:12px; border-top:1px solid var(--border); }
.preset-section h4 { font-size:12px; font-weight:600; color:var(--muted); margin-bottom:8px; }
/* ── Цвета строк заказов по статусу ── */
tr.order-yellow  td { background:#fef9c3; }
tr.order-green   td { background:#dcfce7; }
tr.order-blue    td { background:#dbeafe; }
tr.order-red     td { background:#fee2e2; }
tr.order-orange  td { background:#fed7aa; }
.sort-inline-btn { margin-left:auto; padding:1px 5px; font-size:11px; border:1px solid var(--border); border-radius:4px; background:transparent; color:var(--muted); cursor:pointer; min-width:24px; text-align:center; }
.sort-inline-btn:hover { border-color:var(--primary); color:var(--primary); }
.sort-inline-btn.sort-active { background:var(--primary); color:#fff; border-color:var(--primary); font-weight:600; }
.preset-list { display:flex; flex-direction:column; gap:4px; margin-bottom:10px; }
.preset-item { display:flex; align-items:center; gap:6px; }
.preset-item span { flex:1; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preset-save-row { display:flex; gap:6px; }
.preset-save-row .inp { flex:1; }
.btn-xs { padding:2px 7px; font-size:11px; border-radius:5px; border:1px solid var(--border); background:#fff; cursor:pointer; }
.btn-xs:hover { background:#f1f5f9; }
.btn-xs-danger { border-color:#fca5a5; color:var(--danger); }
.btn-xs-danger:hover { background:#fee2e2; }
.btn-xs-primary { border-color:var(--primary); color:var(--primary); }
.btn-xs-primary:hover { background:#eff6ff; }
.btn-xs-star { border-color:#d1d5db; color:#9ca3af; }
.btn-xs-star:hover { background:#fef9c3; color:#d97706; border-color:#fbbf24; }
.btn-xs-star.is-default { background:#fef9c3; color:#d97706; border-color:#fbbf24; }
.btn-xs-edit { border-color:#d1d5db; color:#6b7280; }
.btn-xs-edit:hover { background:#f0fdf4; color:#16a34a; border-color:#86efac; }
.preset-item.is-default { background:#fefce8; border-radius:6px; padding: 0 4px; }
.preset-item .preset-name-input { flex:1; font-size:12px; padding:1px 5px; border:1px solid var(--primary); border-radius:4px; outline:none; }

/* ── BADGES ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #fef3c7; color: #d97706; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }

/* ── BUTTONS ── */
.btn { border: none; border-radius: 7px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-blue { background: var(--primary); color: white; }
.btn-blue:hover { background: var(--primary-h); }
.btn-green { background: #16a34a; color: white; }
.btn-green:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: white; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn:not(.btn-blue):not(.btn-green):not(.btn-danger) { background: white; border: 1.5px solid var(--border); color: var(--text); }
.btn:not(.btn-blue):not(.btn-green):not(.btn-danger):hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-icon { background: transparent; border: none; cursor: pointer; padding: 4px 6px; border-radius: 5px; color: var(--muted); font-size: 15px; }
.btn-icon:hover { background: #f1f5f9; color: var(--text); }

/* ── SEARCH/FILTER ── */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inp { border: 1.5px solid var(--border); border-radius: 7px; padding: 7px 11px; font-size: 13px; outline: none; transition: border-color .2s; background: white; }
.inp:focus { border-color: var(--primary); }
.inp-sm { padding: 5px 9px; font-size: 12px; }
select.inp { cursor: pointer; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 12px; width: 560px; max-width: 95vw;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── SORT / FILTER MODAL ── */
.sf-level { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid var(--border); }
.sf-level:last-child { border-bottom:none; }
.sf-level select, .sf-level input { flex:1; min-width:0; }
.sf-level .sf-dir { flex:0 0 120px; }
.sf-level .sf-op  { flex:0 0 110px; }
.sf-level .sf-rm  { flex:0 0 26px; background:none; border:none; color:var(--danger); font-size:18px; cursor:pointer; padding:0; line-height:1; }
.sf-badge { display:inline-flex; align-items:center; justify-content:center; background:var(--primary); color:white; border-radius:50%; width:17px; height:17px; font-size:10px; font-weight:700; margin-left:4px; vertical-align:middle; }
.sf-empty { color:var(--muted); font-size:13px; text-align:center; padding:16px 0; }

/* ── FORM ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 14px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.form-control { width: 100%; border: 1.5px solid var(--border); border-radius: 7px; padding: 8px 11px; font-size: 13px; outline: none; transition: border-color .2s; }
.form-control:focus { border-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 70px; }

/* ── TOAST ── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1e293b; color: white; padding: 12px 18px; border-radius: 8px; font-size: 13px; max-width: 320px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 10px; animation: slideIn .3s ease; }
.toast.success { background: #15803d; }
.toast.error { background: #dc2626; }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── LOADER ── */
.loader { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); }
.spinner { width: 24px; height: 24px; border: 3px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── STATUS COLORS ── */
.status-in_stock { color: #15803d; }
.status-listed { color: #1d4ed8; }
.status-sold { color: #6b21a8; }
.status-returning { color: #d97706; }
.status-damaged, .status-written_off { color: #dc2626; }


/* ── Модалка #modal-item: 6 колонок на широком экране (адаптив до 1) ── */
#modal-item .form-row { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1400px) {
  #modal-item .form-row { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
  #modal-item .form-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  #modal-item .form-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  #modal-item .form-row { grid-template-columns: 1fr; }
}
/* full row остаётся на всю ширину при любом числе колонок */
#modal-item .form-group.full { grid-column: 1 / -1; }
/* Примечания: занимают свободное место справа от "Дата заказа Авито" */
#modal-item #item-notes-group { grid-column: 2 / -1; }
@media (max-width: 500px) {
  #modal-item #item-notes-group { grid-column: 1 / -1; }
}


/* модалка #modal-item: синие заголовки секций (без линий-разделителей) */
#modal-item .modal-body > div[style*="text-transform:uppercase"] {
  color: var(--primary) !important;
}

/* ── Двухуровневая «Модели» (master-detail) ── */
.models-master-detail{display:grid;grid-template-columns:300px 1fr;gap:16px;}
.models-left-pane{align-self:start;max-height:calc(100vh - 200px);display:flex;flex-direction:column;overflow:hidden;}
.models-left-pane .family-list{overflow-y:auto;flex:1;}
.family-list-item{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;cursor:pointer;border-bottom:1px solid var(--border);transition:background .12s;}
.family-list-item:hover{background:var(--bg-soft,#f7f7f9);}
.family-list-item.active{background:var(--accent-soft,#eaf3ff);color:var(--accent,#1466ff);font-weight:500;}
.family-list-item .family-name{flex:1;}
.family-list-item .family-count{display:inline-block;min-width:22px;text-align:center;padding:1px 6px;border-radius:10px;background:#e5e7eb;color:#374151;font-size:11px;}
.family-list-item.active .family-count{background:#1466ff;color:#fff;}

.models-right-pane{padding:18px;}
.family-detail-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--border);}
.family-section{margin-top:14px;}
.family-section-title{font-weight:600;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px;}
.family-attrs-readonly{display:flex;flex-wrap:wrap;gap:6px;}
.attr-chip{padding:3px 9px;border-radius:12px;background:#f1f5f9;font-size:12px;}
.attr-chip .attr-key{color:#64748b;}
.attr-chip .attr-val{color:#0f172a;font-weight:500;}
.family-drilldown-readonly{font-size:13px;}
.drill-step{display:inline-block;padding:3px 9px;border-radius:6px;background:#fef3c7;color:#92400e;margin:2px 0;font-size:12px;}

/* Редактор common_attrs в модалке семейства */
.family-attrs-editor{display:flex;flex-direction:column;gap:6px;}
.attrs-editor-row{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center;}
.family-drill-editor{display:flex;flex-direction:column;gap:6px;}
.drill-editor-row{display:grid;grid-template-columns:24px 1fr auto auto auto;gap:6px;align-items:center;}
.drill-editor-row .drill-num{font-weight:600;color:var(--muted);text-align:right;}
.page-subtitle{font-size:12px;color:var(--muted);margin-top:2px;}


/* ════ Растягивание таблицы «Экземпляры» на всю высоту + поджатый верх ════ */
.main { padding: 16px; }
.page-header { margin-bottom: 12px; }
#page-items.active { display: flex; flex-direction: column; height: calc(100vh - 32px); }
#page-items .page-header { margin-bottom: 8px; flex: 0 0 auto; }
#page-items .card { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#page-items .pager-bar { flex: 0 0 auto; }
#page-items .table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }
#page-orders.active { display: flex; flex-direction: column; height: calc(100vh - 32px); }
#page-orders .page-header { margin-bottom: 8px; flex: 0 0 auto; }
#page-orders .card { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#page-orders .pager-bar { flex: 0 0 auto; }
#page-orders .table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }
#page-price-control.active { display: flex; flex-direction: column; height: calc(100vh - 32px); }
#page-price-control .page-header { margin-bottom: 8px; flex: 0 0 auto; }
#page-price-control .card { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#page-price-control .card-header { flex: 0 0 auto; }
#page-price-control .table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }

/* ════ Сворачиваемое меню до иконок ════ */
.sidebar { overflow-x: hidden; transition: width .15s; }
.main { transition: margin-left .15s, width .15s; }
.sidebar-logo { position: relative; }
#nav-collapse-btn { position: absolute; top: 14px; right: 8px; width: 24px; height: 24px;
  background: transparent; border: 1px solid #334155; color: #94a3b8; border-radius: 6px;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
#nav-collapse-btn:hover { background: #334155; color: #fff; }
body.nav-collapsed { --sidebar-w: 64px; }
body.nav-collapsed .sidebar-logo { font-size: 0; padding: 14px 0; text-align: center; }
body.nav-collapsed .sidebar-logo span { display: none; }
body.nav-collapsed .sidebar-logo::before { content: "🧥"; font-size: 22px; }
body.nav-collapsed #nav-collapse-btn { position: static; margin: 8px auto 0; display: block; }
body.nav-collapsed .nav-toolbar { display: none; }
body.nav-collapsed .nav-section { font-size: 0; padding: 0; height: 0; margin: 7px 10px; border-top: 1px solid #475569; pointer-events: none; }
body.nav-collapsed .nav-section::after { display: none; }
body.nav-collapsed nav a { justify-content: center; gap: 0; padding: 9px 0; font-size: 0; }
body.nav-collapsed nav a .icon { font-size: 18px; width: auto; }
body.nav-collapsed nav a > span:not(.icon) { display: none; }
body.nav-collapsed .sidebar-user { font-size: 0; text-align: center; padding: 10px 4px; }
body.nav-collapsed .sidebar-user strong { display: none; }
body.nav-collapsed .btn-logout { font-size: 0; padding: 6px; width: auto; }
body.nav-collapsed .btn-logout::before { content: "⎋"; font-size: 15px; }

/* Контроль цен: тонировка колонок по МП */
/* тонировка МП — только в шапке; в теле проступает цвет строки */
#pc-table thead th.pc-oz{background:#eef5ff}
#pc-table thead th.pc-wb{background:#f4eefe}

/* Контроль цен: заморозка первых 3 колонок (Группа/Ост./Мин.приемл.) */
#pc-table th.pc-frz1, #pc-table td.pc-frz1{position:sticky;left:0;width:250px;min-width:250px;max-width:250px;z-index:1}
#pc-table th.pc-frz2, #pc-table td.pc-frz2{position:sticky;left:250px;width:40px;min-width:40px;max-width:40px;z-index:1}
#pc-table th.pc-frz3, #pc-table td.pc-frz3{position:sticky;left:290px;width:100px;min-width:100px;max-width:100px;z-index:1}
#pc-table thead th.pc-frz1, #pc-table thead th.pc-frz2, #pc-table thead th.pc-frz3{z-index:5;background:#f8fafc}

/* Контроль цен: заголовки акций — перенос, максимум 3 строки */
#pc-table thead th .pc-hd{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;line-height:1.2;word-break:break-word;white-space:normal;width:110px}
