/* ====================================================================
   AvitoBot — тёмная минималистичная тема
   ==================================================================== */
:root {
    --bg:        #050506;
    --surface:   #0f0f12;
    --surface-2: #16161a;
    --elev:      #1d1d22;
    --border:    #242427;
    --border-2:  #313137;
    --text:      #edeff5;
    --muted:     #939bb0;
    --faint:     #626a80;
    --primary:   #6d8bff;
    --primary-2: #5573f5;
    --primary-soft:#171f38;
    --gold:      #e7c46b;
    --success:   #3ddc97;
    --success-soft:#0e2a20;
    --danger:    #f87171;
    --danger-soft:#2a1717;
    --warning:   #f5c451;
    --warning-soft:#2a2410;
    --radius:    16px;
    --radius-sm: 11px;
    --shadow:    0 1px 0 rgba(255,255,255,.03) inset, 0 10px 34px rgba(0,0,0,.42);
    --shadow-lg: 0 24px 70px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #000;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    letter-spacing: -.005em;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
::selection { background: var(--primary-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b313f; border-radius: 8px; border: 2px solid var(--bg); }

/* -------------------- Каркас -------------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 234px; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px;
    font-size: 16px; font-weight: 700; color: #fff; }
.brand .logo-mark {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 16px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--faint); }

.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
    color: var(--faint); padding: 14px 12px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 500; transition: .14s; }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: #cfe0ff; }
.nav a.active svg { color: var(--primary); }

.sidebar-foot { margin-top: auto; padding: 14px 16px; font-size: 11.5px; color: var(--faint); }
.sidebar-foot .status-pill { margin-bottom: 10px; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 30px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20; background: #0a0b11; }
.topbar .page-title { font-size: 19px; font-weight: 650; }
.topbar .page-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.page-body { padding: 26px 30px 70px; max-width: 1200px; width: 100%; }

/* -------------------- Статус -------------------- */
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
    border-radius: 30px; font-size: 12.5px; font-weight: 500; background: var(--surface-2);
    border: 1px solid var(--border); color: var(--muted); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.status-pill.online  .dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-pill.paused  .dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.status-pill.offline .dot { background: var(--faint); }
.status-pill.error   .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.status-pill.error   { color: var(--danger); }

/* -------------------- Кнопки -------------------- */
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 550;
    font-size: 13.5px; cursor: pointer; padding: 9px 15px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); transition: .14s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--elev); border-color: #3c4356; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn.success { background: var(--success); border-color: var(--success); color: #052e22; }
.btn.success:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.icon { padding: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* -------------------- Карточки -------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-head h2 { font-size: 15.5px; font-weight: 600; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }

/* -------------------- Статкарточки -------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .stat-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 13px; }
.stat .stat-ico svg { width: 19px; height: 19px; }
.stat .ico-blue { background: var(--primary-soft); color: var(--primary); }
.stat .ico-green { background: var(--success-soft); color: var(--success); }
.stat .ico-amber { background: var(--warning-soft); color: var(--warning); }
.stat .ico-violet { background: #221a3a; color: #a78bfa; }
.stat .stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .stat-label { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* -------------------- Формы -------------------- */
label.field { display: block; margin-bottom: 15px; font-size: 12.5px; font-weight: 550; color: var(--muted); }
.field .hint { font-weight: 400; color: var(--faint); }
input, select, textarea { font: inherit; width: 100%; margin-top: 6px; padding: 10px 12px;
    border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface-2);
    color: var(--text); transition: .14s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft); background: var(--surface); }
