/*
  Лёгкий macOS-подобный стиль: мягкие тени, стекло, нейтральная типографика
*/

:root {
    --bg: #0b0c10;              /* глубокий тёмный фон (не чисто чёрный) */
    --panel: rgba(255,255,255,0.06);
    --card: rgba(255,255,255,0.08);
    --stroke: rgba(255,255,255,0.12);
    --text: #e6e8eb;
    --muted: #a5acb8;
    --accent: #4da3ff;
    --accent-strong: #2c7ae0;
    --success: #34c759;
    --focus: rgba(77,163,255,0.35);
    --shadow: 0 10px 30px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.05) inset;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: radial-gradient(1200px 800px at 20% -10%, rgba(77,163,255,0.18), transparent 60%),
                radial-gradient(1000px 650px at 120% 10%, rgba(52,199,89,0.15), transparent 60%),
                var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.app {
    height: 100vh; /* фиксируем высоту на высоту окна */
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.app__header {
    position: sticky;
    top: 0;
    backdrop-filter: saturate(140%) blur(14px);
    background: linear-gradient(to bottom, rgba(20,22,26,0.7), rgba(20,22,26,0.35));
    border-bottom: 1px solid var(--stroke);
    padding: 16px 24px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8bc8ff);
    box-shadow: 0 0 16px rgba(77,163,255,0.8), inset 0 0 6px rgba(255,255,255,0.6);
}
.brand__title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0.2px; }
.brand__id { color: var(--muted); font-weight: 500; }

.app__main {
    display: grid;
    grid-template-columns: 420px minmax(0,1fr);
    gap: 24px;
    padding: 24px;
    overflow: auto; /* разрешаем прокрутку основной области */
}
.app__main::-webkit-scrollbar { width: 10px; }
.app__main::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
.app__main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.app__main::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.left-column { display: flex; flex-direction: column; gap: 16px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
}
.panel__title { margin: 0 0 12px 0; font-size: 16px; font-weight: 600; color: var(--muted); }

.form { display: grid; gap: 16px; }
.form__row { display: grid; gap: 8px; }
.form__label { font-size: 13px; color: var(--muted); }
.form__hint { font-size: 12px; color: var(--muted); opacity: 0.8; }
/* структура топологии */
#topology-structure { margin-top: 4px; }
#topology-structure .level { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
#topology-structure .delimiter { color: var(--muted); margin: 0 6px; }

.location-inputs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.location-inputs .level-label { color: var(--muted); font-size: 13px; }
.location-inputs .level-delim { color: var(--muted); margin: 0 4px; }
.location-inputs .level-input {
    width: 56px; /* компактнее под 2-3 цифры */
    text-align: center;
}
/* убрать стрелки у number */
.location-inputs .level-input::-webkit-outer-spin-button,
.location-inputs .level-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.location-inputs .level-input[type=number] { -moz-appearance: textfield; }

.input, .select {
    width: 100%;
    height: 40px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    color: var(--text);
    outline: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.input:hover, .select:hover { background: rgba(255,255,255,0.08); }
.input:focus, .select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--focus);
}
.input:disabled, .select:disabled { opacity: 0.6; filter: grayscale(20%); cursor: not-allowed; }

/* macOS-like select styling */
.select-wrap { position: relative; }
.select-wrap::after {
    content: '';
    position: absolute;
    right: 10px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 8l3.5 3.5L13.5 8' stroke='%23a5acb8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-size: 18px 18px;
    opacity: 0.9;
}
.select-wrap:has(select:focus)::after {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 8l3.5 3.5L13.5 8' stroke='%234da3ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}
.select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 38px; /* space for chevron */
    font-size: 14px;
    line-height: 20px;
    background-image: none; /* moved to wrapper */
}
.select::-ms-expand { display: none; }

