@import "./shared.css";

/* ===== Оценка инвентаря (ClickHouse) ===== */
.valuation-panel {
    margin-top: 16px;
    padding: 6px 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.dark-theme .valuation-panel {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.valuation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.valuation-head.condensed {
    margin-bottom: 6px;
}

.valuation-hint {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.dark-theme .valuation-hint {
    color: #9ca3af;
}

.valuation-summary {
    margin-top: 12px;
    font-weight: 700;
}

.valuation-list {
    margin-top: 14px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
    justify-content: start;
    justify-items: start;
}

.valuation-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 8px 8px 10px;
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, filter 0.25s ease;
    position: relative;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    background: rgba(255, 255, 255, 0.94);
    width: 100%;
    max-width: 220px;
    align-items: start;
    box-sizing: border-box;
    overflow: hidden;
}

/* Легкая анимация появления карточек */
.valuation-list {
    animation: floatInPanel 0.5s ease;
}

.valuation-item.removed {
    opacity: 0.7;
    border-style: dashed;
    transform: scale(0.98);
}

.valuation-item:hover {
    border-color: #667eea;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 22px rgba(102, 126, 234, 0.16);
    background: rgba(255, 255, 255, 0.96);
}

.valuation-item.removed .valuation-figure img {
    filter: blur(1.2px) saturate(0.7);
    opacity: 0.8;
}

.dark-theme .valuation-item {
    border-color: #1f2937;
    background: #0b1220;
}

.valuation-quantity {
    margin-top: 4px;
    grid-column: 1 / -1;
    width: 100%;
}

.valuation-quantity label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 3px;
    display: inline-block;
}

.valuation-qty-input {
    display: grid;
    grid-template-columns: 20px auto 20px;
    align-items: stretch;
    gap: 2px;
    padding: 2px 3px;
    border-radius: 12px;
    background: rgba(249, 250, 251, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.valuation-qty-input input[type="number"] {
    align-self: stretch;
    justify-self: center;
    width: clamp(24px, 9vw, 30px);
    max-width: 30px;
    min-width: 24px;
    height: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 10px;
    border-radius: 5px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.valuation-qty-input input[type="number"]:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.valuation-qty-input input[type="number"]::-webkit-outer-spin-button,
.valuation-qty-input input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.valuation-qty-input .qty-btn {
    width: 20px;
    height: 24px;
    align-self: stretch;
    min-width: 0;
    flex: 0 0 20px;
    border-radius: 7px;
    border: 1px solid rgba(102, 126, 234, 0.42);
    background: linear-gradient(135deg, #e8edff 0%, #cdd8ff 100%);
    color: #1f2f9f;
    font-weight: 900;
    font-size: 10.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow:
        0 8px 16px rgba(102, 126, 234, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

.valuation-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.valuation-item *,
.valuation-qty-input,
.valuation-qty-input * {
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .valuation-qty-input {
        grid-template-columns: 20px auto 20px;
        gap: 2px;
        padding: 2px 3px;
        max-height: 36px;
    }
    .valuation-qty-input .qty-btn {
        width: 20px;
        height: 26px;
        flex: 0 0 20px;
        border-radius: 7px;
        font-size: 11px;
    }
    .valuation-qty-input input[type="number"] {
        justify-self: center;
        width: clamp(24px, 14vw, 32px);
        max-width: 32px;
        min-width: 24px;
        height: 24px;
        font-size: 9.5px;
    }
}

.valuation-qty-input .qty-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 9px 18px rgba(102, 126, 234, 0.26),
        0 0 0 1px rgba(102, 126, 234, 0.36) inset;
}

.valuation-qty-input .qty-btn:active {
    transform: translateY(0);
}

.valuation-qty-input {
    max-height: 56px;
}

.valuation-qty-hint {
    display: none;
}

.dark-theme .valuation-quantity {
    color: #e5e7eb;
}

.dark-theme .valuation-qty-input {
    background: rgba(20, 26, 40, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}

.dark-theme .valuation-qty-input input[type="number"] {
    color: #e5e7eb;
    background: rgba(22, 29, 46, 0.92);
    border-color: rgba(120, 150, 210, 0.32);
}

.dark-theme .valuation-qty-input .qty-btn {
    border-color: rgba(120, 150, 210, 0.34);
    background: linear-gradient(135deg, #1f2b46 0%, #1a2338 100%);
    color: #dbe5ff;
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.dark-theme .valuation-qty-input .qty-btn:hover {
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(120, 150, 210, 0.25) inset;
}

.dark-theme .valuation-qty-hint {
    color: #9ca3af;
}

.valuation-figure {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* В тёмной теме убираем светлый фон под изображениями предметов */
.dark-theme .valuation-figure {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.valuation-hover-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.2s ease;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.valuation-item:hover .valuation-hover-label {
    opacity: 1;
}

.valuation-item.removed .valuation-hover-label {
    opacity: 1;
    background: rgba(0, 0, 0, 0.4);
}

/* Финальный шаг — стиль как connection-panel */
#final-step-panel {
    margin-top: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.44);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        15px -15px 40px rgba(255, 220, 150, 0.12);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    max-width: 880px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

#final-step-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
    z-index: 1;
}

#final-step-panel:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    border-color: rgba(255, 255, 255, 0.6);
}

#final-step-panel h2 {
    color: #667eea;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#final-step-panel .final-step-content {
    background: rgba(255, 255, 255, 0.42);
    border-radius: 18px;
    padding: 20px;
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset,
        12px -12px 32px rgba(255, 220, 150, 0.1);
    transition: all 0.3s ease;
}

#final-step-panel .final-step-content:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset,
        14px -14px 38px rgba(255, 220, 150, 0.12);
    border-color: rgba(255, 255, 255, 0.62);
}

#final-step-panel .final-step-content > *:not(:last-child) {
    margin-bottom: 14px;
}

#final-step-panel .final-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

#final-step-panel .success-icon {
    font-size: 44px;
    margin: 0 8px 0 0;
    display: inline-flex;
    align-items: center;
}

#final-step-panel .final-message {
    color: #667eea;
    font-weight: 800;
    font-size: 1.2em;
    margin: 0;
    display: inline-flex;
    align-items: center;
}

#final-step-panel .success-icon + .final-message {
    display: inline-flex;
}

#final-step-panel .final-details {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

#final-step-panel .final-instructions {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(102, 126, 234, 0.22);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    margin-bottom: 12px;
}

#final-step-panel .final-instructions p {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

#final-step-panel .final-instructions ol {
    margin: 0;
    padding-left: 18px;
    color: #444;
    font-weight: 600;
    line-height: 1.5;
}

