/* Улучшенные карточки для канбана этапов торгов */

.stage-card-v2 {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    cursor: move;
    transition: all 0.2s ease;
    position: relative;
}

.stage-card-v2-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.stage-card-v2-delete:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.stage-card-v2-delete svg {
    width: 14px;
    height: 14px;
}

.stage-card-v2:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.stage-card-v2.overdue {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
}

.stage-card-v2.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

/* Шапка карточки */
.stage-card-v2-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.stage-card-v2-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.stage-card-v2-info {
    flex: 1;
    min-width: 0;
}

.stage-card-v2-client {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stage-card-v2-manager {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stage-card-v2-manager svg {
    color: var(--text-tertiary);
}

.stage-card-v2-urgent {
    font-size: 18px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Информация о лоте */
.stage-card-v2-lot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stage-card-v2-lot svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Бейджи */
.stage-card-v2-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.stage-card-v2-badges .stage-badge {
    font-size: 11px;
    padding: 3px 8px;
}

/* Дата */
.stage-card-v2-date {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #3b82f6;
    margin-bottom: 10px;
}

.stage-card-v2-date svg {
    flex-shrink: 0;
}

.stage-card-v2-date.overdue {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Действия */
.stage-card-v2-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.stage-card-v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    text-decoration: none;
    white-space: nowrap;
}

.stage-card-v2-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    flex: 1;
}

.stage-card-v2-btn.primary:hover {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.stage-card-v2-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

.stage-card-v2-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

.stage-card-v2-move {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.stage-card-v2-move-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stage-card-v2-move-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.stage-card-v2-move-btn:active {
    transform: scale(0.95);
}

/* Фильтры и поиск */
.stages-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stages-search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.stages-search-input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.stages-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.stages-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.stages-filter-select {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.stages-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Метрики над канбаном */
.stages-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stages-metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.stages-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stages-metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stages-metric-card.urgent .stages-metric-value {
    color: #ef4444;
}

/* Переключатель режимов просмотра */
.stages-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
}

.stages-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stages-view-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.stages-view-btn.active {
    background: #3b82f6;
    color: white;
}

.stages-view-btn svg {
    width: 16px;
    height: 16px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .stage-card-v2-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .stages-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stages-search-box {
        min-width: 100%;
    }
    
    .stages-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stage-card-v2-actions {
        flex-direction: column;
    }
    
    .stage-card-v2-btn {
        width: 100%;
    }
    
    .stage-card-v2-move {
        width: 100%;
        margin-left: 0;
    }
    
    .stage-card-v2-move-btn {
        flex: 1;
    }
}
