/* Базовые стили кабинета. Токены — docs/05A_VISUAL_REFERENCE.md. */
:root {
    --sidebar-bg: #2a3042;
    --sidebar-text: #a6b0cf;
    --sidebar-heading: #8590b3;
    --sidebar-active: #ffffff;
    --canvas: #f6f7fb;
    --panel: #ffffff;
    --text: #495057;
    --text-secondary: #74788d;
    --primary: #556ee6;
    --primary-hover: #4458c4;
    --border: #e9ebf1;
    --info-bg: #d8f3eb; --info-text: #0f5a45;
    --warning-bg: #fff1d8; --warning-text: #7a4b00;
    --danger-bg: #fce2e2; --danger-text: #8a1f1f;
    --danger: #c0392b;
    --success: #1f8a5b;
    --radius: 5px;
    --shadow: 0 1px 2px rgba(18, 38, 63, .05);
    --sidebar-w: 250px;
    --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
/* Атрибут hidden всегда скрывает, даже при display у класса. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--canvas);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { color: #343a40; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.secret { word-break: break-all; font-size: 15px; letter-spacing: .5px; color: #343a40; }
.hint { margin: 4px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.field-error { margin: 4px 0 0; font-size: 13px; color: var(--danger-text); }
.empty { text-align: center; color: var(--text-secondary); padding: 24px; }

/* Shell */
.shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; z-index: 30; overflow-y: auto;
}
.sidebar-logo {
    height: var(--header-h); display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; flex-shrink: 0;
}
.sidebar-logo a { color: #fff; font-weight: 600; font-size: 17px; text-decoration: none; }
.sidebar-close { display: none; background: none; border: 0; color: var(--sidebar-text); font-size: 26px; line-height: 1; cursor: pointer; }
.sidebar-nav { padding: 8px 0 24px; }
.nav-heading {
    padding: 18px 20px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--sidebar-heading);
}
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 20px;
    color: var(--sidebar-text); text-decoration: none;
}
.nav-link:hover { color: #fff; text-decoration: none; }
.nav-link.active { color: var(--sidebar-active); background: rgba(255, 255, 255, .05); }
.nav-link svg { flex-shrink: 0; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.header {
    height: var(--header-h); background: var(--panel); box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.header-spacer { flex: 1; }
.icon-btn {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 0; border-radius: var(--radius); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--canvas); }
.content { padding: 24px; flex: 1; min-width: 0; }

/* Profile menu */
.profile-menu { position: relative; }
.profile-menu summary {
    list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 6px 8px; border-radius: var(--radius);
}
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover { background: var(--canvas); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; background: #e4e8fb; color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.profile-dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(18, 38, 63, .12);
    padding: 8px 0; z-index: 40;
}
.profile-meta { padding: 8px 16px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.profile-meta span { color: var(--text-secondary); font-size: 13px; word-break: break-all; }
.profile-dropdown a, .profile-dropdown .link-btn { display: block; width: 100%; text-align: left; padding: 8px 16px; color: var(--text); }
.profile-dropdown a:hover, .profile-dropdown .link-btn:hover { background: var(--canvas); text-decoration: none; }

/* Panels, typography */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .page-title { margin: 0; }
.page-title { font-size: 17px; font-weight: 600; margin: 0 0 16px; overflow-wrap: anywhere; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 24px; min-width: 0; }
.panel.narrow { max-width: 560px; }
.panel-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-dashboard { display: grid; grid-template-columns: minmax(260px, 30%) 1fr; gap: 24px; }

.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.kpi { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
a.kpi:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(18, 38, 63, .1); }
.kpi-label { color: var(--text-secondary); }
.kpi-value { font-size: 22px; font-weight: 600; color: #343a40; font-variant-numeric: tabular-nums; }

.profile-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-card-name { font-weight: 600; font-size: 15px; color: #343a40; overflow-wrap: anywhere; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0; }
.meta-list dt { color: var(--text-secondary); }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }

/* Alerts and badges */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert-info { background: var(--info-bg); color: var(--info-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); }
.temp-password .secret { font-size: 17px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-success { background: #dff3ea; color: #146c47; }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 500; color: #343a40; }
input[type=text], input[type=password], input[type=search], input[type=tel], input[type=email], select {
    width: 100%; height: 38px; padding: 6px 12px; font: inherit; color: var(--text);
    background: #fff; border: 1px solid #ced4da; border-radius: var(--radius);
}
input:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(85, 110, 230, .15); }
input[aria-invalid=true] { border-color: var(--danger); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
    font: inherit; font-weight: 500; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--text); border-color: #ced4da; }
.btn-secondary:hover { background: var(--canvas); }
.btn-danger { background: #fff; color: var(--danger); border-color: #e3a6a0; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-block { width: 100%; }
.form .btn { align-self: flex-start; }
.form .btn-block { align-self: stretch; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.link { color: var(--primary); }
.action-block { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { max-width: 280px; }
.filters select { max-width: 180px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: #343a40; padding: 10px 12px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:nth-child(even) { background: #fbfbfd; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; }
.pagination .page { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.pagination .disabled { color: #adb5bd; }

/* Guest pages */
.guest-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.guest-card { width: 100%; max-width: 420px; background: var(--panel); border-radius: var(--radius); box-shadow: 0 2px 12px rgba(18, 38, 63, .08); padding: 28px; }
.guest-brand { font-weight: 600; font-size: 15px; color: var(--primary); margin-bottom: 16px; }
.guest-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.guest-logout { margin-top: 16px; text-align: center; }
.qr { display: flex; justify-content: center; margin: 16px 0; }
.qr svg { width: 200px; height: 200px; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; font-size: 15px; }
.error-card { text-align: center; }
.error-code { font-size: 40px; font-weight: 600; color: var(--primary); }

/* Mobile: sidebar становится drawer */
@media (max-width: 991px) {
    /* Закрытый drawer: visibility убирает ссылки из Tab-порядка (с задержкой на время анимации). */
    .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
    .shell.nav-open .sidebar { transform: none; visibility: visible; transition: transform .2s ease, visibility 0s; box-shadow: 0 0 24px rgba(0, 0, 0, .25); }
    .sidebar-close { display: block; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
    .main { margin-left: 0; }
    .header { padding: 0 16px; height: 60px; }
    .content { padding: 16px; }
    .grid-2, .grid-dashboard, .kpi-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .profile-name { display: none; }
    input[type=text], input[type=password], input[type=search], input[type=tel], input[type=email], select { font-size: 16px; }
    body.no-scroll { overflow: hidden; }
}
@media (min-width: 992px) {
    .sidebar-backdrop { display: none !important; }
}

/* Каталог и склад (админка) */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table td.actions { text-align: right; white-space: nowrap; }
.table tfoot th { border-top: 2px solid var(--border); border-bottom: 0; }
.badge-muted { background: #eceef3; color: #5b6070; }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; }
textarea {
    width: 100%; padding: 8px 12px; font: inherit; color: var(--text); background: #fff;
    border: 1px solid #ced4da; border-radius: var(--radius); resize: vertical;
}
textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(85, 110, 230, .15); }
input[type=number], input[type=date] {
    width: 100%; height: 38px; padding: 6px 12px; font: inherit; color: var(--text);
    background: #fff; border: 1px solid #ced4da; border-radius: var(--radius);
}
input[readonly] { background: var(--canvas); color: var(--text-secondary); }
.input-money { max-width: 180px; text-align: right; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0; }
.fieldset legend { padding: 0 6px; font-weight: 600; color: #343a40; }
.composition { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.composition-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.panel.narrow-wide { max-width: 820px; }
.grid-wide-left { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--text-secondary); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.pre { white-space: pre-line; }
@media (max-width: 991px) {
    .form-grid, .composition-row, .grid-wide-left { grid-template-columns: minmax(0, 1fr); }
    textarea, input[type=number], input[type=date] { font-size: 16px; }
}
.form-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.input-qty { max-width: 110px; text-align: right; }
.badge-info { background: #e4e8fb; color: #3446a8; }
.amount-pos { color: var(--success); }
.amount-neg { color: var(--danger-text); }
.kpi-xl { font-size: 28px; margin: 4px 0 8px; }
.break { word-break: break-all; overflow-wrap: anywhere; }
.method-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.method-row .link { margin-left: auto; }
.method-option { display: flex; gap: 10px; align-items: center; padding: 8px 0; cursor: pointer; }
.requisites dd { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proof-thumb { max-width: 100%; max-height: 360px; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 12px; }
.inline-form { display: inline; margin-left: 8px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 4px 0; }
input[type=file] { font: inherit; }

/* Add Order */
.order-context { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.inline-details summary { cursor: pointer; list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] .filters { margin-top: 8px; }
.order-lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.order-line { display: grid; grid-template-columns: minmax(0, 65fr) 110px 120px auto; gap: 12px; align-items: start; }
.order-line-head { font-weight: 600; color: #343a40; font-size: 13px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.order-line .field { margin: 0; }
.line-total { padding-top: 9px; }
.unavailable { padding: 8px 12px; background: var(--danger-bg); color: var(--danger-text); border-radius: var(--radius); }
.order-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; margin-top: 20px; }
.order-side { display: flex; flex-direction: column; gap: 12px; }
.span-2 { grid-column: span 2; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; padding: 12px 16px; background: var(--canvas); border-radius: var(--radius); }
.totals dt { color: var(--text-secondary); }
.totals dd { margin: 0; }
.totals .total { font-weight: 600; font-size: 16px; color: #343a40; }
.order-actions { display: flex; gap: 12px; margin-top: 20px; align-items: center; }
.btn-wide { flex: 1; height: 44px; font-size: 15px; }
.discard-form { margin-top: -8px; margin-bottom: 24px; text-align: right; }
@media (max-width: 991px) {
    .order-line { grid-template-columns: minmax(0, 1fr) 100px; }
    .order-line > .field:first-child { grid-column: 1 / -1; }
    .order-line-head { display: none; }
    .order-bottom { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .order-actions { flex-direction: column-reverse; align-items: stretch; }
}

/* Клиентский shell по референсам */
.header-search { display: flex; align-items: center; gap: 8px; background: #f3f3f9; border-radius: 30px; padding: 0 14px; height: 38px; width: min(340px, 40vw); color: var(--text-secondary); }
.header-search input { border: 0; background: transparent; height: 36px; padding: 0; box-shadow: none; }
.header-search input:focus { box-shadow: none; }
.nav-link .nav-badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: #f46a6a; color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.nav-link .nav-badge-zero { background: rgba(244, 106, 106, .55); }
.nav-group summary { list-style: none; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group .chev { margin-left: auto; transition: transform .15s; }
.nav-group[open] .chev { transform: rotate(180deg); }
.nav-sub { padding: 2px 0 6px 50px; }
.nav-sub-region { font-size: 11px; color: var(--sidebar-heading); text-transform: uppercase; letter-spacing: .04em; padding: 6px 0 2px; }
.nav-sub-link { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--sidebar-text); padding: 6px 12px 6px 0; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.nav-sub-link:hover { color: #fff; text-decoration: none; }
.nav-paused { font-size: 11px; color: #f1b44c; }
.dash-grid { display: grid; grid-template-columns: minmax(280px, 30%) minmax(0, 1fr); gap: 24px; align-items: start; }
.dash-left, .dash-right { min-width: 0; }
.dash-right .kpi-row { margin-bottom: 24px; }
.kpi-icon { position: relative; padding-right: 76px; }
.kpi-badge { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; }
.wh-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.table-head-fill thead th { background: #f8f9fa; border-bottom: 0; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-right input[type=search] { width: 260px; }
.toolbar-right select { width: auto; max-width: 220px; }
.per-page { display: flex; align-items: center; gap: 6px; }
.per-page select { width: auto; height: 32px; padding: 2px 8px; }
.table-dense th, .table-dense td { padding: 8px 10px; }
.table-dense tbody td { line-height: 1.35; }
.filter-row th { padding: 6px 4px; border-bottom: 1px solid var(--border); font-weight: 400; }
.filter-row input, .filter-row select { height: 32px; font-size: 13px; padding: 4px 8px; }
.price-range { display: flex; gap: 4px; }
.price-range input { min-width: 0; }
.sort-link { color: #343a40; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.sort-link span { color: #adb5bd; font-size: 10px; }
.stock-low { color: var(--danger); font-size: 12px; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.products-table td:first-child { min-width: 240px; }

/* Combobox */
.combo { position: relative; }
.combo-button { width: 100%; min-height: 38px; text-align: left; background: #fff; border: 1px solid #ced4da; border-radius: var(--radius); padding: 8px 32px 8px 12px; font: inherit; color: var(--text); cursor: pointer; position: relative; overflow-wrap: anywhere; }
.combo-button::after { content: ''; position: absolute; right: 12px; top: 50%; border: 5px solid transparent; border-top-color: #74788d; margin-top: -2px; }
.combo-button.placeholder { color: var(--text-secondary); }
.combo-panel { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 2px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(18, 38, 63, .15); padding: 8px; }
.combo-search { margin-bottom: 6px; }
.combo-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.combo-option { padding: 8px 10px; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; }
.combo-option.active, .combo-option:hover { background: #eef1fd; }
.combo-name { color: #343a40; }
.combo-meta { font-size: 12px; color: var(--text-secondary); }
.combo-zero .combo-meta { color: var(--danger); }
.combo-empty { padding: 8px 10px; color: var(--text-secondary); }
.combo-more { margin-top: 6px; }
@media (max-width: 991px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .header-search { width: auto; flex: 1; }
    .toolbar-right input[type=search] { width: 100%; }
    .products-table td:first-child { min-width: 200px; }
}

.products-table .badge { white-space: nowrap; }
.mobile-only { display: none; }
@media (max-width: 767px) {
    .products-table .col-secondary { display: none; }
    .products-table .mobile-only { display: block; }
    .products-table td:first-child { min-width: 0; }
    .price-range { flex-direction: column; }
}
/* Свёрнутый sidebar на desktop */
@media (min-width: 992px) {
    [data-sidebar-toggle] { display: inline-flex; }
    .sidebar, .main { transition: transform .2s ease, margin-left .2s ease, visibility 0s; }
    .shell.nav-collapsed .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
    .shell.nav-collapsed .main { margin-left: 0; }
}
@media (max-width: 767px) {
    .products-table, .products-table thead, .products-table tbody { display: block; }
    .products-table thead tr:first-child { display: flex; flex-wrap: wrap; gap: 4px 14px; }
    .products-table thead tr:first-child th { border: 0; padding: 4px 0; }
    .products-table .filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
    .products-table .filter-row th { display: block; padding: 0; border: 0; }
    .products-table .filter-row .col-secondary { display: block; }
    .products-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .products-table tbody tr:nth-child(even) { background: transparent; }
    .products-table tbody td { border: 0; padding: 0; }
    .products-table tbody td:first-child { grid-column: 1 / -1; }
    .products-table tbody td.empty { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
    .products-table .filter-row th.price-range { display: flex; flex-direction: row; gap: 4px; }
}

/* Уведомления и колокол */
.notice { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid transparent; }
.notice-info { background: var(--info-bg); color: var(--info-text); border-color: #bfe8da; }
.notice-warning { background: var(--warning-bg); color: var(--warning-text); border-color: #f6e0b6; }
.notice-critical { background: var(--danger-bg); color: var(--danger-text); border-color: #f3c1c1; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { font-size: 18px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.notice-text { margin-top: 4px; overflow-wrap: anywhere; }
.notice-time { margin-top: 8px; font-size: 12px; opacity: .8; }
.notice-never { background: none; border: 0; padding: 0; margin-left: 6px; font: inherit; font-size: 14px; font-weight: 400; color: var(--danger); cursor: pointer; }
.notice-close { background: none; border: 0; font-size: 22px; line-height: 1; color: inherit; opacity: .6; cursor: pointer; padding: 0 4px; }
.notice-close:hover { opacity: 1; }
.notice-more { margin: -6px 0 16px; font-size: 13px; }
.bell { position: relative; }
.bell summary { list-style: none; position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.bell-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: #f46a6a; color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.bell-dropdown { position: absolute; right: 0; top: calc(100% + 6px); width: min(360px, 90vw); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(18, 38, 63, .12); z-index: 40; }
.bell-head { padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
.bell-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.bell-item { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.bell-item span { color: var(--text-secondary); }
.bell-critical strong { color: var(--danger-text); }
.bell-empty { padding: 16px; color: var(--text-secondary); }
.bell-all { display: block; padding: 10px 16px; text-align: center; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.kpi-grid .panel { margin-bottom: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; margin-top: 6px; }
.audit-json { max-width: 520px; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
input[type=datetime-local] { height: 38px; padding: 6px 12px; font: inherit; border: 1px solid #ced4da; border-radius: var(--radius); }
@media (max-width: 991px) { .kpi-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .notice-title { font-size: 16px; } }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 12px 16px; border-radius: var(--radius); background: var(--canvas); max-width: 85%; }
.msg-mine { align-self: flex-end; background: #eef1fd; }
.msg-staff { border-left: 3px solid var(--primary); }
.msg-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; }
.msg-body { overflow-wrap: anywhere; }
.faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq-item summary { cursor: pointer; font-weight: 500; color: #343a40; }
.faq-item summary:focus-visible { outline: 2px solid var(--primary); }
.faq-item div { margin-top: 8px; }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } .report-filters label { width: 100%; } }
.nowrap { white-space: nowrap; }

/* Свёрнутый длинный текст (описание товара): 6 строк, кнопка «Показать полностью» */
.clamp.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.clamp-toggle { margin-top: 6px; }

/* Products: строка — товар, внутри ячеек — по строке на склад (одинаковая высота для выравнивания колонок) */
.offer-lines { list-style: none; margin: 0; padding: 0; }
.offer-lines li { display: flex; align-items: center; gap: 4px; height: 26px; white-space: nowrap; }
.num .offer-lines li { justify-content: flex-end; }
.offer-lines .badge { line-height: 16px; padding-top: 1px; padding-bottom: 1px; }
.plain-link { color: inherit; }
.mobile-only-inline { display: none; }
@media (max-width: 767px) { .products-table .mobile-only-inline { display: inline; } }
.row-current td { background: var(--primary-soft, #eef1fd); }