#final-step-panel .final-note {
    text-align: center;
    color: #4b5563;
    font-style: italic;
}

#final-step-panel .btn-large {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    text-decoration: none;
}

/* Темная тема для финального шага */
.dark-theme #final-step-panel,
.dark-theme .final-step-panel {
    background: rgba(11, 18, 32, 0.7);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.dark-theme #final-step-panel::before,
.dark-theme .final-step-panel::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.dark-theme #final-step-panel .final-step-content,
.dark-theme .final-step-content {
    background: rgba(17, 24, 39, 0.82);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.dark-theme #final-step-panel .final-details,
.dark-theme #final-step-panel .final-instructions,
.dark-theme .final-step-panel .final-details,
.dark-theme .final-step-panel .final-instructions {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

.dark-theme #final-step-panel .final-instructions p,
.dark-theme #final-step-panel .final-instructions ol,
.dark-theme #final-step-panel .final-instructions ol li,
.dark-theme .final-step-panel .final-instructions p,
.dark-theme .final-step-panel .final-instructions ol,
.dark-theme .final-step-panel .final-instructions ol li {
    color: #f9fafb;
}

.dark-theme #final-step-panel .final-note,
.dark-theme .final-step-panel .final-note {
    color: #9ca3af;
}
/* ===================== */
/* Финальный шаг (стиль как connection-panel) */
/* ===================== */
.final-step-panel {
    margin-top: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.44);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        15px -15px 40px rgba(255, 220, 150, 0.12);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    max-width: 880px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.final-step-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
    z-index: 1;
}

.final-step-panel:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    border-color: rgba(255, 255, 255, 0.6);
}

.final-step-panel h2 {
    color: #667eea;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-step-content {
    background: rgba(255, 255, 255, 0.42);
    border-radius: 18px;
    padding: 24px;
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset,
        12px -12px 32px rgba(255, 220, 150, 0.1);
    transition: all 0.3s ease;
}

.final-step-content:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset,
        14px -14px 38px rgba(255, 220, 150, 0.12);
    border-color: rgba(255, 255, 255, 0.62);
}

.final-step-content > *:not(:last-child) {
    margin-bottom: 14px;
}

.final-message {
    color: #667eea;
    font-weight: 800;
    font-size: 1.2em;
}