textarea { resize: vertical; min-height: 62px; }
select option { background: var(--surface-2); }
.hint-block { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* Переключатель */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #353b4a; border-radius: 30px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* -------------------- Тулбар -------------------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.toolbar .search input { margin: 0; padding-left: 35px; }
.toolbar select { margin: 0; width: auto; min-width: 150px; }

/* -------------------- Каталог: карточки товаров -------------------- */
.products-grid { display: flex; flex-direction: column; gap: 16px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.product-top { display: flex; gap: 16px; padding: 16px; }
.product-photo { position: relative; width: 108px; height: 108px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px dashed var(--border-2); flex-shrink: 0;
    display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-photo .ph-empty { color: var(--faint); font-size: 11.5px; text-align: center; padding: 8px; }
.product-photo .ph-empty svg { width: 22px; height: 22px; display: block; margin: 0 auto 5px; }
.product-photo .ph-del { position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,.6); border: none;
    color: #fff; width: 22px; height: 22px; border-radius: 6px; cursor: pointer; display: none; align-items: center; justify-content: center; }
.product-photo:hover .ph-del { display: flex; }

.product-meta { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-content: start; }
.product-meta .f { display: flex; flex-direction: column; }
.product-meta .f.full { grid-column: 1 / -1; }
.product-meta label { font-size: 11px; color: var(--faint); margin-bottom: 3px; font-weight: 500; }
.product-meta input, .product-meta select { margin: 0; padding: 8px 10px; font-size: 13.5px; }
.product-name input { font-weight: 600; font-size: 15px; }
.product-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* размеры внутри товара */
.sizes-wrap { border-top: 1px solid var(--border); background: var(--surface-2); padding: 12px 16px 16px; }
.sizes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sizes-head .t { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
table.sizes { width: 100%; border-collapse: collapse; }
table.sizes th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint);
    font-weight: 600; text-align: left; padding: 4px 8px; }
table.sizes td { padding: 3px 6px; }
table.sizes input { margin: 0; padding: 7px 9px; background: var(--surface); border-color: var(--border); font-size: 13.5px; }
table.sizes .lbl input { font-weight: 700; text-align: center; text-transform: uppercase; }
table.sizes .rng { white-space: nowrap; }
table.sizes .rng input { width: 56px; display: inline-block; text-align: center; }
table.sizes .rng .dash { color: var(--faint); margin: 0 2px; }
table.sizes td.center { text-align: center; }

/* шапка карточки (всегда видна, по клику сворачивает) */
.pc-header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.pc-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.pc-chevron { color: var(--faint); transition: .18s; flex-shrink: 0; }
.pc-chevron svg { width: 18px; height: 18px; display: block; }
.product-card.collapsed .pc-chevron { transform: rotate(-90deg); }
.pc-thumb { width: 42px; height: 42px; border-radius: 9px; background: var(--surface-2);
    border: 1px solid var(--border); overflow: hidden; flex-shrink: 0; display: grid; place-items: center; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-thumb .ph { color: var(--faint); font-size: 16px; }
.pc-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-title .pc-cat { color: var(--faint); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.pc-summary { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pc-sizes-mini { color: var(--muted); font-size: 12.5px; }
.pc-head-actions { flex-shrink: 0; }
.pc-body { border-top: 1px solid var(--border); }
.product-card.collapsed .pc-body { display: none; }

/* цвета: горизонтальная лента блоков */
.colors-row { display: flex; gap: 12px; padding: 16px; overflow-x: auto; }
.color-block { flex: 0 0 150px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.color-photo { position: relative; width: 100%; height: 120px; border-radius: 9px; background: var(--surface);
    border: 1px dashed var(--border-2); overflow: hidden; cursor: pointer; display: grid; place-items: center; }
.color-photo img { width: 100%; height: 100%; object-fit: cover; }
.color-photo .ph-empty { color: var(--faint); font-size: 11px; text-align: center; }
.color-photo .ph-empty svg { width: 20px; height: 20px; display: block; margin: 0 auto 4px; }
.color-photo .ph-del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); border: none;
    color: #fff; width: 20px; height: 20px; border-radius: 6px; cursor: pointer; display: none; }
.color-photo:hover .ph-del { display: block; }
.color-name { margin: 0; text-align: center; font-weight: 600; padding: 6px 8px; }
.color-stock { display: flex; flex-direction: column; gap: 5px; }
.cs-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cs-label { font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 34px; }
.cs-empty { font-size: 11.5px; color: var(--faint); text-align: center; padding: 4px; }
.color-block .del-color { width: 100%; justify-content: center; margin-top: auto; }
.add-color-block { flex: 0 0 80px; border: 1px dashed var(--border-2); border-radius: 12px;
    background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.add-color-block:hover { background: var(--surface-2); color: var(--primary); border-color: var(--primary); }
.add-color-block span { font-size: 22px; }

.common-sizes { border-top: 1px solid var(--border); background: var(--surface-2); padding: 12px 16px; }
.common-meta { padding: 14px 16px; }

/* счётчик количества */
.qty-stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden; background: var(--surface); }
.qty-stepper button { width: 26px; height: 30px; border: none; background: var(--surface-2);
    color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; transition: .12s; }
.qty-stepper button:hover { background: var(--elev); color: var(--primary); }
.qty-stepper input { width: 46px; margin: 0; border: none; border-radius: 0; text-align: center;
    background: var(--surface); padding: 6px 2px; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* вкладки */
.tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border);
    padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tab { padding: 8px 16px; border-radius: 9px; cursor: pointer; font-size: 13.5px; font-weight: 550;
    color: var(--muted); border: none; background: transparent; transition: .14s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* -------------------- Бейджи -------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 30px; font-size: 12px; font-weight: 600; }
.badge.yes { background: var(--success-soft); color: var(--success); }
.badge.no { background: var(--danger-soft); color: var(--danger); }
.badge.unclear { background: var(--warning-soft); color: var(--warning); }
.badge.gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.link { background: var(--primary-soft); color: #9dc0ff; }

/* -------------------- Пусто -------------------- */
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state .big { font-size: 40px; margin-bottom: 12px; opacity: .8; }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

/* -------------------- Тест-чат -------------------- */
.playground { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.chat { display: flex; flex-direction: column; height: 580px; }
.chat-body { flex: 1; overflow-y: auto; padding: 6px 2px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 15px; font-size: 14px; white-space: pre-wrap; }
.msg.out { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.in { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 5px 12px;
    cursor: pointer; font: inherit; font-size: 12.5px; color: var(--muted); transition: .14s; }
.chip:hover { background: var(--primary-soft); color: #cfe0ff; border-color: var(--primary-soft); }

.pg-context { margin-bottom: 14px; }
.pg-context select { margin-top: 6px; }

.analysis .kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.analysis .kv:last-child { border-bottom: none; }
.analysis .kv .k { color: var(--muted); }
.analysis .kv .v { font-weight: 600; }
.verdict { display: flex; align-items: center; gap: 9px; padding: 13px; border-radius: var(--radius-sm); margin: 6px 0 12px; font-weight: 600; font-size: 13.5px; }
.verdict.yes { background: var(--success-soft); color: var(--success); }
.verdict.no { background: var(--danger-soft); color: var(--danger); }
.verdict.unclear { background: var(--warning-soft); color: var(--warning); }
.match-list { list-style: none; padding: 0; margin: 8px 0 0; }
.match-list li { padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; margin: 22px 0 10px; }

/* -------------------- Таблицы (журнал) -------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--faint); font-weight: 600; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
table.grid td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: top; }
table.grid tr:last-child td { border-bottom: none; }
.log-row .when { color: var(--faint); font-size: 12px; white-space: nowrap; }
.log-row .reply-text { color: var(--muted); }

/* -------------------- Двухколоночное -------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.toggle-row .t-text b { display: block; }
.toggle-row .t-text span { font-size: 12.5px; color: var(--muted); }

/* -------------------- Тосты -------------------- */
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--elev); border: 1px solid var(--border-2);
    color: var(--text); padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 13.5px; animation: slidein .22s; }
.toast.ok { border-color: #1c5e44; } .toast.ok::before { content: "✓"; color: var(--success); font-weight: 700; }
.toast.err { border-color: #5e2424; } .toast.err::before { content: "!"; color: var(--danger); font-weight: 700; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* -------------------- Премиум-акценты -------------------- */
.brand .logo-mark { box-shadow: 0 6px 20px rgba(109,139,255,.4); }
.card { background-image: linear-gradient(180deg, rgba(255,255,255,.015), transparent 120px); }
.stat { background-image: linear-gradient(180deg, rgba(255,255,255,.02), transparent 90px); transition: .18s; }
.stat:hover { border-color: var(--border-2); transform: translateY(-1px); }
.btn.primary { background-image: linear-gradient(180deg, rgba(255,255,255,.14), transparent); box-shadow: 0 6px 18px rgba(85,115,245,.32); }
.product-card { transition: border-color .18s, box-shadow .18s; }
.product-card:hover { border-color: var(--border-2); }

/* цена в шапке товара */
.pc-price { font-weight: 700; font-size: 14.5px; color: var(--gold); letter-spacing: -.01em; }

/* цветные точки */
.color-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.25); flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.color-name-row { display: flex; align-items: center; gap: 7px; }
.color-name-row .color-name { flex: 1; }

/* -------------------- Модалка -------------------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5,6,10,.66); backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center; z-index: 90; padding: 20px; }
.modal-bg.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius);
    width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); animation: slidein .2s; max-height: 90vh; overflow: auto; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex;
    justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px 22px; }

/* -------------------- Предпросмотр -------------------- */
.pv-modal { max-width: 440px; }
.pv-cover { width: 100%; height: 230px; border-radius: 12px; overflow: hidden; background: var(--surface-2);
    display: grid; place-items: center; }
.pv-cover img { width: 100%; height: 100%; object-fit: cover; }
.pv-nophoto { font-size: 54px; opacity: .6; }
.pv-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pv-thumbs img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.pv-brand { margin-top: 16px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.pv-name { font-size: 21px; font-weight: 700; margin-top: 3px; }
.pv-prices { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 4px; }
.pv-price { font-size: 24px; font-weight: 800; color: var(--gold); }
.pv-old { font-size: 16px; color: var(--faint); text-decoration: line-through; }
.pv-row { display: flex; gap: 10px; margin-top: 12px; font-size: 14px; }
.pv-lbl { color: var(--muted); min-width: 64px; }
.pv-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.pv-swatch { display: inline-flex; align-items: center; gap: 6px; }
.pv-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-size { padding: 3px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border-2); font-weight: 600; font-size: 13px; }
.pv-size.off { opacity: .35; text-decoration: line-through; }
.pv-desc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
.pv-stock { margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.pv-stock.in { background: var(--success-soft); color: var(--success); }
.pv-stock.out { background: var(--danger-soft); color: var(--danger); }
.pv-sku { margin-top: 10px; font-size: 12px; color: var(--faint); }
.modal-head .icon { padding: 6px 10px; }

/* мелкие правки premium */
.nav a.active { box-shadow: inset 0 0 0 1px rgba(109,139,255,.25); }
.color-block { transition: border-color .15s; }
.color-block:hover { border-color: var(--border-2); }

/* ====================================================================
   Глянцевая «жидкая» тема (по референсу): круглый логотип-робот,
   объёмные кнопки-пилюли, мягкий тёмный фон.
   ==================================================================== */

/* Сайдбар сливается с фоном-волнами, мягкая граница */
.sidebar {
    /* Чуть плотнее фон вместо дорогого backdrop-filter — визуально то же,
       но без пересчёта размытия каждый кадр (главный убийца FPS). */
    background: linear-gradient(180deg, rgba(20,22,31,.96), rgba(12,13,20,.97));
    border-right: 1px solid rgba(255,255,255,.05);
}
.topbar {
    background: rgba(10,11,17,.55);
    border-bottom: 1px solid rgba(255,255,255,.05);
}

/* Логотип — круглый робот в глянцевой оправе */
.brand { padding: 22px 18px 18px; gap: 13px; }
.brand .logo-mark {
    width: 46px; height: 46px; border-radius: 50%; padding: 0; overflow: hidden;
    background: radial-gradient(circle at 50% 35%, #ffffff, #dde7f7);
    box-shadow:
        0 0 0 1px rgba(255,255,255,.16),
        0 0 0 4px rgba(109,139,255,.16),
        0 8px 22px rgba(40,70,170,.45);
    display: grid; place-items: center; flex-shrink: 0;
}
.brand .logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand .brand-text { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.brand .brand-text small { display: block; font-size: 10.5px; font-weight: 400; color: var(--faint); letter-spacing: 0; }

/* Заголовок раздела меню — заметный */
.nav-label { color: #c8d1e6; font-weight: 800; font-size: 11px; letter-spacing: .14em; }

/* Объёмные глянцевые кнопки-пилюли навигации */
.nav { padding: 6px 14px; gap: 7px; }
.nav a {
    border-radius: 30px; padding: 11px 16px; font-weight: 600; color: #c4ccdd;
    background: linear-gradient(180deg, rgba(43,48,62,.9), rgba(24,27,37,.92));
    border: 1px solid rgba(255,255,255,.06);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 4px 12px rgba(0,0,0,.42);
    transition: transform .14s, box-shadow .14s, background .14s, color .14s;
}
.nav a:hover {
    color: #fff; transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(54,60,78,.95), rgba(30,34,46,.95));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 7px 18px rgba(0,0,0,.5);
}
.nav a.active {
    color: #fff; border-color: rgba(109,139,255,.55);
    background: linear-gradient(180deg, #5f7dfb, #3f5be6);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        0 8px 22px rgba(70,100,235,.5);
}
.nav a.active svg { color: #fff; }

/* Глянцевая синяя кнопка-пилюля основного действия */
.btn { border-radius: 30px; }
.btn.primary, .btn.success {
    padding: 11px 22px; font-size: 14px; font-weight: 700; border: none; color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        0 10px 26px rgba(70,100,235,.45);
}
.btn.primary {
    background: linear-gradient(180deg, #6f8dff 0%, #4a64e8 55%, #3f56d6 100%);
}
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.success {
    background: linear-gradient(180deg, #4ee6a6 0%, #25c483 60%, #1bae73 100%);
    color: #06301f;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 10px 26px rgba(30,180,120,.4);
}
.btn.success:hover { transform: translateY(-1px); }
.btn.primary svg, .btn.success svg { width: 17px; height: 17px; }

/* Глянцевая пилюля статуса */
.status-pill {
    padding: 7px 14px; border-radius: 30px;
    background: linear-gradient(180deg, rgba(36,40,54,.95), rgba(22,25,35,.95));
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 4px 12px rgba(0,0,0,.4);
    color: #d4dbec; font-weight: 600;
}
.status-pill.online .dot { box-shadow: 0 0 0 3px rgba(61,220,151,.18), 0 0 10px rgba(61,220,151,.9); }

@media (max-width: 980px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .playground, .two-col { grid-template-columns: 1fr; }
    .product-meta { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .sidebar { display: none; }
    .page-body, .topbar { padding-left: 16px; padding-right: 16px; }
    .product-top { flex-wrap: wrap; }
}

/* ====================================================================
   Живые анимированные обои + плавные анимации интерфейса
   ==================================================================== */

/* Два слоя мягких «северных сияний», медленно дрейфующих по чёрному фону.
   Лежат позади контента (z-index:-1), не мешают кликам. */
body::before, body::after {
    content: "";
    position: fixed;
    inset: -25%;
    z-index: -1;
    pointer-events: none;
}
body::before {
    background:
        radial-gradient(34% 38% at 22% 26%, rgba(78,110,255,.16), transparent 60%),
        radial-gradient(30% 34% at 80% 20%, rgba(130,86,255,.12), transparent 62%),
        radial-gradient(42% 44% at 64% 84%, rgba(40,70,210,.14), transparent 62%);
    filter: blur(28px);
    /* ДИАГНОСТИКА: анимация фона отключена. Сияние осталось, но статичное —
       страница больше ничего не перерисовывает в фоне. */
}
body::after {
    background:
        radial-gradient(38% 40% at 72% 40%, rgba(96,128,255,.10), transparent 60%),
        radial-gradient(34% 38% at 24% 70%, rgba(150,96,255,.09), transparent 62%);
    filter: blur(40px);
}
/* Только translate3d (без scale/rotate): размытие считается один раз,
   дальше видеокарта просто двигает готовый слой — дёшево на любом устройстве. */
@keyframes bgdrift {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(2.5%, -2%, 0); }
    100% { transform: translate3d(-2%, 2.5%, 0); }
}
@keyframes bgdrift2 {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(3%, -3%, 0); }
}

/* Плавное появление блоков (fill backwards — не ломает hover-эффекты) */
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.stat, .card, .table-wrap, .product-card, .playground, .tabs, .toolbar {
    animation: rise .55s cubic-bezier(.22,.7,.25,1) backwards;
}
.stat:nth-child(1) { animation-delay: .04s; }
.stat:nth-child(2) { animation-delay: .10s; }
.stat:nth-child(3) { animation-delay: .16s; }
.stat:nth-child(4) { animation-delay: .22s; }
.two-col .card:nth-child(2) { animation-delay: .14s; }

/* Меню появляется по очереди */
.nav a { animation: fadein .55s ease backwards; }
.nav a:nth-of-type(1) { animation-delay: .06s; }
.nav a:nth-of-type(2) { animation-delay: .12s; }
.nav a:nth-of-type(3) { animation-delay: .18s; }
.nav a:nth-of-type(4) { animation-delay: .24s; }
.nav a:nth-of-type(5) { animation-delay: .30s; }

/* Логотип мягко «дышит» */
.brand .logo-mark { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

/* Пульс у индикатора онлайна */
.status-pill.online .dot { animation: dotpulse 2.4s ease-in-out infinite; }
@keyframes dotpulse {
    0%   { box-shadow: 0 0 0 0 rgba(61,220,151,.5),  0 0 10px rgba(61,220,151,.85); }
    70%  { box-shadow: 0 0 0 7px rgba(61,220,151,0), 0 0 10px rgba(61,220,151,.85); }
    100% { box-shadow: 0 0 0 0 rgba(61,220,151,0),   0 0 10px rgba(61,220,151,.85); }
}

/* Кнопки слегка «вдавливаются» при нажатии */
.btn:active { transform: translateY(0) scale(.97); }

/* Чуть живее наведение на карточки/строки */
.card, .stat, .product-card, .table-wrap { transition: border-color .2s, box-shadow .25s, transform .2s; }
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow), 0 12px 30px rgba(0,0,0,.45); }
.log-row { transition: background .15s; }
.log-row:hover { background: rgba(255,255,255,.025); }
.chip, .tab, .badge { transition: all .16s ease; }

/* Уважаем системную настройку «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Телефоны и сенсорные устройства: фон остаётся (то же сияние), но не
   анимируется бесконечно — экономим батарею и убираем лаги на слабом железе. */
@media (hover: none), (max-width: 760px) {
    body::before, body::after { animation: none; }
}

/* ==================================================================== */
/* Авторизация (вход/выход) — добавлено поверх дизайна                   */
/* ==================================================================== */
.logout-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted);
    font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 30px;
    background: linear-gradient(180deg, rgba(43,48,62,.7), rgba(24,27,37,.7));
    border: 1px solid rgba(255,255,255,.06); transition: .14s; }
.logout-link svg { width: 16px; height: 16px; }
.logout-link:hover { color: #fff; background: var(--danger-soft); border-color: #5e2424; }

.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 24px; gap: 16px; }
.login-card { position: relative; width: 100%; max-width: 400px; padding: 32px 30px 30px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
    box-shadow: var(--shadow-lg);
    background-image: linear-gradient(180deg, rgba(255,255,255,.02), transparent 140px);
    overflow: hidden; animation: slidein .25s; }
.login-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6, var(--gold)); }
.login-card h1 { font-size: 23px; margin-bottom: 6px; letter-spacing: -.02em; }
.login-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.login-brand .logo-mark { width: 48px; height: 48px; border-radius: 50%; overflow: hidden;
    background: radial-gradient(circle at 50% 35%, #fff, #dde7f7); display: grid; place-items: center;
    box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 0 0 4px rgba(109,139,255,.16), 0 8px 22px rgba(40,70,170,.45); }
.login-brand .logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.login-brand-text b { font-size: 18px; font-weight: 800; }
.login-brand-text small { display: block; font-size: 12px; color: var(--faint); }
.login-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #5e2424;
    border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
    font-size: 16px; opacity: .5; border-radius: 8px; transition: .14s; }
.pass-eye:hover { opacity: .9; background: var(--surface-2); }
.pass-eye.on { opacity: 1; }
.login-btn { width: 100%; justify-content: center; margin-top: 8px; padding: 12px; font-size: 14.5px; }
.login-foot { font-size: 12px; color: var(--faint); }

/* Аккаунт в сайдбаре + админка */
.acc-email { font-size: 12px; color: var(--muted); margin-bottom: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cred-box { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm);
    background: var(--success-soft); border: 1px solid #1c5e44; font-size: 13.5px; line-height: 1.7; }
.cred-box code { background: rgba(255,255,255,.08); padding: 2px 7px; border-radius: 6px;
    font-size: 13px; user-select: all; }

/* Баннер ошибки (например, проблема с ключами Avito) */
.alert-err { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px;
    padding: 13px 16px; border-radius: var(--radius-sm); background: var(--danger-soft);
    border: 1px solid #5e2424; color: #f3b4b4; font-size: 13.5px; }
.alert-err b { color: var(--danger); }

/* Онбординг — чек-лист для нового клиента */
.onb { margin-bottom: 18px; }
.onb-steps { display: grid; gap: 10px; }
.onb-step { display: flex; align-items: center; gap: 13px; padding: 13px 15px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.onb-step.done { opacity: .6; }
.onb-num { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid;
    place-items: center; font-weight: 700; font-size: 14px; background: var(--primary-soft); color: var(--primary); }
.onb-step.done .onb-num { background: var(--success-soft); color: var(--success); }
.onb-text { flex: 1; min-width: 0; }
.onb-text b { display: block; font-size: 14px; }
.onb-text span { font-size: 12.5px; color: var(--muted); }
.onb-step .btn { flex-shrink: 0; }
/* экспирация в админке */
.exp-quick { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.exp-quick .btn { padding: 4px 8px; font-size: 12px; }
/* ключи API заказов в строке аккаунта */
.ord-creds { display: flex; flex-direction: column; gap: 5px; margin-top: 8px;
    align-items: stretch; max-width: 230px; margin-left: auto; }
.ord-creds input { margin: 0; padding: 6px 9px; font-size: 12px; }
.ord-err { font-size: 11px; color: var(--danger); text-align: left; word-break: break-word; }