/* options (поддержка зависит от браузера) */
.select option { background: #14161a; color: var(--text); }
.select option[disabled] { color: var(--muted); }

.input-with-adornment { position: relative; }
.input-with-adornment .input { padding-right: 40px; }
.ghost-button {
    position: absolute;
    right: 8px; top: 50%; transform: translateY(-50%);
    height: 28px; min-width: 28px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    cursor: pointer;
}
.ghost-button:hover { border-color: var(--stroke); background: rgba(255,255,255,0.04); }

.input-with-button { display: flex; gap: 8px; align-items: center; }
.input-with-button .input { flex: 1; }

.primary-button {
    height: 40px; padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(77,163,255,0.6);
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: white; font-weight: 600; letter-spacing: 0.2px;
    box-shadow: 0 8px 20px rgba(77,163,255,0.35);
    cursor: pointer;
    transition: transform 0.06s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.primary-button:hover { filter: brightness(1.05); box-shadow: 0 12px 28px rgba(77,163,255,0.45); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: 0.6; box-shadow: none; cursor: not-allowed; }

.form__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Блок сканера */
.scanner-panel { display: flex; flex-direction: column; gap: 12px; }
.toggle-switch {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.toggle-switch__slider {
    position: relative;
    width: 48px; height: 28px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    transition: background 0.2s ease;
}
.toggle-switch__slider::after {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 20px; height: 20px;
    background: var(--muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}
.toggle-switch input:checked + .toggle-switch__slider {
    background: var(--accent);
}
.toggle-switch input:checked + .toggle-switch__slider::after {
    left: 23px;
    background: white;
}
.toggle-switch input { display: none; }
.toggle-switch__label { font-size: 14px; color: var(--text); }
.scanner-queue { margin-top: 8px; padding: 10px; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid var(--stroke); }
.scanner-queue__title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.queue-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.queue-item { padding: 6px 8px; background: rgba(255,255,255,0.05); border-radius: 6px; font-size: 12px; color: var(--muted); }
.queue-item--processing { color: var(--accent); font-weight: 500; }
.queue-item--choice { color: #ff9944; }
.queue-item--ean-ready { color: var(--success); }
.queue-item--notfound { opacity: 0.8; }
.queue-item__info { 
    display: inline-block; 
    margin-left: 6px; 
    cursor: pointer; 
    color: var(--accent); 
    font-size: 14px;
    opacity: 0.7;
}
.queue-item__info:hover { opacity: 1; }

.queue-tooltip-float {
    position: fixed;
    min-width: 300px;
    background: rgba(18,20,24,0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    padding: 14px;
    z-index: 1001;
}
.queue-tooltip__row { margin-bottom: 8px; font-size: 13px; }
.queue-tooltip__label { color: var(--muted); display: inline-block; width: 80px; }
.queue-tooltip__value { color: var(--text); font-weight: 500; }

.right-pane {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    min-height: 420px;
    height: 125%; /* окна выше на ~25%, основная область прокручивается */
}
.box {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.box__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 14px;
    border-bottom: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
.box__title { font-weight: 600; color: var(--muted); font-size: 14px; }
.box__title-wrap { display: flex; flex-direction: column; gap: 3px; }
.box__actions { display: flex; align-items: center; gap: 10px; }
.checkbox-all { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.checkbox-all--small { font-size: 11px; }
.checkbox-all--small input[type="checkbox"] { width: 14px; height: 14px; }
.box__content { padding: 6px; overflow: auto; }
.box { min-height: 0; }
.box__content { flex: 1 1 auto; }
.box__content::-webkit-scrollbar { width: 8px; }
.box__content::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 8px; }
.box__content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.box__content::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

.row { display: grid; grid-template-columns: 28px 1fr auto; align-items: start; gap: 10px; padding: 8px; border-radius: 8px; }
.row + .row { margin-top: 4px; }
.row:hover { background: rgba(255,255,255,0.04); }
.row__content { display: flex; flex-direction: column; gap: 4px; }
.row__brand-article { font-weight: 600; font-size: 14px; color: var(--accent); }
.row__name-line { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.row__meta-info { color: var(--muted); font-size: 12px; }
.row__location-recommendations { 
    color: var(--muted); 
    font-size: 11px; 
    margin-top: 2px; 
    opacity: 0.8;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.row__location-recommendations:hover {
    opacity: 1;
}
.location-clickable {
    transition: color 0.2s ease, opacity 0.2s ease;
}
.location-clickable:hover {
    opacity: 0.8;
    color: var(--accent-strong) !important;
}

/* Кастомная подсказка */
.custom-tooltip {
    position: absolute;
    z-index: 10000;
    display: none;
    max-width: 300px;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease-out;
}

.custom-tooltip__content {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: saturate(140%) blur(14px);
}

.custom-tooltip__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--stroke);
}

.custom-tooltip__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-tooltip__location {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(77, 163, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.custom-tooltip__body {
    font-size: 13px;
    line-height: 1.4;
}

.custom-tooltip__stats {
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-tooltip__stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 11px;
}

.custom-tooltip__stat-item:last-child {
    margin-bottom: 0;
}

.custom-tooltip__stat-label {
    color: var(--muted);
    font-weight: 500;
}

.custom-tooltip__stat-value {
    color: var(--accent);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 20px;
    text-align: center;
}

.custom-tooltip__instruction {
    color: var(--text);
    margin-bottom: 6px;
}

.custom-tooltip__items {
    margin-top: 6px;
}

.custom-tooltip__items-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}

.custom-tooltip__items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: none;
    overflow: visible;
}

.custom-tooltip__items-list::-webkit-scrollbar {
    width: 4px;
}

.custom-tooltip__items-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.custom-tooltip__items-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.custom-tooltip__items-list li {
    padding: 2px 0;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    line-height: 1.2;
}

.custom-tooltip__items-list li:last-child {
    border-bottom: none;
}

.custom-tooltip__items-list li::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    margin-right: 6px;
}

.custom-tooltip__arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-top-color: var(--stroke);
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
}

.custom-tooltip__arrow::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-top-color: var(--card);
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
}

/* Стрелка для подсказки снизу */
.custom-tooltip--bottom .custom-tooltip__arrow {
    border-top-color: transparent;
    border-bottom-color: var(--stroke);
    top: -12px;
    bottom: auto;
}

.custom-tooltip--bottom .custom-tooltip__arrow::after {
    border-top-color: transparent;
    border-bottom-color: var(--card);
    top: 1px;
    bottom: auto;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.row__delete {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: #ff4444;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex; align-items: center; justify-content: center;
}
.row__delete:hover { background: rgba(255,68,68,0.15); border-color: rgba(255,68,68,0.3); }

/* количество в строке */
.qty-input {
    width: 64px;
    height: 28px;
    padding: 0 8px;
    margin-left: 8px;
    text-align: center;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type=number] { -moz-appearance: textfield; }

.secondary-button {
    height: 34px; padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.secondary-button:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.28); }
.secondary-button:disabled { opacity: 0.6; cursor: not-allowed; }

.search-dropdown-wrap { position: relative; min-width: 650px; flex: 1; max-width: 600px; }
.search-dropdown {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    max-height: 400px; overflow-y: auto;
    background: rgba(18,20,24,0.98); 
    backdrop-filter: blur(20px);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 200;
}
.search-dropdown::-webkit-scrollbar { width: 8px; }
.search-dropdown::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 8px; }
.search-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.search-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.search-dropdown__item {
    padding: 10px 12px; cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s ease;
}
.search-dropdown__item:hover { background: rgba(255,255,255,0.08); }
.search-dropdown__item.selected { background: rgba(77,163,255,0.25); border-left: 3px solid var(--accent); }
.search-dropdown__item:last-child { border-bottom: none; }
.search-dropdown__brand-article { font-weight: 600; font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.search-dropdown__name { font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.search-dropdown__meta { color: var(--muted); font-size: 11px; }
.empty-pool { text-align: center; color: var(--muted); padding: 20px; position: relative; z-index: 1; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(77,163,255,0.18);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
    border: 1px solid rgba(77,163,255,0.5);
}

.app__footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px;
    border-top: 1px solid var(--stroke);
    background: linear-gradient(to top, rgba(20,22,26,0.7), rgba(20,22,26,0.35));
    backdrop-filter: blur(12px);
}
.status { color: var(--muted); font-size: 12px; }

/* модальное окно */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Диалог подтверждения должен быть поверх всех модальных окон */
#confirm-dialog {
    z-index: 3000;
}
/* Основная модалка должна быть поверх модального окна инвентаря */
.modal:not(#confirm-dialog) {
    z-index: 2000;
}
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
}
.modal__content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
}
.modal__title { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.modal__close {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex; align-items: center; justify-content: center;
}
.modal__close:hover { background: rgba(255,255,255,0.08); border-color: var(--stroke); }
.modal__body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.modal__body::-webkit-scrollbar { width: 8px; }
.modal__body::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 8px; }
.modal__body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.modal__body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* модальное окно инвентаря */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
}
.modal-overlay.hidden {
    display: none;
}
.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--stroke);
}
.modal-refresh {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-refresh:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--stroke);
    color: var(--accent);
}
.modal-refresh:active {
    transform: rotate(180deg);
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}
.modal-buttons {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--stroke);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.08));
    justify-content: flex-end;
}
.modal-button {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--stroke);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.modal-button:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--accent);
}
.modal-button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.modal-button.primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}
.modal-button.secondary {
    background: transparent;
    color: var(--muted);
}
.modal-button.secondary:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* toast уведомления */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    backdrop-filter: blur(10px);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast.success {
    border-left: 4px solid var(--success);
}
.toast.error {
    border-left: 4px solid #ff3b30;
}
.toast.info {
    border-left: 4px solid var(--accent);
}
.toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.toast-icon {
    font-size: 18px;
}
.toast-title {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}
.toast-message {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

/* стили для результатов инвентаря */
.inventory-cell {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
}
.inventory-cell-header {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 16px;
}
.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.inventory-item:last-child {
    border-bottom: none;
}
.inventory-item-name {
    flex: 1;
    color: var(--text);
    font-size: 14px;
}
.inventory-item-clickable {
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px;
    padding: 4px;
    margin: -4px;
}
.inventory-item-clickable:hover {
    background: rgba(255,255,255,0.05);
    color: var(--accent);
}
.inventory-item-clickable:active {
    background: rgba(255,255,255,0.1);
    transform: scale(0.98);
}
.inventory-item-details {
    color: var(--muted);
    font-size: 12px;
    margin-left: 12px;
}
.inventory-detach-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.inventory-detach-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--stroke);
    color: var(--accent);
    transform: scale(1.1);
}
.inventory-detach-btn:active {
    transform: scale(0.95);
}
.inventory-detach-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
/* Стили для текста аналогов */
.analogues-text:hover {
    color: var(--accent) !important;
}

/* форма добавления товара */
.form__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form__label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(235,235,245,0.6);
}

/* адаптивность */
@media (max-width: 980px) {
    .app__main { grid-template-columns: 1fr; }
    .right-pane { grid-template-rows: auto auto; }
}