.final-details {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.final-instructions {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(102, 126, 234, 0.22);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    margin-bottom: 12px;
}

.final-instructions p {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.final-instructions ol {
    margin: 0;
    padding-left: 18px;
    color: #444;
    font-weight: 600;
    line-height: 1.5;
}

.final-note {
    text-align: center;
    color: #4b5563;
    font-style: italic;
}

.final-step-panel .success-icon {
    font-size: 56px;
    margin-bottom: 10px;
}

.final-step-panel .btn-large {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.valuation-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.valuation-item:hover .valuation-figure img {
    transform: scale(1.02);
    filter: saturate(1.05);
}

.valuation-thumb-ph {
    font-size: 28px;
    opacity: 0.75;
}

.valuation-subid {
    display: none;
}

.valuation-price-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 9px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.3);
    font-size: 12px;
    z-index: 3;
}

.valuation-badges {
    position: absolute;
    bottom: 6px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 3;
}

.valuation-badges img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    border: 1px solid rgba(102, 126, 234, 0.35);
    object-fit: contain;
    padding: 2px;
}

.valuation-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.valuation-badge-fallback {
    display: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #4b5563;
    font-weight: 800;
    font-size: 13px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(102, 126, 234, 0.35);
}

.valuation-badge img.broken {
    display: none;
}

.valuation-badge img.broken + .valuation-badge-fallback {
    display: inline-flex;
}

.valuation-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.95);
    color: #1f2937;
    font-weight: 800;
    border-radius: 9px;
    padding: 4px 8px;
    border: 1px solid rgba(102,126,234,0.25);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    font-size: 12px;
    z-index: 3;
}

.valuation-name .valuation-chip {
    display: none !important;
}

.valuation-meta {
    display: none !important;
}

.valuation-count {
    color: #1f2937;
    font-weight: 800;
    margin-left: 6px;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(102,126,234,0.25);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 13px;
}

.valuation-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    min-width: 0;
    font-size: 16px;
}

.valuation-item-id {
    font-size: 15px;
}

.valuation-subid {
    font-size: 13px;
    color: #6b7280;
    word-break: break-all;
}

.valuation-count {
    color: #374151;
    font-weight: 800;
    margin-left: 6px;
}

.valuation-meta {
    display: none !important;
}

.valuation-chip {
    padding: 2px 10px;
    background: #eef2ff;
    color: #1d4ed8;
    border-radius: 999px;
    font-size: 12px;
}

.valuation-chip.muted {
    background: #f3f4f6;
    color: #4b5563;
}

.dark-theme .valuation-chip {
    background: #1e3a8a;
    color: #e0e7ff;
}

.valuation-empty,
.valuation-error,
.valuation-loading {
    margin: 12px 0;
    color: #6b7280;
}

.valuation-error {
    color: #dc2626;
}

.valuation-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.valuation-modal.hidden {
    display: none;
}

.valuation-modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px;
    max-width: 640px;
    width: 92%;
    position: relative;
}

.dark-theme .valuation-modal-content {
    background: #0b1220;
    color: #e5e7eb;
}

.valuation-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
}

.valuation-modal-price {
    margin: 10px 0;
    font-weight: 700;
}

.valuation-props-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.valuation-prop {
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 12px;
}

.dark-theme .valuation-prop {
    border-color: #1f2937;
    background: #0f172a;
}

.valuation-prop strong {
    display: block;
    margin-top: 4px;
}

.valuation-json {
    background: #0f172a;
    color: #e5e7eb;
    padding: 10px;
    border-radius: 10px;
    font-size: 12px;
    max-height: 260px;
    overflow: auto;
    margin: 8px 0;
}

.valuation-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.valuation-remove:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.valuation-toggle {
    position: relative;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.35);
    background: rgba(255, 255, 255, 0.9);
    color: #4b5563;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 6px 14px rgba(0,0,0,0.08),
        0 0 0 1px rgba(255,255,255,0.6) inset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 8px 12px;
}

.valuation-toggle:hover {
    transform: translateY(-1px);
    border-color: #667eea;
    color: #667eea;
    box-shadow:
        0 10px 18px rgba(102, 126, 234, 0.18),
        0 0 0 1px rgba(255,255,255,0.7) inset;
}

.valuation-toggle.is-removed {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #0f9f74;
}

.valuation-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    height: 100%;
}

.valuation-body-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.valuation-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.payment-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.payment-modal.open {
    display: flex;
}

.payment-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.25s ease, transform 0.3s ease;
}

.payment-modal__card {
    position: relative;
    max-width: 520px;
    width: 92%;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    z-index: 1001;
    opacity: 0;
    transform: translateY(18px) scale(0.95);
    transition: opacity 0.28s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme .payment-modal__card {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(255,255,255,0.08);
}

.payment-modal.open .payment-modal__card {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: modalPop 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.payment-modal__backdrop {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.payment-modal.open .payment-modal__backdrop {
    opacity: 1;
    transform: scale(1);
}

.payment-modal.open .payment-methods {
    opacity: 1;
    transform: translateY(0);
}

.payment-methods {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    background: #fafafa;
}

.payment-method:hover {
    border-color: #667eea;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.18);
}

.payment-method.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.26);
    transform: translateY(-1px);
}

.payment-method.selected .payment-check {
    opacity: 1;
    transform: scale(1);
}

.payment-form {
    margin-top: 20px;
    padding: 20px;
    background: #f5f7fa;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.payment-form.show {
    opacity: 1;
    transform: translateY(0);
}
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    border-radius: 18px;
}

.dark-theme .glass-card {
    background: rgba(17,24,39,0.7);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.payment-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.9);
    color: #374151;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.payment-modal__close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.payment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
.btn-sell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        0 10px 28px rgba(102, 126, 234, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

/* Менее яркая кнопка в тёмной теме */
.dark-theme .btn-sell {
    background: rgba(15, 18, 28, 0.9) !important;
    border: 1px solid rgba(90, 120, 170, 0.04) !important;
    box-shadow: none !important;
    color: #e5e7eb !important;
}

.dark-theme .btn-sell:hover {
    background: rgba(17, 21, 32, 0.95) !important;
    box-shadow: none !important;
}

/* Отключаем свечения/эффекты от базового btn-primary для Sell в тёмной теме */
.dark-theme .btn-sell::before,
.dark-theme .btn-sell::after {
    display: none !important;
    content: none !important;
}

.btn-sell:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow:
        0 14px 36px rgba(102, 126, 234, 0.45),
        0 0 0 2px rgba(255, 255, 255, 0.5) inset;
}

.btn-sell:active {
    transform: translateY(-1px);
}

/* Панель инвентаря в стиле шага подключения */
#inventory-panel {
    position: relative;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 30px;
    margin-top: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        15px -15px 40px rgba(255, 220, 150, 0.12),
        25px -25px 60px rgba(255, 200, 100, 0.08);
    overflow: hidden;
    animation: floatInPanel 0.7s ease;
}

#inventory-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
    z-index: 1;
}

#inventory-panel:hover {
    background: rgba(255, 255, 255, 0.52);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset,
        15px -15px 44px rgba(255, 220, 150, 0.16);
    border-color: rgba(255, 255, 255, 0.6);
}

body.dark-theme #inventory-panel {
    background: rgba(15, 20, 40, 0.6);
    border-color: rgba(80, 100, 150, 0.3);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(60, 80, 120, 0.2) inset;
}

body.dark-theme #inventory-panel:hover {
    background: rgba(20, 30, 50, 0.7);
    border-color: rgba(100, 120, 180, 0.4);
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.55),
        0 0 0 2px rgba(80, 100, 150, 0.28) inset;
}

#inventory-panel .valuation-panel {
    margin-top: 10px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

#inventory-panel .valuation-head {
    margin-bottom: 12px;
}

#inventory-panel .valuation-summary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    font-size: 17px;
    font-weight: 800;
    color: #333;
    backdrop-filter: blur(14px);
}

#inventory-panel .valuation-summary::before {
    content: '✨';
    font-size: 18px;
    line-height: 1;
}

body.dark-theme #inventory-panel .valuation-summary {
    background: rgba(20, 30, 50, 0.65);
    border-color: rgba(100, 120, 180, 0.35);
    color: #e0e0e0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

#inventory-panel .valuation-list {
    margin-top: 18px;
    animation: floatInPanel 0.6s ease;
}

#inventory-panel .valuation-actions {
    margin-top: 18px;
}

#valuation-sell.btn-sell {
    width: 100%;
    animation: floatInPanel 0.6s ease 0.05s backwards, ctaBreath 5s ease-in-out infinite;
}

@keyframes floatInPanel {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ctaBreath {
    0%, 100% {
        box-shadow:
            0 10px 28px rgba(102, 126, 234, 0.35),
            0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    }
    50% {
        box-shadow:
            0 14px 36px rgba(102, 126, 234, 0.5),
            0 0 0 2px rgba(255, 255, 255, 0.55) inset;
    }
}
